Functions and structures for managing PSP AdHoc connections.
More...
|
#define | ADHOC_ERROR_WLAN -1 |
| WLAN error.
|
|
#define | ADHOC_ERROR_MAC -2 |
| MAC address error.
|
|
#define | ADHOC_ERROR_MODULES -3 |
| Module loading error.
|
|
#define | ADHOC_ERROR_NET_INIT -4 |
| Network initialization error.
|
|
#define | ADHOC_ERROR_INIT -5 |
| AdHoc initialization error.
|
|
#define | ADHOC_ERROR_CTL_INIT -6 |
| Control initialization error.
|
|
#define | ADHOC_ERROR_CTL_CONNECT -7 |
| Control connection error.
|
|
#define | ADHOC_ERROR_PDP_CREATE -8 |
| PDP creation error.
|
|
#define | ADHOC_ERROR_MATCHING_INIT -9 |
| Matching initialization error.
|
|
#define | ADHOC_ERROR_MATCHING_CREATE -10 |
| Matching creation error.
|
|
#define | ADHOC_ERROR_MATCHING_START -11 |
| Matching start error.
|
|
#define | MATCHING_JOINED 0x1 |
| Another PSP has joined.
|
|
#define | MATCHING_SELECTED 0x2 |
| Another PSP selected to match.
|
|
#define | MATCHING_REJECTED 0x4 |
| The request has been rejected.
|
|
#define | MATCHING_CANCELED 0x5 |
| The request has been cancelled.
|
|
#define | MATCHING_ACCEPTED 0x6 |
| The request has been accepted.
|
|
#define | MATCHING_ESTABLISHED 0x7 |
| Connection established between PSPs.
|
|
#define | MATCHING_DISCONNECT 0xa |
| A PSP has quit.
|
|
#define | ADHOC_UNINIT -1 |
| AdHoc not initialized.
|
|
#define | ADHOC_INIT 0 |
| AdHoc initialized.
|
|
#define | MAX_REMOTEPSP 100 |
| Maximum remote PSPs.
|
|
Functions and structures for managing PSP AdHoc connections.
◆ ADHOC_ERROR_WLAN
#define ADHOC_ERROR_WLAN -1 |
WLAN error.
Error codes for AdHoc operations.
◆ MATCHING_JOINED
#define MATCHING_JOINED 0x1 |
Another PSP has joined.
Matching states for AdHoc operations.
◆ ADHOC_UNINIT
AdHoc not initialized.
AdHoc initialization states.
◆ MAX_REMOTEPSP
#define MAX_REMOTEPSP 100 |
Maximum remote PSPs.
Maximum number of remote PSPs supported.
◆ remotePspState
Connection states for remote PSPs.
Enumerator |
---|
OSL_ADHOC_DISCONNECTED | PSP Disconnected.
|
OSL_ADHOC_JOINED | PSP Joined.
|
OSL_ADHOC_SELECTED | PSP selected.
|
OSL_ADHOC_REJECTED | Connection rejected.
|
OSL_ADHOC_CANCELED | Connection canceled.
|
OSL_ADHOC_ACCEPTED | Connection accepted.
|
OSL_ADHOC_ESTABLISHED | Connection established.
|
◆ oslAdhocInit()
int oslAdhocInit |
( |
char * | productID | ) |
|
Initializes the AdHoc connection.
- Parameters
-
productID | The product ID for the AdHoc session. |
- Returns
- 0 on success, negative value on error (see error codes).
◆ oslAdhocGetState()
Retrieves the current connection state.
- Returns
- Current connection state (see remotePspState).
◆ oslAdhocGetMacAddress()
u8 * oslAdhocGetMacAddress |
( |
| ) |
|
Retrieves the current MAC address of the PSP.
- Returns
- Pointer to the MAC address (array of 6 bytes).
◆ oslAdhocGetRemotePspCount()
int oslAdhocGetRemotePspCount |
( |
| ) |
|
Retrieves the number of connected remote PSPs.
- Returns
- Number of connected remote PSPs.
◆ oslAdhocGetPspByMacAddress()
struct remotePsp * oslAdhocGetPspByMacAddress |
( |
const u8 | aMacAddress[6] | ) |
|
Retrieves the remote PSP information by MAC address.
- Parameters
-
aMacAddress | MAC address to search for. |
- Returns
- Pointer to the remotePsp structure if found, NULL otherwise.
◆ oslAdhocGetPspByIndex()
struct remotePsp * oslAdhocGetPspByIndex |
( |
int | index | ) |
|
Retrieves the remote PSP information by index.
- Parameters
-
index | Index of the remote PSP. |
- Returns
- Pointer to the remotePsp structure if found, NULL otherwise.
◆ oslAdhocRequestConnection()
int oslAdhocRequestConnection |
( |
struct remotePsp * | aPsp, |
|
|
int | timeOut, |
|
|
int(* | requestConnectionCB )(int aPspState) ) |
Requests a connection to a remote PSP.
- Parameters
-
aPsp | Pointer to the remotePsp structure. |
timeOut | Timeout for the connection request. |
requestConnectionCB | Callback function for connection status updates. |
- Returns
- 0 on success, negative value on error.
◆ oslAdhocSendData()
int oslAdhocSendData |
( |
struct remotePsp * | pPsp, |
|
|
void * | data, |
|
|
int | lenData ) |
Sends data to a remote PSP.
- Parameters
-
pPsp | Pointer to the remotePsp structure. |
data | Pointer to the data to send. |
lenData | Length of the data to send. |
- Returns
- 0 on success, negative value on error.
◆ oslAdhocReceiveData()
int oslAdhocReceiveData |
( |
struct remotePsp * | pPsp, |
|
|
void * | data, |
|
|
int | maxLen ) |
Receives data from a remote PSP.
- Parameters
-
pPsp | Pointer to the remotePsp structure. |
data | Pointer to the buffer to store received data. |
maxLen | Maximum length of the buffer. |
- Returns
- Length of the received data, 0 if no data received.
◆ oslAdhocGetConnectionRequest()
struct remotePsp * oslAdhocGetConnectionRequest |
( |
| ) |
|
Retrieves a remote PSP that is requesting a connection.
- Returns
- Pointer to the remotePsp structure if found, NULL otherwise.
◆ oslAdhocRejectConnection()
void oslAdhocRejectConnection |
( |
struct remotePsp * | aPsp | ) |
|
Rejects a connection request from a remote PSP.
- Parameters
-
◆ oslAdhocAcceptConnection()
void oslAdhocAcceptConnection |
( |
struct remotePsp * | aPsp | ) |
|
Accepts a connection request from a remote PSP.
- Parameters
-