Common#

Functions#

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.

sl_status_t

This function ensures proper shutdown of the Wi-Fi driver, resetting configurations and releasing resources.

bool
sl_wifi_is_interface_up(sl_wifi_interface_t interface)

Check if Wi-Fi interface is up.

sl_status_t
sl_wifi_get_firmware_version(sl_wifi_firmware_version_t *version)

Return the firmware version running on the Wi-Fi device.

sl_status_t
sl_wifi_get_wireless_info(sl_si91x_rsp_wireless_info_t *info)

Gets wlan info in AP mode / Client mode.

sl_status_t
sl_wifi_get_firmware_size(void *buffer, uint32_t *fw_image_size)

Return the firmware image size from firmware image.

void
sl_wifi_set_default_interface(sl_wifi_interface_t interface)

Set the default Wi-Fi interface as supported by sl_wifi_interface_t.

Get the default interface.

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.

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.

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.

Parameters
[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

Note

  • This function should be called before calling any other sl_wifi functions.


Definition at line 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.

Parameters
N/A

Call this API to deinitialize the Wi-Fi module to avoid resource leaks.

  • Pre-conditions:

Returns

Note

  • All si91x, BSD, and IoT sockets must be closed before invoking this API.


Definition at line 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.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

  • Pre-conditions:

Returns

    1. true: interface is up.

    2. false: interface is down.


Definition at line 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.

Parameters
[out]version

sl_wifi_firmware_version_t object that contains the version string.

  • Pre-conditions:

Returns

Note


Definition at line 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.

Parameters
[out]info

sl_si91x_rsp_wireless_info_t object that contains the wlan info.

  • Pre-conditions:

Returns


Definition at line 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.

Parameters
[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

Note


Definition at line 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.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t


Definition at line 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.

Parameters
N/A
  • Pre-conditions:

Returns


Definition at line 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.

Parameters
[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:

Returns


Definition at line 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.

Parameters
[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

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.


Definition at line 189 of file components/protocol/wifi/inc/sl_wifi.h