Merge pull request #6131 from sum2012/Net

Small improve of sceNetAdhocMatching*
This commit is contained in:
Henrik Rydgård 2014-05-25 09:24:32 +02:00
commit 95c95d07a4

View File

@ -89,6 +89,51 @@ enum {
PSP_ADHOC_POLL_CAN_ACCEPT = 8,
};
enum {
/**
* Matching events used in pspAdhocMatchingCallback
*/
/** Hello event. optdata contains data if optlen > 0. */
PSP_ADHOC_MATCHING_EVENT_HELLO = 1,
/** Join request. optdata contains data if optlen > 0. */
PSP_ADHOC_MATCHING_EVENT_JOIN = 2,
/** Target left matching. */
PSP_ADHOC_MATCHING_EVENT_LEFT = 3,
/** Join request rejected. */
PSP_ADHOC_MATCHING_EVENT_REJECT = 4,
/** Join request cancelled. */
PSP_ADHOC_MATCHING_EVENT_CANCEL = 5,
/** Join request accepted. optdata contains data if optlen > 0. */
PSP_ADHOC_MATCHING_EVENT_ACCEPT = 6,
/** Matching is complete. */
PSP_ADHOC_MATCHING_EVENT_COMPLETE = 7,
/** Ping timeout event. */
PSP_ADHOC_MATCHING_EVENT_TIMEOUT = 8,
/** Error event. */
PSP_ADHOC_MATCHING_EVENT_ERROR = 9,
/** Peer disconnect event. */
PSP_ADHOC_MATCHING_EVENT_DISCONNECT = 10,
/** Data received event. optdata contains data if optlen > 0. */
PSP_ADHOC_MATCHING_EVENT_DATA = 11,
/** Data acknowledged event. */
PSP_ADHOC_MATCHING_EVENT_DATA_CONFIRM = 12,
/** Data timeout event. */
PSP_ADHOC_MATCHING_EVENT_DATA_TIMEOUT = 13,
/** Internal ping message. */
PSP_ADHOC_MATCHING_EVENT_INTERNAL_PING = 100,
/**
* Matching modes used in sceNetAdhocMatchingCreate
*/
/** Host */
PSP_ADHOC_MATCHING_MODE_HOST = 1,
/** Client */
PSP_ADHOC_MATCHING_MODE_CLIENT = 2,
/** Peer to peer */
PSP_ADHOC_MATCHING_MODE_PTP = 3,
};
const size_t MAX_ADHOCCTL_HANDLERS = 32;
static bool netAdhocInited;
@ -2049,67 +2094,93 @@ int sceNetAdhocMatchingCreate(int mode, int maxnum, int port, int rxbuflen, int
int sceNetAdhocMatchingStart(int matchingId, int evthPri, int evthStack, int inthPri, int inthStack, int optLen, u32 optDataAddr) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingStart(%i, %i, %i, %i, %i, %i, %08x)", matchingId, evthPri, evthStack, inthPri, inthStack, optLen, optDataAddr);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingStop(int matchingId) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingStop(%i)", matchingId);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingDelete(int matchingId) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingDelete(%i)", matchingId);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddress, int optLen, u32 optDataPtr) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingSelectTarget(%i, %s, %i, %08x)", matchingId, macAddress, optLen, optDataPtr);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingCancelTargetWithOpt(int matchingId, const char *macAddress, int optLen, u32 optDataPtr) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingCancelTargetWithOpt(%i, %s, %i, %08x)", matchingId, macAddress, optLen, optDataPtr);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingCancelTarget(int matchingId, const char *macAddress) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingCancelTarget(%i, %s)", matchingId, macAddress);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingGetHelloOpt(int matchingId, u32 optLenAddr, u32 optDataAddr) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingGetHelloOpt(%i, %08x, %08x)", matchingId, optLenAddr, optDataAddr);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingSetHelloOpt(int matchingId, int optLenAddr, u32 optDataAddr) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingSetHelloOpt(%i, %i, %08x)", matchingId, optLenAddr, optDataAddr);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingGetMembers(int matchingId, u32 sizeAddr, u32 buf) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingGetMembers(%i, %08x, %08x)", matchingId, sizeAddr, buf);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingSendData(int matchingId, const char *mac, int dataLen, u32 dataAddr) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingSendData(%i, %s, %i, %08x)", matchingId, mac, dataLen, dataAddr);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingAbortSendData(int matchingId, const char *mac) {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingAbortSendData(%i, %s)", matchingId, mac);
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingGetPoolMaxAlloc() {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingGetPoolMaxAlloc()");
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
int sceNetAdhocMatchingGetPoolStat() {
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocMatchingGetPoolStat()");
return -1;
if (!g_Config.bEnableWlan)
return -1;
return 0;
}
const HLEFunction sceNetAdhoc[] = {