Callback Framework#
This section provides a reference to Wi-Fi API callback handling functions.
Typedefs#
Generic callback for Wi-Fi group event of type sl_wifi_event_group_t.
Callback for SL_WIFI_SCAN_RESULT_EVENTS group event.
Callback for SL_WIFI_STATS_RESPONSE_EVENTS group events.
Callback for SL_WIFI_JOIN_EVENTS group events.
Callback for SL_WIFI_TWT_RESPONSE_EVENTS group events.
Functions#
SL_SI91X_WIFI_BTR_MODE.
Default Wi-Fi event handler to passed to sl_wifi_init.
Register callback for SL_WIFI_SCAN_RESULT_EVENTS group event from sl_wifi_event_group_t.
Register callback for SL_WIFI_JOIN_EVENTS group event from sl_wifi_event_group_t.
Register callback for SL_WIFI_TWT_RESPONSE_EVENTS group event from sl_wifi_event_group_t.
Register callback for SL_WIFI_STATS_RESPONSE_EVENTS group event from sl_wifi_event_group_t.
Macros#
Generic macro for callback functions to check if the event has Failed.
Typedef Documentation#
sl_wifi_callback_function_t#
sl_wifi_callback_function_t )(sl_wifi_event_t event, void *data, uint32_t data_length, void *arg)
Generic callback for Wi-Fi group event of type sl_wifi_event_group_t.
N/A | event | Wi-Fi event of type sl_wifi_event_t |
N/A | data | Data received |
N/A | data_length | Data length |
N/A | optional_arg | Optional user provided argument passed in sl_wifi_set_callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
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
47
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_scan_callback_t#
sl_wifi_scan_callback_t )(sl_wifi_event_t event, sl_wifi_scan_result_t *data, uint32_t data_length, void *optional_arg)
Callback for SL_WIFI_SCAN_RESULT_EVENTS group event.
N/A | event | Wi-Fi event of type sl_wifi_event_t |
N/A | data | Scan results of type sl_wifi_scan_result_t |
N/A | data_length | Data length |
N/A | optional_arg | Optional user provided argument passed in sl_wifi_set_scan_callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
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
65
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_stats_callback_t#
sl_wifi_stats_callback_t )(sl_wifi_event_t event, void *data, uint32_t data_length, void *optional_arg)
Callback for SL_WIFI_STATS_RESPONSE_EVENTS group events.
N/A | event | Wi-Fi event of type sl_wifi_event_t Individual Wi-Fi events related to SL_WIFI_STATS_RESPONSE_EVENTS is as follows.
| ||||||||||||
N/A | data | Data received. | ||||||||||||
N/A | data_length | Data length | ||||||||||||
N/A | optional_arg | Optional user provided argument passed in sl_wifi_set_stats_callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
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.
94
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_join_callback_t#
sl_wifi_join_callback_t )(sl_wifi_event_t event, char *data, uint32_t data_length, void *arg)
Callback for SL_WIFI_JOIN_EVENTS group events.
N/A | event | Wi-Fi event of type sl_wifi_event_t | ||||||
N/A | data | Data received in string.
| ||||||
N/A | data_length | Data length | ||||||
N/A | optional_arg | Optional user provided argument passed in sl_wifi_set_join_callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
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
119
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_twt_config_callback_t#
sl_wifi_twt_config_callback_t )(sl_wifi_event_t event, sl_si91x_twt_response_t *data, uint32_t data_length, void *arg)
Callback for SL_WIFI_TWT_RESPONSE_EVENTS group events.
N/A | event | Wi-Fi event of type sl_wifi_event_t Individual Wi-Fi events related to SL_WIFI_TWT_RESPONSE_EVENTS is as follows.
| ||||||||||||||
N/A | data | Data received of type sl_si91x_twt_response_t. | ||||||||||||||
N/A | data_length | Data length | ||||||||||||||
N/A | optional_arg | Optional user provided argument passed in sl_wifi_set_twt_config_callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
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
153
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)
SL_SI91X_WIFI_BTR_MODE.
[in] | group | group id of the event. See sl_wifi_event_group_t |
[in] | function | Function pointer to callback of type sl_wifi_callback_function_t |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler of type sl_wifi_callback_function_t |
Register a callback for selected event group. All the individual Wi-Fi events related to specific group will be triggered via this group callback
Pre-conditions:
Pre-conditions:
Pre-conditions:
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)
202
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h
sl_wifi_default_event_handler#
sl_status_t sl_wifi_default_event_handler (sl_wifi_event_t event, sl_wifi_buffer_t * buffer)
Default Wi-Fi event handler to passed to sl_wifi_init.
[in] | event | Wi-Fi event of type of sl_wifi_event_t |
[in] | buffer | Buffer containing raw data from TA firmware |
This function will dispatch Wi-Fi events and invokes respective Wi-Fi group event callback Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
Passing this event handler is optional. User can implement his own event dispatching framework.
216
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 callback for SL_WIFI_SCAN_RESULT_EVENTS group event from sl_wifi_event_group_t.
[in] | function | Optional user provided argument. This will be passed back to callback handler of type sl_wifi_scan_callback_t |
N/A | optional_arg |
Pre-conditions:
Pre-conditions:
Pre-conditions:
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
All the individual Wi-Fi events related to this group will be triggered via this callback
233
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 callback for SL_WIFI_JOIN_EVENTS group event from sl_wifi_event_group_t.
[in] | function | Function pointer to callback. This will be passed back to callback handler of type sl_wifi_join_callback_t |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
Pre-conditions:
Pre-conditions:
Pre-conditions:
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
All the individual Wi-Fi events related to this group will be triggered via this callback
255
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 callback for SL_WIFI_TWT_RESPONSE_EVENTS group event from sl_wifi_event_group_t.
[in] | function | Function pointer to callback. This will be passed back to callback handler of type sl_wifi_twt_config_callback_t |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
Pre-conditions:
Pre-conditions:
Pre-conditions:
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
All the individual Wi-Fi events related to this group will be triggered via this callback.
277
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 callback for SL_WIFI_STATS_RESPONSE_EVENTS group event from sl_wifi_event_group_t.
[in] | function | Function pointer to callback. This will be passed back to callback handler of type sl_wifi_stats_callback_t |
[in] | optional_arg | Optional user provided argument. This will be passed back to callback handler. |
Pre-conditions:
Pre-conditions:
Pre-conditions:
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
All the individual Wi-Fi events related to this group will be triggered via this callback.
299
of file components/protocol/wifi/inc/sl_wifi_callback_framework.h