Client#

Functions#

sl_status_t
sl_wifi_connect(sl_wifi_interface_t interface, const sl_wifi_client_configuration_t *access_point, uint32_t timeout_ms)

Connect to the given Wi-Fi AP.

sl_status_t
sl_wifi_disconnect(sl_wifi_interface_t interface)

Disconnect the Wi-Fi client interface.

sl_status_t
sl_wifi_get_signal_strength(sl_wifi_interface_t interface, int32_t *rssi)

Retrieve the RSSI value of the Access Point to which the Wi-Fi client is connected.

sl_status_t
sl_wifi_get_sta_tsf(sl_wifi_interface_t interface, sl_wifi_tsf64_t *tsf)

Get the station Timing Synchronization Function (TSF) time which is synchronised with connected AP beacon TSF.

sl_status_t
sl_wifi_set_roam_configuration(sl_wifi_interface_t interface, sl_wifi_roam_configuration_t *roam_configuration)

Set the Wi-Fi roaming configuration.

sl_status_t
sl_wifi_get_roam_configuration(sl_wifi_interface_t interface, sl_wifi_roam_configuration_t *roam_configuration)

Get the Wi-Fi roaming configuration.

sl_status_t
sl_wifi_test_client_configuration(sl_wifi_interface_t interface, const sl_wifi_client_configuration_t *ap, uint32_t timeout_ms)

Verify the Wi-Fi client configuration is valid and available.

sl_status_t
sl_wifi_set_certificate(uint8_t certificate_type, const uint8_t *buffer, uint32_t certificate_length)

Load the certificate into the device.

sl_status_t
sl_wifi_set_certificate_with_index(uint8_t certificate_type, uint8_t certificate_index, uint8_t *buffer, uint32_t certificate_length)

Load the certificate into the device.

sl_status_t
sl_wifi_set_advanced_client_configuration(sl_wifi_interface_t interface, const sl_wifi_advanced_client_configuration_t *configuration)

Set the advanced configuration options of a client interface.

sl_status_t
sl_wifi_send_raw_data_frame(sl_wifi_interface_t interface, const void *data, uint16_t data_length)

Send raw data frame.

sl_status_t
sl_wifi_enable_target_wake_time(sl_wifi_twt_request_t *twt_req)

Configure TWT parameters.

sl_status_t
sl_wifi_disable_target_wake_time(sl_wifi_twt_request_t *twt_req)

Configure TWT parameters.

sl_status_t
sl_wifi_target_wake_time_auto_selection(sl_wifi_twt_selection_t *twt_selection_req)

Calculates and configures TWT parameters based on the given inputs.

sl_status_t
sl_wifi_reschedule_twt(uint8_t flow_id, sl_wifi_reschedule_twt_action_t twt_action, uint64_t suspend_duration)

Suspends the TWT agreement corresponding to given flow id and resumes it when suspend duration expires.

sl_status_t
sl_wifi_filter_broadcast(uint16_t beacon_drop_threshold, uint8_t filter_bcast_in_tim, uint8_t filter_bcast_tim_till_next_cmd)

Send Filter Broadcast Request frame.

sl_status_t
sl_wifi_get_pairwise_master_key(sl_wifi_interface_t interface, const uint8_t type, const sl_wifi_ssid_t *ssid, const char *pre_shared_key, uint8_t *pairwise_master_key)

Generate PMK if PSK and SSID are provided.

sl_status_t
sl_wifi_configure_multicast_filter(sl_wifi_multicast_filter_info_t *multicast_filter_info)

Configure multicast filter parameters.

Function Documentation#

sl_wifi_connect#

sl_status_t sl_wifi_connect (sl_wifi_interface_t interface, const sl_wifi_client_configuration_t * access_point, uint32_t timeout_ms)

Connect to the given Wi-Fi AP.

Parameters
[in]interface

Wi-Fi client interface as identified by sl_wifi_interface_t

[in]access_point

sl_wifi_client_configuration_t object that contains the Access Point details.

[in]timeout_ms

Timeout value in milliseconds. The function will abort and return when the timeout timer expires. A value of 0 indicates an asynchronous action.

  • Pre-conditions:

Returns

Note

  • If channel, band, and BSSID are provided, this API will attempt to connect without scanning. If security_type is SL_WIFI_WPA3 then SL_SI91X_JOIN_FEAT_MFP_CAPABLE_REQUIRED join feature is enabled internally by SDK. If security_type is SL_WIFI_WPA3_TRANSITION then SL_SI91X_JOIN_FEAT_MFP_CAPABLE_REQUIRED join feature is disabled and SL_SI91X_JOIN_FEAT_MFP_CAPABLE_ONLY join feature is enabled internally by SDK. Default Active Channel time is 100 milliseconds. If the user needs to modify the time, sl_wifi_set_advanced_scan_configuration can be called. Default Authentication timeout and Association timeout is 300 milliseconds. If the user needs to modify the time, sl_wifi_set_advanced_client_configuration can be called. Default Keep Alive timeout is 30 milliseconds. If the user needs to modify the time, sl_wifi_set_advanced_client_configuration can be called.

  • In FCC certified module the behavior is as follows

    1. Region configuration is not supported and if triggered will return error SL_STATUS_SI91X_FEATURE_NOT_AVAILABLE.

    2. STA mode channels 1 to 11 are actively scanned and 12,13,14 are passively scanned.

    3. Concurrent mode supports only 1 to 11 channels.


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

sl_wifi_disconnect#

sl_status_t sl_wifi_disconnect (sl_wifi_interface_t interface)

Disconnect the Wi-Fi client interface.

Parameters
[in]interface

Wi-Fi client interface as identified by sl_wifi_interface_t

Returns


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

sl_wifi_get_signal_strength#

sl_status_t sl_wifi_get_signal_strength (sl_wifi_interface_t interface, int32_t * rssi)

Retrieve the RSSI value of the Access Point to which the Wi-Fi client is connected.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[in]rssi

signal strength (RSSI) in dBm.

Returns


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

sl_wifi_get_sta_tsf#

sl_status_t sl_wifi_get_sta_tsf (sl_wifi_interface_t interface, sl_wifi_tsf64_t * tsf)

Get the station Timing Synchronization Function (TSF) time which is synchronised with connected AP beacon TSF.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[out]tsf

64-bit TSF time in microseconds stored in sl_wifi_tsf64_t structure.

Returns

Note

  • This API returns an error if the station is not connected to an Access Point or at least one beacon is not received.


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

sl_wifi_set_roam_configuration#

sl_status_t sl_wifi_set_roam_configuration (sl_wifi_interface_t interface, sl_wifi_roam_configuration_t * roam_configuration)

Set the Wi-Fi roaming configuration.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[in]roam_configuration

sl_wifi_roam_configuration_t object to store Wi-Fi roaming configuration.

Returns

Note

  • For si91x chips, following ranges are valid: trigger_level: [-10, -100] , trigger_level_change: [0, 90]


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

sl_wifi_get_roam_configuration#

sl_status_t sl_wifi_get_roam_configuration (sl_wifi_interface_t interface, sl_wifi_roam_configuration_t * roam_configuration)

Get the Wi-Fi roaming configuration.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[out]roam_configuration

sl_wifi_roam_configuration_t object that will contain the current roam configuration.

Returns

Note

  • This API is not yet implemented.


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

sl_wifi_test_client_configuration#

sl_status_t sl_wifi_test_client_configuration (sl_wifi_interface_t interface, const sl_wifi_client_configuration_t * ap, uint32_t timeout_ms)

Verify the Wi-Fi client configuration is valid and available.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[in]ap

sl_wifi_client_configuration_t object that contains the details of Access Point.

[in]timeout_ms

Timeout value in milliseconds. The function will abort and return when the timeout timer expires. A timeout value of 0 means the function will initiate the verification process and return immediately, without waiting for the process to complete. This indicates that the action will be handled asynchronously.

  • Pre-conditions:

Returns


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

sl_wifi_set_certificate#

sl_status_t sl_wifi_set_certificate (uint8_t certificate_type, const uint8_t * buffer, uint32_t certificate_length)

Load the certificate into the device.

Parameters
[in]certificate_type

Certificate type being set

[in]buffer

Pointer to buffer containing the certificate.

[in]certificate_length

Length of certificate buffer data.

  • Pre-conditions:

Returns


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

sl_wifi_set_certificate_with_index#

sl_status_t sl_wifi_set_certificate_with_index (uint8_t certificate_type, uint8_t certificate_index, uint8_t * buffer, uint32_t certificate_length)

Load the certificate into the device.

Parameters
[in]certificate_type

Certificate type being set.

[in]certificate_index

Certificate to be loaded in specified index.

[in]buffer

Pointer to buffer containing the certificate.

[in]certificate_length

Length of certificate buffer data.

  • Pre-conditions:

Returns


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

sl_wifi_set_advanced_client_configuration#

sl_status_t sl_wifi_set_advanced_client_configuration (sl_wifi_interface_t interface, const sl_wifi_advanced_client_configuration_t * configuration)

Set the advanced configuration options of a client interface.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[in]configuration

Wi-Fi client advanced configuration. See sl_wifi_advanced_client_configuration_t

Returns


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

sl_wifi_send_raw_data_frame#

sl_status_t sl_wifi_send_raw_data_frame (sl_wifi_interface_t interface, const void * data, uint16_t data_length)

Send raw data frame.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[in]data

Data buffer.

[in]data_length

length of the data.

  • Pre-conditions:

Returns


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

sl_wifi_enable_target_wake_time#

sl_status_t sl_wifi_enable_target_wake_time (sl_wifi_twt_request_t * twt_req)

Configure TWT parameters.

Parameters
[in]twt_req

Configurable TWT parameters specified in sl_wifi_twt_request_t.

Enables a TWT session. This is blocking API.

Returns


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

sl_wifi_disable_target_wake_time#

sl_status_t sl_wifi_disable_target_wake_time (sl_wifi_twt_request_t * twt_req)

Configure TWT parameters.

Parameters
[in]twt_req

Configurable TWT parameters specified in sl_wifi_twt_request_t.

Disables a TWT session. This is blocking API.

Returns


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

sl_wifi_target_wake_time_auto_selection#

sl_status_t sl_wifi_target_wake_time_auto_selection (sl_wifi_twt_selection_t * twt_selection_req)

Calculates and configures TWT parameters based on the given inputs.

Parameters
[in]twt_selection_req

sl_wifi_twt_selection_t object containing configurable TWT selection parameters.

Enables or disables a TWT session. This is blocking API.

Returns


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

sl_wifi_reschedule_twt#

sl_status_t sl_wifi_reschedule_twt (uint8_t flow_id, sl_wifi_reschedule_twt_action_t twt_action, uint64_t suspend_duration)

Suspends the TWT agreement corresponding to given flow id and resumes it when suspend duration expires.

Parameters
[in]flow_id

Flow id of the twt agreement.

[in]twt_action

sl_wifi_reschedule_twt_action_t specifying different actions that can be taken in relation to rescheduling TWT.

[in]suspend_duration

Time interval until which twt agreement is suspended, value taken in milliseconds.

This API performs the following actions on TWT agreement: SL_WIFI_SUSPEND_INDEFINITELY, SL_WIFI_RESUME_IMMEDIATELY, SL_WIFI_SUSPEND_FOR_DURATION. Note

  • The reschedule TWT actions are valid till the end of current TWT agreement. If the TWT agreement is terminated (TWT tear down or WLAN disconnection), these actions are not retained. To reapply these actions upon new TWT agreement, the user must re-issue the command.

The table below outlines the valid values for TWT actions and their corresponding suspend durations:#

twt_action

Valid values for suspend duration

SL_WIFI_SUSPEND_INDEFINITELY

0

SL_WIFI_RESUME_IMMEDIATELY

0

SL_WIFI_SUSPEND_FOR_DURATION

1 to 86400000

Returns


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

sl_wifi_filter_broadcast#

sl_status_t sl_wifi_filter_broadcast (uint16_t beacon_drop_threshold, uint8_t filter_bcast_in_tim, uint8_t filter_bcast_tim_till_next_cmd)

Send Filter Broadcast Request frame.

Parameters
[in]beacon_drop_threshold

The amount of time that FW waits to receive full beacon. Default value is 5000 ms.

[in]filter_bcast_in_tim

If this bit is set, then from the next dtim any broadcast data pending bit in TIM indicated will be ignored valid values: 0 - 1.

[in]filter_bcast_tim_till_next_cmd

0 - filter_bcast_in_tim is valid till disconnect of the STA. 1 - filter_bcast_in_tim is valid till next update by giving the same command.

  • Pre-conditions:

Returns


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

sl_wifi_get_pairwise_master_key#

sl_status_t sl_wifi_get_pairwise_master_key (sl_wifi_interface_t interface, const uint8_t type, const sl_wifi_ssid_t * ssid, const char * pre_shared_key, uint8_t * pairwise_master_key)

Generate PMK if PSK and SSID are provided.

Parameters
[in]interface

Wi-Fi interface as identified by sl_wifi_interface_t

[in]type

Possible values of this field are 1, 2, and 3, but we only pass 3 for generation of PMK.

[in]ssid

SSID of type sl_wifi_ssid_t has the SSID of the access point

[in]pre_shared_key

Expected parameters are pre-shared key(PSK) of the access point

[in]pairwise_master_key

PMK array

This is a blocking API.

Returns


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

sl_wifi_configure_multicast_filter#

sl_status_t sl_wifi_configure_multicast_filter (sl_wifi_multicast_filter_info_t * multicast_filter_info)

Configure multicast filter parameters.

Parameters
[in]multicast_filter_info

Configurable multicast filter parameters specified in sl_wifi_multicast_filter_info_t.

This is a blocking API.

  • Pre-conditions:

Returns


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