![]() |
WE310F5
39.00.000
|
This section describes the M2MB APIs for the application framework. More...
#define | M2MB_AF_MAX_USER_THREAD_SUPPORTED 10 |
#define | TEST_START "\r\nEXAMPLE APPLICATION TEST START\r\n" |
#define | TEST_COMPLETE "\r\nEXAMPLE APPLICATION TEST COMPLETE\r\n" |
#define | TEST_COMPLETE_COUNT 5 |
enum | M2MB_AF_NWK_EVENT { M2MB_AF_NWK_DATA_RECEVEID = 1, M2MB_AF_NWK_CONNECTION_CLOSE, M2MB_AF_NWK_NEW_CONNECTION } |
Application framework network event. More... | |
enum | M2MB_AF_DRV_TYPE { M2MB_AF_DRV_TYPE_UART0, M2MB_AF_DRV_TYPE_UART1 } |
Application framework driver type. More... | |
typedef enum M2MB_AF_NWK_EVENT | M2MB_AF_NWK_EVENT_E |
Application framework network event. More... | |
typedef enum M2MB_AF_DRV_TYPE | M2MB_AF_DRV_TYPE_E |
Application framework driver type. More... | |
typedef VOID(* | M2MB_AF_INIT_CB_T) (VOID *user_ctx, M2MB_PROFILE_EVENT_T event, M2MB_STATUS_T status, VOID *pData) |
Application framework user init callback function prototype. More... | |
typedef VOID(* | M2MB_AF_DRV_RD_CB_T) (VOID *user_ctx, M2MB_AF_DRV_TYPE_E module_type, VOID *pData, UINT32 len) |
Application framework Driver read callback function prototype. More... | |
typedef struct M2MB_AF_NWK_DATA_RECV | M2MB_AF_NWK_DATA_RECV_T |
Application framework Network data receive structure. More... | |
typedef VOID(* | M2MB_AF_NWK_EV_CB_T) (VOID *user_ctx, UINT32 sd, M2MB_AF_NWK_EVENT_E ev, VOID *pData) |
Application framework Network event callback function prototype. More... | |
typedef struct M2MB_AF_APP_THREAD_S | M2MB_AF_APP_THREAD_T |
APP thread information. More... | |
typedef VOID(* | M2MB_AF_THREAD_PROCESS_T) (VOID *user_ctx, M2MB_AF_APP_THREAD_T *pTCtx, VOID *pMsg) |
Application framework thread message processing function prototype. More... | |
typedef struct M2M_AF_USER_THREAD_DETAILS_S | M2M_AF_USER_THREAD_DETAILS_T |
Application framework thread details structure. More... | |
typedef struct M2M_AF_USER_THREAD_CFG_S | M2M_AF_USER_THREAD_CFG_T |
Application framework user thread system configuration. More... | |
typedef struct M2MB_AF_USER_CFG_S | M2MB_AF_USER_CFG_T |
Application framework User configuration detail structure. More... | |
VOID | m2mb_af_dbg_print (M2MB_SYSTEM_CFG_T *pSystemCfg) |
m2mb_af_dbg_print is called to print the Access point SSID and channel information based on WLAN running mode. More... | |
INT32 | m2mb_af_udp_soc_init (M2MB_UDP_CFG_T *udp_cfg) |
m2mb_af_udp_soc_init is called to initialize UDP socket creation. More... | |
INT32 | m2mb_af_tcp_soc_init (M2MB_T_CFG_T *tcp_cfg) |
m2mb_af_tcp_soc_init is called to initialize TCP socket creation. More... | |
INT32 | m2mb_af_start (M2MB_AF_USER_CFG_T *pApp_cfg, const M2MB_SYSTEM_CFG_T *pSystem_cfg) |
m2mb_af_start is called to start the application framework. More... | |
This section describes the M2MB APIs for the application framework.
The Application framework provides a basic framework for the user to develop its application. Application framework provides the following features:-
#define M2MB_AF_MAX_USER_THREAD_SUPPORTED 10 |
Definition at line 53 of file m2mb_app_framework.h.
#define TEST_COMPLETE "\r\nEXAMPLE APPLICATION TEST COMPLETE\r\n" |
Definition at line 55 of file m2mb_app_framework.h.
#define TEST_COMPLETE_COUNT 5 |
Definition at line 56 of file m2mb_app_framework.h.
#define TEST_START "\r\nEXAMPLE APPLICATION TEST START\r\n" |
Definition at line 54 of file m2mb_app_framework.h.
typedef struct M2M_AF_USER_THREAD_CFG_S M2M_AF_USER_THREAD_CFG_T |
Application framework user thread system configuration.
User thread configuration details structure.
typedef struct M2M_AF_USER_THREAD_DETAILS_S M2M_AF_USER_THREAD_DETAILS_T |
Application framework thread details structure.
Structure to give thread details.
typedef struct M2MB_AF_APP_THREAD_S M2MB_AF_APP_THREAD_T |
APP thread information.
This data structure stores the thread handlers details. To post a message to the thread user can use the pQHandle and OS APIs. To get details on thread thrHandle can be used .
typedef VOID(* M2MB_AF_DRV_RD_CB_T) (VOID *user_ctx, M2MB_AF_DRV_TYPE_E module_type, VOID *pData, UINT32 len) |
Application framework Driver read callback function prototype.
Driver read callback function prototype.user_ctx is the context given in M2MB_AF_USER_CFG_T (pUsr_ctx). module_type is the type of driver, pData is the pointer to data and len is the length of data received. The user has to process the data fast as the pData buffer is reused to read the data from the driver.
Definition at line 112 of file m2mb_app_framework.h.
typedef enum M2MB_AF_DRV_TYPE M2MB_AF_DRV_TYPE_E |
Application framework driver type.
Driver type supported by the application framework.
typedef VOID(* M2MB_AF_INIT_CB_T) (VOID *user_ctx, M2MB_PROFILE_EVENT_T event, M2MB_STATUS_T status, VOID *pData) |
Application framework user init callback function prototype.
User init callback function prototype. user_ctx is the context given in M2MB_AF_USER_CFG_T (pUsr_ctx). Events are defined in the m2mb_profile.h file. the pData depends on the event as described in the memb_profile.h file.
Definition at line 96 of file m2mb_app_framework.h.
typedef struct M2MB_AF_NWK_DATA_RECV M2MB_AF_NWK_DATA_RECV_T |
Application framework Network data receive structure.
This structure is used to indicate the data received for a socket.
typedef VOID(* M2MB_AF_NWK_EV_CB_T) (VOID *user_ctx, UINT32 sd, M2MB_AF_NWK_EVENT_E ev, VOID *pData) |
Application framework Network event callback function prototype.
Network event callback function prototype. The pData is of type M2MB_AF_NWK_DATA_RECEVEID when event is M2MB_AF_NWK_DATA_RECEVEID and M2MB_SOCKET_BSD_SOCKADDR_IN_T when event is M2MB_AF_NWK_NEW_CONNECTION.
Definition at line 140 of file m2mb_app_framework.h.
typedef enum M2MB_AF_NWK_EVENT M2MB_AF_NWK_EVENT_E |
Application framework network event.
Event for the network activity. This event is passed M2MB_AF_NWK_EV_CB_T callback
typedef VOID(* M2MB_AF_THREAD_PROCESS_T) (VOID *user_ctx, M2MB_AF_APP_THREAD_T *pTCtx, VOID *pMsg) |
Application framework thread message processing function prototype.
Thread message processing function prototype.
Definition at line 169 of file m2mb_app_framework.h.
typedef struct M2MB_AF_USER_CFG_S M2MB_AF_USER_CFG_T |
Application framework User configuration detail structure.
User configuration detail structure.
enum M2MB_AF_DRV_TYPE |
Application framework driver type.
Driver type supported by the application framework.
Enumerator | |
---|---|
M2MB_AF_DRV_TYPE_UART0 | |
M2MB_AF_DRV_TYPE_UART1 |
Definition at line 79 of file m2mb_app_framework.h.
enum M2MB_AF_NWK_EVENT |
Application framework network event.
Event for the network activity. This event is passed M2MB_AF_NWK_EV_CB_T callback
Enumerator | |
---|---|
M2MB_AF_NWK_DATA_RECEVEID | |
M2MB_AF_NWK_CONNECTION_CLOSE | |
M2MB_AF_NWK_NEW_CONNECTION |
Definition at line 65 of file m2mb_app_framework.h.
VOID m2mb_af_dbg_print | ( | M2MB_SYSTEM_CFG_T * | pSystemCfg | ) |
m2mb_af_dbg_print is called to print the Access point SSID and channel information based on WLAN running mode.
m2mb_af_dbg_print is called to print the Access point SSID and channel information based on WLAN running mode.
[in] | pSystemCfg | Pointer to System configuration structure. |
INT32 m2mb_af_start | ( | M2MB_AF_USER_CFG_T * | pApp_cfg, |
const M2MB_SYSTEM_CFG_T * | pSystem_cfg | ||
) |
m2mb_af_start is called to start the application framework.
m2mb_af_start starts the application framework. It initializes the different modules based on the profile configuration and creates threads as per the configuration given by the user.
Example
INT32 m2mb_af_tcp_soc_init | ( | M2MB_T_CFG_T * | tcp_cfg | ) |
m2mb_af_tcp_soc_init is called to initialize TCP socket creation.
It takes TCP configuration, finds free entry in pTcp_soc array and calls m2mb_profile_tcp_soc_init() to create socket.
Example
INT32 m2mb_af_udp_soc_init | ( | M2MB_UDP_CFG_T * | udp_cfg | ) |
m2mb_af_udp_soc_init is called to initialize UDP socket creation.
It takes UDP configuration, finds free entry in pUdp_soc array and calls m2mb_profile_udp_soc_init() to create socket.
Example