WE310F5  39.00.000
M2MB NWIF RAW

This section describes the M2MB API for Network Interface for RAW data transfer over WiFi. More...

typedef INT32(* M2MB_NWIF_RAW_CB_T) (VOID *userCtx, UINT8 *pData, INT32 len)
 User callback prototype to receive data from Wi-Fi interface. More...
 
INT32 m2mb_nwif_raw_init (UINT8 mode, M2MB_NWIF_RAW_CB_T *pCB, VOID *userCtx)
 m2mb_nwif_raw_init is called to initialize the module. More...
 
INT32 m2mb_nwif_raw_send (UINT8 *data, INT32 length)
 m2mb_nwif_raw_send is called to send data over Wi-Fi interface. More...
 

Detailed Description

This section describes the M2MB API for Network Interface for RAW data transfer over WiFi.

To send data and receive data over WiFi without the module network stack user can use this module. This module attaches to the Wi-Fi interface to receive and send data detaching the network stack.

Typedef Documentation

◆ M2MB_NWIF_RAW_CB_T

typedef INT32(* M2MB_NWIF_RAW_CB_T) (VOID *userCtx, UINT8 *pData, INT32 len)

User callback prototype to receive data from Wi-Fi interface.

Type definition of user callback to handle data received from Wi-Fi interface. This callback is called from the thread context, but user has to handle it quickly and return, so that packets arriving from Wi-Fi interface can be handled else buffer to handle the packets will get filled and the interface will start dropping the received packets. Once the callback is called the buffer will be freed bythe module. User has to copy it for further processing.

Definition at line 68 of file m2mb_nwif_raw.h.

Function Documentation

◆ m2mb_nwif_raw_init()

INT32 m2mb_nwif_raw_init ( UINT8  mode,
M2MB_NWIF_RAW_CB_T pCB,
VOID userCtx 
)

m2mb_nwif_raw_init is called to initialize the module.

m2mb_nwif_raw_init detaches the network stack with Wi-Fi and registers the user callback.

Parameters
[out]modeInterface to use. This can be STA or AP mode. Please look at the M2MB_NCM_INIT_MODE_E for more details.
[out]pCBUser callback to handle data received over Wi-Fi interface.
[out]userCtxUser context to be passed in the user callback.
Returns
Returns 0 on success, or a different code on error
Note
<Notes> Example
typedef struct USR_CTX_S
{
.....
}USR_CTX_T;
USR_CTX_T userCtx;
INT32 userCb(VOID* userCtx, UINT8* pData, INT32 len)
{
.....
}

◆ m2mb_nwif_raw_send()

INT32 m2mb_nwif_raw_send ( UINT8 data,
INT32  length 
)

m2mb_nwif_raw_send is called to send data over Wi-Fi interface.

m2mb_nwif_raw_send sends the data given over Wi-Fi interface.

Parameters
[out]dataPointer to the data.
[out]lengthLength of bytes to be sent from the data pointer.
Returns
Returns 0 on success, or a different code on error
Note
<Notes> Example
typedef struct USR_CTX_S
{
.....
}USR_CTX_T;
USR_CTX_T userCtx;
INT32 userCb(VOID* userCtx, UINT8* pData, INT32 len)
{
.....
}
UINT8* data = "Telit India Pvt Ltd."
m2mb_nwif_raw_send( data, strlen(data));