Common#
Functions#
This function initializes the Wi-Fi module using the specified device configuration, device context, and event handler.
This function ensures proper shutdown of the Wi-Fi driver, resetting configurations and releasing resources.
Check if Wi-Fi interface is up.
Return the firmware version running on the Wi-Fi device.
Gets wlan info in AP mode / Client mode.
Return the firmware image size from firmware image.
Set the default Wi-Fi interface as supported by sl_wifi_interface_t.
Get the default interface.
Retrieves the MAC addresses of the specified Wi-Fi interface, in concurrent mode retrieves two MAC addresses.
Set the Wi-Fi interface MAC address.
Function Documentation#
sl_wifi_init#
sl_status_t sl_wifi_init (const sl_wifi_device_configuration_t * configuration, sl_wifi_device_context_t * device_context, sl_wifi_event_handler_t event_handler)
This function initializes the Wi-Fi module using the specified device configuration, device context, and event handler.
[in] | configuration | sl_wifi_device_configuration_t object that contains Wi-Fi device configuration. |
[in] | device_context | Reserved for future use. |
[in] | event_handler | Wi-Fi event handler function of type sl_wifi_event_handler_t. |
It configures the Wi-Fi device and establishes the event handler for Wi-Fi events. This function must be called before using any other Wi-Fi functions. Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details.
Note
This function should be called before calling any other sl_wifi functions.
65
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_deinit#
sl_status_t sl_wifi_deinit (void )
This function ensures proper shutdown of the Wi-Fi driver, resetting configurations and releasing resources.
N/A |
Call this API to deinitialize the Wi-Fi module to avoid resource leaks.
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
All si91x, BSD, and IoT sockets must be closed before invoking this API.
81
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_is_interface_up#
bool sl_wifi_is_interface_up (sl_wifi_interface_t interface)
Check if Wi-Fi interface is up.
[in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
Pre-conditions:
sl_wifi_init should be called before this API.
Returns
true: interface is up.
false: interface is down.
95
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_get_firmware_version#
sl_status_t sl_wifi_get_firmware_version (sl_wifi_firmware_version_t * version)
Return the firmware version running on the Wi-Fi device.
[out] | version | sl_wifi_firmware_version_t object that contains the version string. |
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
Moving forward, this API will be deprecated. Instead, use the sl_si91x_get_firmware_version API.
110
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_get_wireless_info#
sl_status_t sl_wifi_get_wireless_info (sl_si91x_rsp_wireless_info_t * info)
Gets wlan info in AP mode / Client mode.
[out] | info | sl_si91x_rsp_wireless_info_t object that contains the wlan info. |
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.
123
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_get_firmware_size#
sl_status_t sl_wifi_get_firmware_size (void * buffer, uint32_t * fw_image_size)
Return the firmware image size from firmware image.
[in] | buffer | Buffer pointing to firmware image file. |
[out] | fw_image_size | Size of the firmware image passed in the input buffer param. The value returned in this param is valid only if this API returns SL_STATUS_OK(0). |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details.
Note
Moving forward, this API will be deprecated. Instead, use the sl_si91x_get_firmware_size API.
137
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_set_default_interface#
void sl_wifi_set_default_interface (sl_wifi_interface_t interface)
Set the default Wi-Fi interface as supported by sl_wifi_interface_t.
[in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
145
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_get_default_interface#
sl_wifi_interface_t sl_wifi_get_default_interface (void )
Get the default interface.
N/A |
Pre-conditions:
sl_wifi_init should be called before this API.
Returns
sl_wifi_interface_t previously set by sl_wifi_set_default_interface
156
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_get_mac_address#
sl_status_t sl_wifi_get_mac_address (sl_wifi_interface_t interface, sl_mac_address_t * mac)
Retrieves the MAC addresses of the specified Wi-Fi interface, in concurrent mode retrieves two MAC addresses.
[in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
[out] | mac | sl_mac_address_t object contains the MAC address of the interface. |
MAC address of the module. In concurrent mode, two MAC addresses are returned, MAC_Address1 is the station MAC address and MAC_Address2 is the created AP MAC address. MAC address is returned in 6-bytes in hex format.
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.
174
of file components/protocol/wifi/inc/sl_wifi.h
sl_wifi_set_mac_address#
sl_status_t sl_wifi_set_mac_address (sl_wifi_interface_t interface, const sl_mac_address_t * mac)
Set the Wi-Fi interface MAC address.
[in] | interface | Wi-Fi interface as identified by sl_wifi_interface_t |
[in] | mac | sl_mac_address_t object to store the MAC address. |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details.
Note
This API is not supported by Si917 when called directly due to firmware constraints. Alternatively, sl_wifi_init can be used to configure the MAC address. sl_wifi_init ensures the appropriate state of firmware and calls this API to set MAC address.
189
of file components/protocol/wifi/inc/sl_wifi.h