Callback Framework#
This section provides a reference to Wi-Fi API callback handling functions.
Typedefs#
Generic Wi-Fi callback function type.
Wi-Fi scan result callback type.
Wi-Fi stats callback type.
Wi-Fi join callback type.
TWT Response callback type.
Functions#
Register a function and optional argument for a selected callback.
Default Wi-Fi event handler.
Register a function and optional argument for scan results callback.
Register a function and optional argument for join status callback.
Register a function and optional argument for TWT response callback.
Register a function and optional argument for statistic report callback.
Macros#
Generic macro for callback functions to check if the event has Failed.
Typedef Documentation#
sl_wifi_callback_function_t#
typedef sl_status_t(* sl_wifi_callback_function_t) (sl_wifi_event_t event, void *data, uint32_t data_length, void *arg) )(sl_wifi_event_t event, void *data, uint32_t data_length, void *arg)
Generic Wi-Fi callback function type.
15
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_scan_callback_t#
typedef sl_status_t(* sl_wifi_scan_callback_t) (sl_wifi_event_t event, sl_wifi_scan_result_t *data, uint32_t data_length, void *arg) )(sl_wifi_event_t event, sl_wifi_scan_result_t *data, uint32_t data_length, void *arg)
Wi-Fi scan result callback type.
In case of event failure, SL_WIFI_FAIL_EVENT_STATUS_INDICATION bit is set in event, data will be of type sl_status_t and data_length can be ignored
19
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_stats_callback_t#
typedef sl_status_t(* sl_wifi_stats_callback_t) (sl_wifi_event_t event, void *data, uint32_t data_length, void *arg) )(sl_wifi_event_t event, void *data, uint32_t data_length, void *arg)
Wi-Fi stats callback type.
In case of event failure, SL_WIFI_FAIL_EVENT_STATUS_INDICATION bit is set in event, data will be of type sl_status_t and data_length can be ignored Note
structure of data to be expected
SL_WIFI_STATS_EVENT -> Coming soon
: SL_WIFI_STATS_AYSNC_EVENT -> sl_si91x_async_stats_response_t
: SL_WIFI_STATS_ADVANCE_EVENT -> sl_si91x_advance_stats_response_t
: SL_WIFI_STATS_TEST_MODE_EVENT -> Coming soon
: SL_WIFI_STATS_MODULE_STATE_EVENT -> sl_si91x_module_state_stats_response_t
32
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_join_callback_t#
typedef sl_status_t(* sl_wifi_join_callback_t) (sl_wifi_event_t event, char *data, uint32_t data_length, void *arg) )(sl_wifi_event_t event, char *data, uint32_t data_length, void *arg)
Wi-Fi join callback type.
In case of event failure, SL_WIFI_FAIL_EVENT_STATUS_INDICATION bit is set in event, data will be of type sl_status_t and data_length can be ignored
36
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_twt_config_callback_t#
typedef sl_status_t(* sl_wifi_twt_config_callback_t) (sl_wifi_event_t event, sl_si91x_twt_response_t *data, uint32_t data_length, void *arg) )(sl_wifi_event_t event, sl_si91x_twt_response_t *data, uint32_t data_length, void *arg)
TWT Response callback type.
In case of event failure, SL_WIFI_FAIL_EVENT_STATUS_INDICATION bit is set in event, data will be of type sl_status_t and data_length can be ignored
40
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
Function Documentation#
sl_wifi_set_callback#
sl_status_t sl_wifi_set_callback (sl_wifi_event_group_t group, sl_wifi_callback_function_t function, void * optional_arg)
Register a function and optional argument for a selected callback.
[in] | group | ID of the event. See sl_wifi_event_t |
[in] | function | Function pointer to callback |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
sl_wifi_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
Callbacks can be set only for sl_wifi_event_group_t, not for individual events (sl_wifi_event_t)
61
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
default_wifi_event_handler#
sl_status_t default_wifi_event_handler (sl_wifi_event_t event, sl_wifi_buffer_t * buffer)
Default Wi-Fi event handler.
N/A | event | |
N/A | buffer |
64
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_set_scan_callback#
static sl_status_t sl_wifi_set_scan_callback (sl_wifi_scan_callback_t function, void * optional_arg)
Register a function and optional argument for scan results callback.
[in] | function | Function pointer to callback |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
sl_wifi_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
78
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_set_join_callback#
static sl_status_t sl_wifi_set_join_callback (sl_wifi_join_callback_t function, void * optional_arg)
Register a function and optional argument for join status callback.
[in] | function | Function pointer to callback |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
sl_wifi_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
95
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_set_twt_config_callback#
static sl_status_t sl_wifi_set_twt_config_callback (sl_wifi_twt_config_callback_t function, void * optional_arg)
Register a function and optional argument for TWT response callback.
[in] | function | Function pointer to callback |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
sl_wifi_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
112
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_set_stats_callback#
static sl_status_t sl_wifi_set_stats_callback (sl_wifi_stats_callback_t function, void * optional_arg)
Register a function and optional argument for statistic report callback.
[in] | function | Function pointer to callback |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
sl_wifi_init should be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
129
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h