PSPSDK 2024-10-31
Loading...
Searching...
No Matches
pspnet_adhocmatching.h File Reference

Go to the source code of this file.

Data Structures

struct  pspAdhocMatchingMember
 Linked list for sceNetAdhocMatchingGetMembers. More...
 
struct  pspAdhocPoolStat
 Linked list for sceNetAdhocMatchingGetMembers. More...
 

Typedefs

typedef void(* pspAdhocMatchingCallback) (int matchingid, int event, unsigned char *mac, int optlen, void *optdata)
 Matching callback.
 

Enumerations

enum  pspAdhocMatchingEvents {
  PSP_ADHOC_MATCHING_EVENT_HELLO = 1 , PSP_ADHOC_MATCHING_EVENT_JOIN = 2 , PSP_ADHOC_MATCHING_EVENT_LEFT = 3 , PSP_ADHOC_MATCHING_EVENT_REJECT = 4 ,
  PSP_ADHOC_MATCHING_EVENT_CANCEL = 5 , PSP_ADHOC_MATCHING_EVENT_ACCEPT = 6 , PSP_ADHOC_MATCHING_EVENT_COMPLETE = 7 , PSP_ADHOC_MATCHING_EVENT_TIMEOUT = 8 ,
  PSP_ADHOC_MATCHING_EVENT_ERROR = 9 , PSP_ADHOC_MATCHING_EVENT_DISCONNECT = 10 , PSP_ADHOC_MATCHING_EVENT_DATA = 11 , PSP_ADHOC_MATCHING_EVENT_DATA_CONFIRM = 12 ,
  PSP_ADHOC_MATCHING_EVENT_DATA_TIMEOUT = 13
}
 Matching events used in pspAdhocMatchingCallback. More...
 
enum  pspAdhocMatchingModes { PSP_ADHOC_MATCHING_MODE_HOST = 1 , PSP_ADHOC_MATCHING_MODE_CLIENT = 2 , PSP_ADHOC_MATCHING_MODE_PTP = 3 }
 Matching modes used in sceNetAdhocMatchingCreate. More...
 

Functions

int sceNetAdhocMatchingInit (int memsize)
 Initialise the Adhoc matching library.
 
int sceNetAdhocMatchingTerm (void)
 Terminate the Adhoc matching library.
 
int sceNetAdhocMatchingCreate (int mode, int maxpeers, unsigned short port, int bufsize, unsigned int hellodelay, unsigned int pingdelay, int initcount, unsigned int msgdelay, pspAdhocMatchingCallback callback)
 Create an Adhoc matching object.
 
int sceNetAdhocMatchingDelete (int matchingid)
 Delete an Adhoc matching object.
 
int sceNetAdhocMatchingStart (int matchingid, int evthpri, int evthstack, int inthpri, int inthstack, int optlen, void *optdata)
 Start a matching object.
 
int sceNetAdhocMatchingStop (int matchingid)
 Stop a matching object.
 
int sceNetAdhocMatchingSelectTarget (int matchingid, unsigned char *mac, int optlen, void *optdata)
 Select a matching target.
 
int sceNetAdhocMatchingCancelTarget (int matchingid, unsigned char *mac)
 Cancel a matching target.
 
int sceNetAdhocMatchingCancelTargetWithOpt (int matchingid, unsigned char *mac, int optlen, void *optdata)
 Cancel a matching target (with optional data)
 
int sceNetAdhocMatchingSendData (int matchingid, unsigned char *mac, int datalen, void *data)
 Send data to a matching target.
 
int sceNetAdhocMatchingAbortSendData (int matchingid, unsigned char *mac)
 Abort a data send to a matching target.
 
int sceNetAdhocMatchingSetHelloOpt (int matchingid, int optlen, void *optdata)
 Set the optional hello message.
 
int sceNetAdhocMatchingGetHelloOpt (int matchingid, int *optlen, void *optdata)
 Get the optional hello message.
 
int sceNetAdhocMatchingGetMembers (int matchingid, int *length, void *buf)
 Get a list of matching members.
 
int sceNetAdhocMatchingGetPoolMaxAlloc (void)
 Get the maximum memory usage by the matching library.
 
int sceNetAdhocMatchingGetPoolStat (struct pspAdhocPoolStat *poolstat)
 Get the status of the memory pool used by the matching library.
 

Typedef Documentation

◆ pspAdhocMatchingCallback

typedef void(* pspAdhocMatchingCallback) (int matchingid, int event, unsigned char *mac, int optlen, void *optdata)

Matching callback.

Enumeration Type Documentation

◆ pspAdhocMatchingEvents

Matching events used in pspAdhocMatchingCallback.

Enumerator
PSP_ADHOC_MATCHING_EVENT_HELLO 

Hello event.

optdata contains data if optlen > 0.

PSP_ADHOC_MATCHING_EVENT_JOIN 

Join request.

optdata contains data if optlen > 0.

PSP_ADHOC_MATCHING_EVENT_LEFT 

Target left matching.

PSP_ADHOC_MATCHING_EVENT_REJECT 

Join request rejected.

PSP_ADHOC_MATCHING_EVENT_CANCEL 

Join request cancelled.

PSP_ADHOC_MATCHING_EVENT_ACCEPT 

Join request accepted.

optdata contains data if optlen > 0.

PSP_ADHOC_MATCHING_EVENT_COMPLETE 

Matching is complete.

PSP_ADHOC_MATCHING_EVENT_TIMEOUT 

Ping timeout event.

PSP_ADHOC_MATCHING_EVENT_ERROR 

Error event.

PSP_ADHOC_MATCHING_EVENT_DISCONNECT 

Peer disconnect event.

PSP_ADHOC_MATCHING_EVENT_DATA 

Data received event.

optdata contains data if optlen > 0.

PSP_ADHOC_MATCHING_EVENT_DATA_CONFIRM 

Data acknowledged event.

PSP_ADHOC_MATCHING_EVENT_DATA_TIMEOUT 

Data timeout event.

◆ pspAdhocMatchingModes

Matching modes used in sceNetAdhocMatchingCreate.

Enumerator
PSP_ADHOC_MATCHING_MODE_HOST 

Host.

PSP_ADHOC_MATCHING_MODE_CLIENT 

Client.

PSP_ADHOC_MATCHING_MODE_PTP 

Peer to peer.

Function Documentation

◆ sceNetAdhocMatchingAbortSendData()

int sceNetAdhocMatchingAbortSendData ( int  matchingid,
unsigned char mac 
)

Abort a data send to a matching target.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
mac- The MAC address to send the data to
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingCancelTarget()

int sceNetAdhocMatchingCancelTarget ( int  matchingid,
unsigned char mac 
)

Cancel a matching target.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
mac- The MAC address to cancel
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingCancelTargetWithOpt()

int sceNetAdhocMatchingCancelTargetWithOpt ( int  matchingid,
unsigned char mac,
int  optlen,
void optdata 
)

Cancel a matching target (with optional data)

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
mac- The MAC address to cancel
optlen- Optional data length
optdata- Pointer to the optional data
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingCreate()

int sceNetAdhocMatchingCreate ( int  mode,
int  maxpeers,
unsigned short  port,
int  bufsize,
unsigned int  hellodelay,
unsigned int  pingdelay,
int  initcount,
unsigned int  msgdelay,
pspAdhocMatchingCallback  callback 
)

Create an Adhoc matching object.

Parameters
mode- One of pspAdhocMatchingModes
maxpeers- Maximum number of peers to match (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST)
port- Port. Lumines uses 0x22B
bufsize- Receiving buffer size
hellodelay- Hello message send delay in microseconds (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST or PSP_ADHOC_MATCHING_MODE_PTP)
pingdelay- Ping send delay in microseconds. Lumines uses 0x5B8D80 (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST or PSP_ADHOC_MATCHING_MODE_PTP)
initcount- Initial count of the of the resend counter. Lumines uses 3
msgdelay- Message send delay in microseconds
callback- Callback to be called for matching
Returns
ID of object on success, < 0 on error.

◆ sceNetAdhocMatchingDelete()

int sceNetAdhocMatchingDelete ( int  matchingid)

Delete an Adhoc matching object.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingGetHelloOpt()

int sceNetAdhocMatchingGetHelloOpt ( int  matchingid,
int optlen,
void optdata 
)

Get the optional hello message.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
optlen- Length of the hello data
optdata- Pointer to the hello data
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingGetMembers()

int sceNetAdhocMatchingGetMembers ( int  matchingid,
int length,
void buf 
)

Get a list of matching members.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
length- The length of the list.
buf- An allocated area of size length.
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingGetPoolMaxAlloc()

int sceNetAdhocMatchingGetPoolMaxAlloc ( void  )

Get the maximum memory usage by the matching library.

Returns
The memory usage on success, < 0 on error.

◆ sceNetAdhocMatchingGetPoolStat()

int sceNetAdhocMatchingGetPoolStat ( struct pspAdhocPoolStat poolstat)

Get the status of the memory pool used by the matching library.

Parameters
poolstat- A pspAdhocPoolStat.
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingInit()

int sceNetAdhocMatchingInit ( int  memsize)

Initialise the Adhoc matching library.

Parameters
memsize- Internal memory pool size. Lumines uses 0x20000
Returns
0 on success, < 0 on error

◆ sceNetAdhocMatchingSelectTarget()

int sceNetAdhocMatchingSelectTarget ( int  matchingid,
unsigned char mac,
int  optlen,
void optdata 
)

Select a matching target.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
mac- MAC address to select
optlen- Optional data length
optdata- Pointer to the optional data
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingSendData()

int sceNetAdhocMatchingSendData ( int  matchingid,
unsigned char mac,
int  datalen,
void data 
)

Send data to a matching target.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
mac- The MAC address to send the data to
datalen- Length of the data
data- Pointer to the data
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingSetHelloOpt()

int sceNetAdhocMatchingSetHelloOpt ( int  matchingid,
int  optlen,
void optdata 
)

Set the optional hello message.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
optlen- Length of the hello data
optdata- Pointer to the hello data
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingStart()

int sceNetAdhocMatchingStart ( int  matchingid,
int  evthpri,
int  evthstack,
int  inthpri,
int  inthstack,
int  optlen,
void optdata 
)

Start a matching object.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
evthpri- Priority of the event handler thread. Lumines uses 0x10
evthstack- Stack size of the event handler thread. Lumines uses 0x2000
inthpri- Priority of the input handler thread. Lumines uses 0x10
inthstack- Stack size of the input handler thread. Lumines uses 0x2000
optlen- Size of hellodata
optdata- Pointer to block of data passed to callback
Returns
0 on success, < 0 on error

◆ sceNetAdhocMatchingStop()

int sceNetAdhocMatchingStop ( int  matchingid)

Stop a matching object.

Parameters
matchingid- The ID returned from sceNetAdhocMatchingCreate
Returns
0 on success, < 0 on error.

◆ sceNetAdhocMatchingTerm()

int sceNetAdhocMatchingTerm ( void  )

Terminate the Adhoc matching library.

Returns
0 on success, < 0 on error