PSPSDK 2024-10-31
Loading...
Searching...
No Matches
pspnet_adhocmatching.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspnet_adhocmatching.h - PSP Adhoc matching networking libraries.
7 *
8 * Copyright (c) 2006 James F.
9 * Copyright (c) 2008 InsertWittyName <tias_dp@hotmail.com>
10 *
11 * Based on the adhoc code in SMS Plus
12 *
13 */
14#ifndef __PSPNETMATCHING_ADHOC_H__
15#define __PSPNETMATCHING_ADHOC_H__
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
53
66
71{
73 unsigned char mac[6];
74 char unknown[2];
75};
76
81{
83 int size;
88};
89
97int sceNetAdhocMatchingInit(int memsize);
98
105
107typedef void (*pspAdhocMatchingCallback)(int matchingid, int event, unsigned char *mac, int optlen, void *optdata);
108
124int sceNetAdhocMatchingCreate(int mode, int maxpeers, unsigned short port, int bufsize, unsigned int hellodelay, unsigned int pingdelay, int initcount, unsigned int msgdelay, pspAdhocMatchingCallback callback);
125
134
149
158
169int sceNetAdhocMatchingSelectTarget(int matchingid, unsigned char *mac, int optlen, void *optdata);
170
179int sceNetAdhocMatchingCancelTarget(int matchingid, unsigned char *mac);
180
191int sceNetAdhocMatchingCancelTargetWithOpt(int matchingid, unsigned char *mac, int optlen, void *optdata);
192
203int sceNetAdhocMatchingSendData(int matchingid, unsigned char *mac, int datalen, void *data);
204
213int sceNetAdhocMatchingAbortSendData(int matchingid, unsigned char *mac);
214
225
236
247
254
263
264#ifdef __cplusplus
265}
266#endif
267
268#endif
int sceNetAdhocMatchingSendData(int matchingid, unsigned char *mac, int datalen, void *data)
Send data to a matching target.
pspAdhocMatchingModes
Matching modes used in sceNetAdhocMatchingCreate.
Definition pspnet_adhocmatching.h:58
@ PSP_ADHOC_MATCHING_MODE_PTP
Peer to peer.
Definition pspnet_adhocmatching.h:64
@ PSP_ADHOC_MATCHING_MODE_HOST
Host.
Definition pspnet_adhocmatching.h:60
@ PSP_ADHOC_MATCHING_MODE_CLIENT
Client.
Definition pspnet_adhocmatching.h:62
int sceNetAdhocMatchingSelectTarget(int matchingid, unsigned char *mac, int optlen, void *optdata)
Select a matching target.
int sceNetAdhocMatchingStop(int matchingid)
Stop a matching object.
int sceNetAdhocMatchingStart(int matchingid, int evthpri, int evthstack, int inthpri, int inthstack, int optlen, void *optdata)
Start a matching object.
int sceNetAdhocMatchingDelete(int matchingid)
Delete an Adhoc matching object.
int sceNetAdhocMatchingTerm(void)
Terminate the Adhoc matching library.
int sceNetAdhocMatchingGetHelloOpt(int matchingid, int *optlen, void *optdata)
Get the optional hello message.
int sceNetAdhocMatchingCancelTargetWithOpt(int matchingid, unsigned char *mac, int optlen, void *optdata)
Cancel a matching target (with optional data)
void(* pspAdhocMatchingCallback)(int matchingid, int event, unsigned char *mac, int optlen, void *optdata)
Matching callback.
Definition pspnet_adhocmatching.h:107
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 sceNetAdhocMatchingGetPoolMaxAlloc(void)
Get the maximum memory usage by the matching library.
int sceNetAdhocMatchingInit(int memsize)
Initialise the Adhoc matching library.
int sceNetAdhocMatchingSetHelloOpt(int matchingid, int optlen, void *optdata)
Set the optional hello message.
int sceNetAdhocMatchingAbortSendData(int matchingid, unsigned char *mac)
Abort a data send to a matching target.
int sceNetAdhocMatchingGetPoolStat(struct pspAdhocPoolStat *poolstat)
Get the status of the memory pool used by the matching library.
pspAdhocMatchingEvents
Matching events used in pspAdhocMatchingCallback.
Definition pspnet_adhocmatching.h:25
@ PSP_ADHOC_MATCHING_EVENT_DATA_CONFIRM
Data acknowledged event.
Definition pspnet_adhocmatching.h:49
@ PSP_ADHOC_MATCHING_EVENT_LEFT
Target left matching.
Definition pspnet_adhocmatching.h:31
@ PSP_ADHOC_MATCHING_EVENT_JOIN
Join request.
Definition pspnet_adhocmatching.h:29
@ PSP_ADHOC_MATCHING_EVENT_DATA
Data received event.
Definition pspnet_adhocmatching.h:47
@ PSP_ADHOC_MATCHING_EVENT_DATA_TIMEOUT
Data timeout event.
Definition pspnet_adhocmatching.h:51
@ PSP_ADHOC_MATCHING_EVENT_ACCEPT
Join request accepted.
Definition pspnet_adhocmatching.h:37
@ PSP_ADHOC_MATCHING_EVENT_CANCEL
Join request cancelled.
Definition pspnet_adhocmatching.h:35
@ PSP_ADHOC_MATCHING_EVENT_COMPLETE
Matching is complete.
Definition pspnet_adhocmatching.h:39
@ PSP_ADHOC_MATCHING_EVENT_DISCONNECT
Peer disconnect event.
Definition pspnet_adhocmatching.h:45
@ PSP_ADHOC_MATCHING_EVENT_ERROR
Error event.
Definition pspnet_adhocmatching.h:43
@ PSP_ADHOC_MATCHING_EVENT_REJECT
Join request rejected.
Definition pspnet_adhocmatching.h:33
@ PSP_ADHOC_MATCHING_EVENT_HELLO
Hello event.
Definition pspnet_adhocmatching.h:27
@ PSP_ADHOC_MATCHING_EVENT_TIMEOUT
Ping timeout event.
Definition pspnet_adhocmatching.h:41
int sceNetAdhocMatchingGetMembers(int matchingid, int *length, void *buf)
Get a list of matching members.
int sceNetAdhocMatchingCancelTarget(int matchingid, unsigned char *mac)
Cancel a matching target.
float x
Definition psptypes.h:0
Linked list for sceNetAdhocMatchingGetMembers.
Definition pspnet_adhocmatching.h:71
struct pspAdhocMatchingMember * next
Definition pspnet_adhocmatching.h:72
unsigned char mac[6]
Definition pspnet_adhocmatching.h:73
char unknown[2]
Definition pspnet_adhocmatching.h:74
Linked list for sceNetAdhocMatchingGetMembers.
Definition pspnet_adhocmatching.h:81
int size
Size of the pool.
Definition pspnet_adhocmatching.h:83
int maxsize
Maximum size of the pool.
Definition pspnet_adhocmatching.h:85
int freesize
Unused memory in the pool.
Definition pspnet_adhocmatching.h:87