![]() |
WE310F5
39.00.000
|
This section describes the M2MB APIs for Ping feature. More...
#define | M2MB_PING_PACKET_SIZE_MAX_TX (1576) |
#define | M2MB_PING_PACKET_SIZE_MAX_RX (1556) |
#define | M2MB_NETWORK_PING_SUCCESS 0 |
#define | M2MB_NETWORK_PING_INVALID_IP_ADDRESS M2MB_NET_ERR_INVALID_IPADDR |
#define | M2MB_NETWORK_PING_REQUEST_TIMED_OUT 2 |
enum | M2MB_PING_CFGID { M2MB_PING_CFGID_ADDRESS, M2MB_PING_CFGID_DATA_SIZE, M2MB_PING_CFGID_COUNT, M2MB_PING_CFGID_STAT } |
M2MB_PING_CFGID_E defines configuration IDs for ping. More... | |
enum | M2MB_PING_EVENT { M2MB_PING_REQ_RESULT, M2MB_PING_COMPLETE } |
M2MB_PING_EVENT_E defines events passed in the ping callback. More... | |
typedef enum M2MB_PING_CFGID | M2MB_PING_CFGID_E |
M2MB_PING_CFGID_E defines configuration IDs for ping. More... | |
typedef enum M2MB_PING_EVENT | M2MB_PING_EVENT_E |
M2MB_PING_EVENT_E defines events passed in the ping callback. More... | |
typedef struct M2MB_PING_REQ_STATUS | M2MB_PING_REQ_STATUS_T |
M2MB_PING_REQ_STATUS_T defines the data type of M2MB_PING_REQ_RESULT event. More... | |
typedef struct M2MB_PING_COMPLETE_STATUS | M2MB_PING_COMPLETE_STATUS_T |
M2MB_PING_COMPLETE_STATUS_T defines the data type of M2MB_PING_COMPLETE event. More... | |
typedef INT32(* | M2MB_PING_CB_T) (void *user_ctx, M2MB_PING_EVENT_E ev, VOID *data) |
M2MB_PING_CB_T defines callback for ping request. More... | |
typedef union M2MB_PING_CONF_PARAMS | M2MB_PING_CONF_PARAMS_T |
M2MB_PING_CONF_PARAMS_T defines configuration data structure for ping. More... | |
typedef struct M2MB_PING_INIT_PARAMS | M2MB_PING_INIT_PARAMS_T |
PING initialization parameters. More... | |
M2MB_STATUS_T | m2mb_ping_init (HANDLE *handle, M2MB_PING_INIT_PARAMS_T init_params) |
m2mb_ping_init is called to initialize the PING user callback and continuous interval. More... | |
M2MB_STATUS_T | m2mb_ping_deinit (HANDLE handle) |
m2mb_ping_deinit is called to de-initialize PING module. More... | |
INT32 | m2mb_ping_start (HANDLE handle) |
m2mb_ping_start is called to initiate Ping. More... | |
INT32 | m2mb_ping_stop (HANDLE handle) |
m2mb_ping_stop is called to stop ping procedure. More... | |
INT32 | m2mb_ping_set_cfg (HANDLE handle, M2MB_PING_CFGID_E cfgID, M2MB_PING_CONF_PARAMS_T *conf_params) |
m2mb_ping_set_cfg is called to set the ping configuration. More... | |
INT32 | m2mb_ping_get_cfg (HANDLE handle, M2MB_PING_CFGID_E cfgID, M2MB_PING_CONF_PARAMS_T *conf_params) |
m2mb_ping_get_cfg is called to set the ping configuration. More... | |
This section describes the M2MB APIs for Ping feature.
#define M2MB_NETWORK_PING_INVALID_IP_ADDRESS M2MB_NET_ERR_INVALID_IPADDR |
Macro for invalid IP address
Definition at line 57 of file m2mb_ping.h.
#define M2MB_NETWORK_PING_REQUEST_TIMED_OUT 2 |
Macro for ping request timed out
Definition at line 58 of file m2mb_ping.h.
#define M2MB_NETWORK_PING_SUCCESS 0 |
MACROs for PING_STATUS Macro for ping success
Definition at line 56 of file m2mb_ping.h.
#define M2MB_PING_PACKET_SIZE_MAX_RX (1556) |
Macro for maximum number of bytes to receive
Definition at line 53 of file m2mb_ping.h.
#define M2MB_PING_PACKET_SIZE_MAX_TX (1576) |
Macro for maximum number of bytes to transmit
Definition at line 52 of file m2mb_ping.h.
typedef INT32( * M2MB_PING_CB_T) (void *user_ctx, M2MB_PING_EVENT_E ev, VOID *data) |
M2MB_PING_CB_T defines callback for ping request.
This callback is called to indicate the event to the application. The data pointer has to be interpreted based on the event and has to be either M2MB_PING_REQ_STATUS_T or M2MB_PING_COMPLETE_STATUS_T.here data is of type either M2MB_PING_REQ_STATUS_T or M2MB_PING_COMPLETE_STATUS_T, depends on event type.
[in] | user_ctx | Pointer to the applicaiton context passed by the user. |
[in] | ev | Indicate the event of type M2MB_PING_EVENT_E to the application. |
[in] | data | The data pointer has to be interpreted based on the event. If event is M2MB_PING_REQ_RESULT data is M2MB_PING_REQ_STATUS_T else NULL. Example { user_ctx(ev); switch(ev) { ... ... } } |
Definition at line 168 of file m2mb_ping.h.
typedef enum M2MB_PING_CFGID M2MB_PING_CFGID_E |
M2MB_PING_CFGID_E defines configuration IDs for ping.
This enum is used to get/set ping configuration using m2mb_ping_get_cfg/m2mb_ping_set_cfg APIs.
typedef struct M2MB_PING_COMPLETE_STATUS M2MB_PING_COMPLETE_STATUS_T |
M2MB_PING_COMPLETE_STATUS_T defines the data type of M2MB_PING_COMPLETE event.
M2MB_PING_COMPLETE_STATUS_T defines the data type of the data filled in the ping request callback for M2MB_PING_COMPLETE event.
typedef union M2MB_PING_CONF_PARAMS M2MB_PING_CONF_PARAMS_T |
M2MB_PING_CONF_PARAMS_T defines configuration data structure for ping.
This union is used to get/set ping configuration using m2mb_ping_get_cfg/m2mb_ping_set_cfg APIs.
typedef enum M2MB_PING_EVENT M2MB_PING_EVENT_E |
M2MB_PING_EVENT_E defines events passed in the ping callback.
This enum is used while passing the event in the ping callback.
typedef struct M2MB_PING_INIT_PARAMS M2MB_PING_INIT_PARAMS_T |
PING initialization parameters.
Contains information needed to initialize the PING module, such as user callback and user context.
typedef struct M2MB_PING_REQ_STATUS M2MB_PING_REQ_STATUS_T |
M2MB_PING_REQ_STATUS_T defines the data type of M2MB_PING_REQ_RESULT event.
M2MB_PING_REQ_STATUS_T defines the data type of the data filed in the ping request callback for M2MB_PING_REQ_RESULT event.
enum M2MB_PING_CFGID |
M2MB_PING_CFGID_E defines configuration IDs for ping.
This enum is used to get/set ping configuration using m2mb_ping_get_cfg/m2mb_ping_set_cfg APIs.
Enumerator | |
---|---|
M2MB_PING_CFGID_ADDRESS | ping address ping data size |
M2MB_PING_CFGID_DATA_SIZE | ping count |
M2MB_PING_CFGID_COUNT | ping start |
M2MB_PING_CFGID_STAT |
Definition at line 70 of file m2mb_ping.h.
enum M2MB_PING_EVENT |
M2MB_PING_EVENT_E defines events passed in the ping callback.
This enum is used while passing the event in the ping callback.
Enumerator | |
---|---|
M2MB_PING_REQ_RESULT | ping request result, call back returns M2MB_PING_REQ_STATUS_T type data last ping result, call back returns M2MB_PING_COMPLETE_STATUS_T type data |
M2MB_PING_COMPLETE |
Definition at line 89 of file m2mb_ping.h.
M2MB_STATUS_T m2mb_ping_deinit | ( | HANDLE | handle | ) |
m2mb_ping_deinit is called to de-initialize PING module.
m2mb_ping_deinit de-initializes the PING module. It frees up all memory allocated during initialization process.
[in] | handle | Specifies the context handle initialized by m2mb_ping_init API. |
INT32 m2mb_ping_get_cfg | ( | HANDLE | handle, |
M2MB_PING_CFGID_E | cfgID, | ||
M2MB_PING_CONF_PARAMS_T * | conf_params | ||
) |
m2mb_ping_get_cfg is called to set the ping configuration.
m2mb_ping_get_cfg stores the configuration set by user. This configuration is used when ping start API is called.
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_ping_init API. |
[in] | cfgID | Configuration ID, from M2MB_PING_CFG_T. |
[out] | value | Configured value. |
Example
M2MB_STATUS_T m2mb_ping_init | ( | HANDLE * | handle, |
M2MB_PING_INIT_PARAMS_T | init_params | ||
) |
m2mb_ping_init is called to initialize the PING user callback and continuous interval.
m2mb_ping_init is called to initialize the PING user callback and continuous interval.
[in] | handle | Specifies the pointer to the context handle that can be used by other PING APIs. |
[in] | init_params | Initialization parameters required for PING module initialization. |
INT32 m2mb_ping_set_cfg | ( | HANDLE | handle, |
M2MB_PING_CFGID_E | cfgID, | ||
M2MB_PING_CONF_PARAMS_T * | conf_params | ||
) |
m2mb_ping_set_cfg is called to set the ping configuration.
m2mb_ping_set_cfg stores the configuration set by user. This configuration is used when ping start API is called.
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_ping_init API. |
[in] | cfgID | Configuration ID, from M2MB_PING_CFG_T. |
[in] | conf_params | Configuration value according to the cfgID, type M2MB_PING_CONF_PARAMS_T |
Example
m2mb_ping_start is called to initiate Ping.
m2mb_ping_start initiates Ping procedure.
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_ping_init API. |
m2mb_ping_stop is called to stop ping procedure.
m2mb_ping_stop stops the ping procedure. It is called when ping is started in continuous mode in background.
[in] | handle | Specifies the pointer to the context handle initialized by m2mb_ping_init API. |