pspsdk-1.0+beta2
pspnet_adhocctl.h File Reference

Go to the source code of this file.

Data Structures

struct  productStruct
 Product structure. More...
struct  SceNetAdhocctlPeerInfo
 Peer info structure. More...
struct  SceNetAdhocctlScanInfo
 Scan info structure. More...
struct  SceNetAdhocctlGameModeInfo
struct  SceNetAdhocctlParams
 Params structure. More...

Typedefs

typedef void(* sceNetAdhocctlHandler )(int flag, int error, void *unknown)

Functions

int sceNetAdhocctlInit (int stacksize, int priority, struct productStruct *product)
 Initialise the Adhoc control library.
int sceNetAdhocctlTerm (void)
 Terminate the Adhoc control library.
int sceNetAdhocctlConnect (const char *name)
 Connect to the Adhoc control.
int sceNetAdhocctlDisconnect (void)
 Disconnect from the Adhoc control.
int sceNetAdhocctlGetState (int *event)
 Get the state of the Adhoc control.
int sceNetAdhocctlCreate (const char *name)
 Connect to the Adhoc control (as a host)
int sceNetAdhocctlJoin (struct SceNetAdhocctlScanInfo *scaninfo)
 Connect to the Adhoc control (as a client)
int sceNetAdhocctlGetAdhocId (struct productStruct *product)
 Get the adhoc ID.
int sceNetAdhocctlCreateEnterGameMode (const char *name, int unknown, int num, unsigned char *macs, unsigned int timeout, int unknown2)
 Connect to the Adhoc control game mode (as a host)
int sceNetAdhocctlJoinEnterGameMode (const char *name, unsigned char *hostmac, unsigned int timeout, int unknown)
 Connect to the Adhoc control game mode (as a client)
int sceNetAdhocctlGetGameModeInfo (struct SceNetAdhocctlGameModeInfo *gamemodeinfo)
 Get game mode information.
int sceNetAdhocctlExitGameMode (void)
 Exit game mode.
int sceNetAdhocctlGetPeerList (int *length, void *buf)
 Get a list of peers.
int sceNetAdhocctlGetPeerInfo (unsigned char *mac, int size, struct SceNetAdhocctlPeerInfo *peerinfo)
 Get peer information.
int sceNetAdhocctlScan (void)
 Scan the adhoc channels.
int sceNetAdhocctlGetScanInfo (int *length, void *buf)
 Get the results of a scan.
int sceNetAdhocctlAddHandler (sceNetAdhocctlHandler handler, void *unknown)
 Register an adhoc event handler.
int sceNetAdhocctlDelHandler (int id)
 Delete an adhoc event handler.
int sceNetAdhocctlGetNameByAddr (unsigned char *mac, char *nickname)
 Get nickname from a mac address.
int sceNetAdhocctlGetAddrByName (char *nickname, int *length, void *buf)
 Get mac address from nickname.
int sceNetAdhocctlGetParameter (struct SceNetAdhocctlParams *params)
 Get Adhocctl parameter.

Variables

struct productStruct productStruct

Typedef Documentation

typedef void(* sceNetAdhocctlHandler)(int flag, int error, void *unknown)

Function Documentation

int sceNetAdhocctlAddHandler ( sceNetAdhocctlHandler  handler,
void *  unknown 
)

Register an adhoc event handler.

Parameters
handler- The event handler.
unknown- Pass NULL.
Returns
Handler id on success, < 0 on error.
int sceNetAdhocctlConnect ( const char *  name)

Connect to the Adhoc control.

Parameters
name- The name of the connection (maximum 8 alphanumeric characters).
Returns
0 on success, < 0 on error.
int sceNetAdhocctlCreate ( const char *  name)

Connect to the Adhoc control (as a host)

Parameters
name- The name of the connection (maximum 8 alphanumeric characters).
Returns
0 on success, < 0 on error.
int sceNetAdhocctlCreateEnterGameMode ( const char *  name,
int  unknown,
int  num,
unsigned char *  macs,
unsigned int  timeout,
int  unknown2 
)

Connect to the Adhoc control game mode (as a host)

Parameters
name- The name of the connection (maximum 8 alphanumeric characters).
unknown- Pass 1.
num- The total number of players (including the host).
macs- A pointer to a list of the participating mac addresses, host first, then clients.
timeout- Timeout in microseconds.
unknown2- pass 0.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlDelHandler ( int  id)

Delete an adhoc event handler.

Parameters
id- The handler id as returned by sceNetAdhocctlAddHandler.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlDisconnect ( void  )

Disconnect from the Adhoc control.

Returns
0 on success, < 0 on error
int sceNetAdhocctlExitGameMode ( void  )

Exit game mode.

Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetAddrByName ( char *  nickname,
int *  length,
void *  buf 
)

Get mac address from nickname.

Parameters
nickname- The nickname.
length- The length of the list.
buf- An allocated area of size length.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetAdhocId ( struct productStruct product)

Get the adhoc ID.

Parameters
product- A pointer to a productStruct
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetGameModeInfo ( struct SceNetAdhocctlGameModeInfo gamemodeinfo)

Get game mode information.

Parameters
gamemodeinfo- Pointer to store the info.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetNameByAddr ( unsigned char *  mac,
char *  nickname 
)

Get nickname from a mac address.

Parameters
mac- The mac address.
nickname- Pointer to a char buffer where the nickname will be stored.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetParameter ( struct SceNetAdhocctlParams params)

Get Adhocctl parameter.

Parameters
params- Pointer to a SceNetAdhocctlParams
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetPeerInfo ( unsigned char *  mac,
int  size,
struct SceNetAdhocctlPeerInfo peerinfo 
)

Get peer information.

Parameters
mac- The mac address of the peer.
size- Size of peerinfo.
peerinfo- Pointer to store the information.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetPeerList ( int *  length,
void *  buf 
)

Get a list of peers.

Parameters
length- The length of the list.
buf- An allocated area of size length.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetScanInfo ( int *  length,
void *  buf 
)

Get the results of a scan.

Parameters
length- The length of the list.
buf- An allocated area of size length.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlGetState ( int *  event)

Get the state of the Adhoc control.

Parameters
event- Pointer to an integer to receive the status. Can continue when it becomes 1.
Returns
0 on success, < 0 on error
int sceNetAdhocctlInit ( int  stacksize,
int  priority,
struct productStruct product 
)

Initialise the Adhoc control library.

Parameters
stacksize- Stack size of the adhocctl thread. Set to 0x2000
priority- Priority of the adhocctl thread. Set to 0x30
product- Pass a filled in productStruct
Returns
0 on success, < 0 on error
int sceNetAdhocctlJoin ( struct SceNetAdhocctlScanInfo scaninfo)

Connect to the Adhoc control (as a client)

Parameters
scaninfo- A valid SceNetAdhocctlScanInfo struct that has been filled by sceNetAchocctlGetScanInfo
Returns
0 on success, < 0 on error.
int sceNetAdhocctlJoinEnterGameMode ( const char *  name,
unsigned char *  hostmac,
unsigned int  timeout,
int  unknown 
)

Connect to the Adhoc control game mode (as a client)

Parameters
name- The name of the connection (maximum 8 alphanumeric characters).
hostmac- The mac address of the host.
timeout- Timeout in microseconds.
unknown- pass 0.
Returns
0 on success, < 0 on error.
int sceNetAdhocctlScan ( void  )

Scan the adhoc channels.

Returns
0 on success, < 0 on error.
int sceNetAdhocctlTerm ( void  )

Terminate the Adhoc control library.

Returns
0 on success, < on error.

Variable Documentation