Scanning#
Functions#
Initiates a Wi-Fi scan operation on the specified interface, supporting advanced and background scan types.
Returns the stored scan results of a detailed scan in the user provided scan results array.
Stops an ongoing advanced Wi-Fi scan operation on the specified interface.
Configures advanced scan settings for a Wi-Fi interface and enables instant scan capability.
Retrieves the current advanced scan configuration parameters from the Wi-Fi interface.
Wait for current scan to complete and store the results in the provided array.
Function Documentation#
sl_wifi_start_scan#
sl_status_t sl_wifi_start_scan (sl_wifi_interface_t interface, const sl_wifi_ssid_t * optional_ssid, const sl_wifi_scan_configuration_t * configuration)
Initiates a Wi-Fi scan operation on the specified interface, supporting advanced and background scan types.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t | 
| const sl_wifi_ssid_t * | [in] | optional_ssid | Optional SSID of type sl_wifi_ssid_t can be used to scan for a particular Wi-Fi network | 
| const sl_wifi_scan_configuration_t * | [in] | configuration | 
- Pre-conditions: - sl_wifi_init should be called before this API. 
 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
Note
- For 911x, advanced scan results are not populated to user. Default Active Channel time is 100 milliseconds. If the user wants to modify the time, sl_wifi_set_advanced_scan_configuration can be called. If the scan_type is not ADV_SCAN, then the time is for foreground scan. Otherwise, it is used for background scanning. For more details, refer to sl_wifi_scan_type_t. If the user wants to enable Passive Scanning, user should set the scan_type to SL_WIFI_SCAN_TYPE_PASSIVE. If the user wants to enable Low Power (LP) mode in Passive Scan, user should enable lp_mode in sl_wifi_scan_configuration_t. The default channel time for passive scanning is set to 400 milliseconds. If user wants to modify the time, users can call the sl_si91x_set_timeout API to modify the time as per their requirements. Use the SL_WIFI_SCAN_TYPE_EXTENDED to obtain the scan results that exceed the SL_WIFI_MAX_SCANNED_AP. In this scan type, the number of scan results is not restricted; it is only limited by the amount of dynamic memory that the host can provide. Default Passive Scan Channel time is 400 milliseconds. If the user wants to modify the time, sl_si91x_set_timeout can be called. In case of SL_WIFI_SCAN_TYPE_EXTENDED scan type, use sl_wifi_get_stored_scan_results() API to get the scan results; after the scan status callback is received. This API is not applicable for ADV_SCAN scan_type in AP mode This API is supported in AP mode, to scan for - to trigger this, send a scan after sl_wifi_start_ap() API with the SL_WIFI_SCAN_TYPE_ACTIVE scan_type. 
sl_wifi_get_stored_scan_results#
sl_status_t sl_wifi_get_stored_scan_results (sl_wifi_interface_t interface, sl_wifi_extended_scan_result_parameters_t * extended_scan_parameters)
Returns the stored scan results of a detailed scan in the user provided scan results array.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t | 
| sl_wifi_extended_scan_result_parameters_t * | [inout] | extended_scan_parameters | A pointer to a structure of type sl_wifi_extended_scan_result_parameters_t, where the scan results are stored. | 
- 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
- This API will only hold scan results if sl_wifi_start_scan is called with scan type as SL_WIFI_SCAN_TYPE_EXTENDED. These results are stored until another call to sl_wifi_start_scan is made with scan type as SL_WIFI_SCAN_TYPE_EXTENDED. 
sl_wifi_stop_scan#
sl_status_t sl_wifi_stop_scan (sl_wifi_interface_t interface)
Stops an ongoing advanced Wi-Fi scan operation on the specified interface.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_interface_t | [in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t | 
An advanced scan allows the user to perform a scan while the SiWx91x device is in a connected state.
- Pre-conditions: This API is applicable only for client interface. sl_wifi_init should be called before this API. 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
Note
- For 911x, sl_wifi_stop_scan is ONLY supported for advanced scan. 
sl_wifi_set_advanced_scan_configuration#
sl_status_t sl_wifi_set_advanced_scan_configuration (const sl_wifi_advanced_scan_configuration_t * configuration)
Configures advanced scan settings for a Wi-Fi interface and enables instant scan capability.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| const sl_wifi_advanced_scan_configuration_t * | [in] | configuration | Set advanced scan configuration as identified by sl_wifi_advanced_scan_configuration_t | 
sl_wifi_advanced_scan_configuration_t object that contains the advanced scan configuration.
- Pre-conditions: - sl_wifi_init should be called before this API. 
 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
Note
- Advance scan is not applicable in AP mode. 
sl_wifi_get_advanced_scan_configuration#
sl_status_t sl_wifi_get_advanced_scan_configuration (sl_wifi_advanced_scan_configuration_t * configuration)
Retrieves the current advanced scan configuration parameters from the Wi-Fi interface.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_advanced_scan_configuration_t * | [out] | configuration | sl_wifi_advanced_scan_configuration_t object that contains the current advanced scan configuration. | 
This function should be used after successful Wi-Fi connection.
- Pre-conditions: - sl_wifi_init should be called before this API. 
 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
sl_wifi_wait_for_scan_results#
sl_status_t sl_wifi_wait_for_scan_results (sl_wifi_scan_result_t ** scan_result_array, uint32_t max_scan_result_count)
Wait for current scan to complete and store the results in the provided array.
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| sl_wifi_scan_result_t ** | [in] | scan_result_array | Array of sl_wifi_scan_result_t objects to store the scan results. | 
| uint32_t | [in] | max_scan_result_count | The maximum number of scan result objects that can fit in the scan result array. | 
- Pre-conditions: - This function also returns when the scan result array is full. 
 
- Pre-conditions: - Once the scan result array is full, any further scan results will be lost. 
 
Returns
- sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 
Note
- This API is not supported in the current release.