1 /***************************************************************************/ /** 2 * @file 3 * @brief SL Wi-Fi API 4 ******************************************************************************* 5 * # License 6 * <b>Copyright 2022 Silicon Laboratories Inc. www.silabs.com</b> 7 ******************************************************************************* 8 * 9 * SPDX-License-Identifier: Zlib 10 * 11 * The licensor of this software is Silicon Laboratories Inc. 12 * 13 * This software is provided 'as-is', without any express or implied 14 * warranty. In no event will the authors be held liable for any damages 15 * arising from the use of this software. 16 * 17 * Permission is granted to anyone to use this software for any purpose, 18 * including commercial applications, and to alter it and redistribute it 19 * freely, subject to the following restrictions: 20 * 21 * 1. The origin of this software must not be misrepresented; you must not 22 * claim that you wrote the original software. If you use this software 23 * in a product, an acknowledgment in the product documentation would be 24 * appreciated but is not required. 25 * 2. Altered source versions must be plainly marked as such, and must not be 26 * misrepresented as being the original software. 27 * 3. This notice may not be removed or altered from any source distribution. 28 * 29 ******************************************************************************/ 30 31 #pragma once 32 #include "sl_wifi_device.h" 33 #include "sl_wifi_types.h" 34 #include "sl_wifi_host_interface.h" 35 #include <stdint.h> 36 #include <stdbool.h> 37 38 /// Default Wi-Fi scan configuration 39 extern const sl_wifi_scan_configuration_t default_wifi_scan_configuration; 40 41 /// Default Wi-Fi AP configuration 42 extern const sl_wifi_ap_configuration_t default_wifi_ap_configuration; 43 44 /** \addtogroup WIFI_COMMON_API Common 45 * \ingroup SL_WIFI_FUNCTIONS 46 * @{ */ 47 48 /***************************************************************************/ /** 49 * @brief 50 * This function initializes the Wi-Fi module using the specified device configuration, 51 * device context, and event handler. It configures the Wi-Fi device and establishes 52 * the event handler for Wi-Fi events. This function must be called before using any 53 * other Wi-Fi functions. 54 * @param[in] configuration 55 * [sl_wifi_device_configuration_t](../wiseconnect-api-reference-guide-si91x-driver/sl-wifi-device-configuration-t) object that contains Wi-Fi device configuration. 56 * @param[in] device_context 57 * Reserved for future use. 58 * @param[in] event_handler 59 * Wi-Fi event handler function of type @ref sl_wifi_event_handler_t. 60 * @return 61 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 62 * @note 63 * This function should be called before calling any other sl_wifi functions. 64 ******************************************************************************/ 65 sl_status_t sl_wifi_init(const sl_wifi_device_configuration_t *configuration, 66 sl_wifi_device_context_t *device_context, 67 sl_wifi_event_handler_t event_handler); 68 69 /***************************************************************************/ /** 70 * @brief 71 * This function ensures proper shutdown of the Wi-Fi driver, resetting configurations and releasing resources. 72 * Call this API to deinitialize the Wi-Fi module to avoid resource leaks 73 * @pre Pre-conditions: 74 * - 75 * @ref sl_wifi_init should be called before this API. 76 * @return 77 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 78 ******************************************************************************/ 79 sl_status_t sl_wifi_deinit(void); 80 81 /***************************************************************************/ /** 82 * @brief 83 * Check if Wi-Fi interface is up. 84 * @pre Pre-conditions: 85 * - 86 * @ref sl_wifi_init should be called before this API. 87 * @param[in] interface 88 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 89 * @return 90 * 1. true: interface is up. 91 * 2. false: interface is down. 92 ******************************************************************************/ 93 bool sl_wifi_is_interface_up(sl_wifi_interface_t interface); 94 95 /***************************************************************************/ /** 96 * @brief 97 * Return the firmware version running on the Wi-Fi device. 98 * @pre Pre-conditions: 99 * - 100 * @ref sl_wifi_init should be called before this API. 101 * @param[out] version 102 * @ref sl_wifi_firmware_version_t object that contains the version string. 103 * @return 104 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 105 * @note 106 * Moving forward, this API will be deprecated. Instead, please use the [sl_si91x_get_firmware_version](../wiseconnect-api-reference-guide-si91x-driver/si91-x-driver-functions#sl-si91x-get-firmware-version) API. 107 ******************************************************************************/ 108 sl_status_t sl_wifi_get_firmware_version(sl_wifi_firmware_version_t *version); 109 110 /***************************************************************************/ /** 111 * @brief 112 * Gets wlan info in AP mode / Client mode. 113 * @pre Pre-conditions: 114 * - 115 * @ref sl_wifi_init should be called before this API. 116 * @param[out] info 117 * [sl_si91x_rsp_wireless_info_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-rsp-wireless-info-t) object that contains the wlan info. 118 * @return 119 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 120 ******************************************************************************/ 121 sl_status_t sl_wifi_get_wireless_info(sl_si91x_rsp_wireless_info_t *info); 122 123 /***************************************************************************/ /** 124 * @brief 125 * Return the firmware image size from firmware image. 126 * @param[in] buffer 127 * Buffer pointing to firmware image file. 128 * @param[out] fw_image_size 129 * 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). 130 * @return 131 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 132 * @note 133 * Moving forward, this API will be deprecated. Instead, please use the [sl_si91x_get_firmware_size](../wiseconnect-api-reference-guide-si91x-driver/si91-x-driver-functions#sl-si91x-get-firmware-size) API. 134 ******************************************************************************/ 135 sl_status_t sl_wifi_get_firmware_size(void *buffer, uint32_t *fw_image_size); 136 137 /***************************************************************************/ /** 138 * @brief 139 * Set the default Wi-Fi interface as supported by @ref sl_wifi_interface_t. 140 * @param[in] interface 141 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 142 ******************************************************************************/ 143 void sl_wifi_set_default_interface(sl_wifi_interface_t interface); 144 145 /***************************************************************************/ /** 146 * @brief 147 * Get the default interface. 148 * @pre Pre-conditions: 149 * - 150 * @ref sl_wifi_init should be called before this API. 151 * @return 152 * @ref sl_wifi_interface_t previously set by @ref sl_wifi_set_default_interface 153 ******************************************************************************/ 154 sl_wifi_interface_t sl_wifi_get_default_interface(void); 155 156 /***************************************************************************/ /** 157 * @brief 158 * Retrieves the MAC addresses of the specified Wi-Fi interface, in concurrent mode retrieves two MAC addresses. 159 * @details 160 * MAC address of the module. In concurrent mode, two MAC addresses are returned, MAC_Address1 is the station MAC 161 * address and MAC_Address2 is the created AP MAC address. MAC address is returned in 6-bytes in hex format. 162 * @pre Pre-conditions: 163 * - 164 * @ref sl_wifi_init should be called before this API. 165 * @param[in] interface 166 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 167 * @param[out] mac 168 * [sl_mac_address_t](../wiseconnect-api-reference-guide-nwk-mgmt/sl-net-types#sl-mac-address-t) object that contains the MAC address of the interface. 169 * @return 170 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 171 ******************************************************************************/ 172 sl_status_t sl_wifi_get_mac_address(sl_wifi_interface_t interface, sl_mac_address_t *mac); 173 174 /***************************************************************************/ /** 175 * @brief 176 * Set the Wi-Fi interface MAC address. 177 * @param[in] interface 178 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 179 * @param[in] mac 180 * [sl_mac_address_t](../wiseconnect-api-reference-guide-nwk-mgmt/sl-net-types#sl-mac-address-t) object to store the MAC address. 181 * @return 182 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 183 * @note 184 * This API is not supported by Si917 when called directly due to firmware constraints. 185 * Alternatively, @ref 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. 186 ******************************************************************************/ 187 sl_status_t sl_wifi_set_mac_address(sl_wifi_interface_t interface, const sl_mac_address_t *mac); 188 189 /** @} */ 190 191 /** \addtogroup WIFI_RADIO_API Radio 192 * \ingroup SL_WIFI_FUNCTIONS 193 * @{ */ 194 195 // Radio management functions 196 197 /***************************************************************************/ /** 198 * @brief 199 * Get the maximum Wi-Fi transmit power. 200 * @pre Pre-conditions: 201 * - 202 * @ref sl_wifi_init should be called before this API. 203 * @param[in] interface 204 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 205 * @param[out] max_tx_power 206 * A variable that contains current maximum transmit power as identified by by @ref sl_wifi_max_tx_power_t. 207 * @return 208 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 209 * @note 210 * This function gets the transmit power for a particular radio interface: SL_WIFI_2_4GHZ_INTERFACE. 211 ******************************************************************************/ 212 sl_status_t sl_wifi_get_max_tx_power(sl_wifi_interface_t interface, sl_wifi_max_tx_power_t *max_tx_power); 213 214 /***************************************************************************/ /** 215 * @brief 216 * Set the maximum Wi-Fi transmit power. 217 * @param[in] interface 218 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 219 * @param[in] max_tx_power 220 * Max transmission power as identified by @ref sl_wifi_max_tx_power_t 221 * @return 222 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 223 * @note 224 * This function sets the transmit power for a particular radio interface: SL_WIFI_2_4GHZ_INTERFACE. 225 * Eg: Setting transmit power for client interface at 2.4 GHz will also set transmit power of the AP interface at 2.4 GHz. 226 * @note 227 * The effective transmit power is subject to regional and device limitations. If the specified transmit power exceeds the 228 * maximum supported value for that region, the transmission will occur at the maximum supported transmit power. 229 ******************************************************************************/ 230 sl_status_t sl_wifi_set_max_tx_power(sl_wifi_interface_t interface, sl_wifi_max_tx_power_t max_tx_power); 231 232 /***************************************************************************/ /** 233 * @brief 234 * Set the Wi-Fi antenna for an interface. 235 * @pre Pre-conditions: 236 * - 237 * @ref sl_wifi_init should be called before this API. 238 * @param[in] interface 239 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 240 * @param[in] antenna 241 * Antenna to select as identified by @ref sl_wifi_antenna_t 242 * @return 243 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 244 ******************************************************************************/ 245 sl_status_t sl_wifi_set_antenna(sl_wifi_interface_t interface, sl_wifi_antenna_t antenna); 246 247 /***************************************************************************/ /** 248 * @brief 249 * Get the Wi-Fi antenna for an interface. 250 * @pre Pre-conditions: 251 * - 252 * @ref sl_wifi_init should be called before this API. 253 * @param[in] interface 254 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 255 * @param[out] antenna 256 * @ref sl_wifi_antenna_t object that contains current antenna selection. 257 * @return 258 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 259 ******************************************************************************/ 260 sl_status_t sl_wifi_get_antenna(sl_wifi_interface_t interface, sl_wifi_antenna_t *antenna); 261 262 /***************************************************************************/ /** 263 * @brief 264 * Get the current channel for the given Wi-Fi interface. 265 * @pre Pre-conditions: 266 * - 267 * @ref sl_wifi_init should be called before this API. 268 * @param[in] interface 269 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 270 * @param[out] channel 271 * @ref sl_wifi_channel_t object that contains current channel information. 272 * @return 273 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 274 ******************************************************************************/ 275 sl_status_t sl_wifi_get_channel(sl_wifi_interface_t interface, sl_wifi_channel_t *channel); 276 277 /***************************************************************************/ /** 278 * @brief 279 * Set the channel for the given Wi-Fi Access Point interface. 280 * @pre Pre-conditions: 281 * - 282 * @ref sl_wifi_init should be called before this API. 283 * @param[in] interface 284 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 285 * @param[in] channel 286 * Channel as identified by @ref sl_wifi_channel_t 287 * @return 288 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 289 ******************************************************************************/ 290 sl_status_t sl_wifi_set_channel(sl_wifi_interface_t interface, sl_wifi_channel_t channel); 291 292 /***************************************************************************/ /** 293 * @brief 294 * Set the Wi-Fi transmit rate for the given 802.11 protocol on the specified Wi-Fi interface. 295 * @pre Pre-conditions: 296 * - 297 * @ref sl_wifi_init should be called before this API. 298 * - 299 * In AP mode, this API should be called before sl_net_wifi_ap_up. This configured data rate will be passed as part of the AP configuration while bringing up the AP interface. 300 * - 301 * In Wi-Fi client mode, this API should be called after @ref sl_wifi_connect. 302 * @param[in] interface 303 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 304 * @param[in] rate_protocol 305 * 802.11 protocol as identified by @ref sl_wifi_rate_protocol_t 306 * @param[in] mask 307 * Data rate as identified by @ref sl_wifi_rate_t 308 * @return 309 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 310 * @note 311 * Only 1 and 2 Mbps rates are allowed in channel 14. 312 ******************************************************************************/ 313 sl_status_t sl_wifi_set_transmit_rate(sl_wifi_interface_t interface, 314 sl_wifi_rate_protocol_t rate_protocol, 315 sl_wifi_rate_t mask); 316 317 /***************************************************************************/ /** 318 * @brief 319 * Get the Wi-Fi transmit rate for the given 802.11 protocol on the specified Wi-Fi interface. 320 * @pre Pre-conditions: 321 * - 322 * @ref sl_wifi_init should be called before this API. 323 * @param[in] interface 324 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 325 * @param[out] rate_protocol 326 * 802.11 protocol as identified by @ref sl_wifi_rate_protocol_t 327 * @param[out] mask 328 * Data rate as identified by @ref sl_wifi_rate_t 329 * @return 330 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 331 ******************************************************************************/ 332 sl_status_t sl_wifi_get_transmit_rate(sl_wifi_interface_t interface, 333 sl_wifi_rate_protocol_t *rate_protocol, 334 sl_wifi_rate_t *mask); 335 336 /***************************************************************************/ /** 337 * @brief 338 * Set the Wi-Fi client interface listen interval. 339 * @pre Pre-conditions: 340 * - 341 * @ref sl_wifi_init should be called before this API. 342 * @param[in] interface 343 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 344 * @param[in] listen_interval 345 * @ref sl_wifi_listen_interval_t object 346 * @return 347 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 348 * @note 349 * By default listen interval is set 1000 millisecs. User can call this API to overwrite the value. 350 * Si91X implementation allows this API ONLY to be called before calling @ref sl_wifi_connect(), @ref sl_wifi_start_ap(), @ref sl_wifi_start_wps() 351 ******************************************************************************/ 352 sl_status_t sl_wifi_set_listen_interval(sl_wifi_interface_t interface, sl_wifi_listen_interval_t listen_interval); 353 354 /***************************************************************************/ /** 355 * @brief 356 * Get the Wi-Fi client listen interval. 357 * @pre Pre-conditions: 358 * - 359 * @ref sl_wifi_init should be called before this API. 360 * @param[in] interface 361 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 362 * @param[out] listen_interval 363 * @ref sl_wifi_listen_interval_t object that will contain the current listen interval. 364 * @return 365 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 366 * @note 367 * By default, the listen interval is set to 1000 millisecs. 368 ******************************************************************************/ 369 sl_status_t sl_wifi_get_listen_interval(sl_wifi_interface_t interface, sl_wifi_listen_interval_t *listen_interval); 370 371 /***************************************************************************/ /** 372 * @brief 373 * Assign the user configurable channel gain values in different regions to the module from user. 374 * @pre Pre-conditions: 375 * - 376 * This method is used for overwriting default gain tables that are present in firmware. 377 * @pre Pre-conditions: 378 * - 379 * Customer can load gain tables for 2.4 GHz-20 MHz. 380 * @pre Pre-conditions: 381 * - 382 * This is a blocking API. 383 * @pre Pre-conditions: 384 * - 385 * @ref sl_wifi_init should be called before this API. 386 * @param[in] band 387 * 1 - 2.4 GHz 388 * @param[in] bandwidth 389 * 0 - 20 MHz 390 * @param[in] payload 391 * Pass channel gain values for different regions in a given array format. 392 * @param[in] payload_len 393 * Max payload length (table size) in 2.4 GHz is 128 bytes. 394 * @return 395 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 396 * @note 397 * 1. This frame must be used only by customers who have done FCC/ETSI/TELEC/KCC certification with their own antenna. Silicon Labs is not liable for inappropriate usage of this frame that may result in violation of FCC/ETSI/TELEC/KCC or any certifications. 398 * 2. Internally, firmware maintains two tables: Worldwide table & Region-based table. Worldwide table is populated by the firmware with max power values that the chip can transmit and meet target specs like EVM. Region-based table has a default gain value set. 399 * 3. When certifying with user antenna, the Region has to be set to Worldwide and sweep the power from 0 to 21 dBm. Arrive at a max power level that will pass certifications, especially band-edge. 400 * 4. The FCC/ETSI/TELEC/KCC max power level should be loaded in an end-to-end mode via WLAN User Gain table. This has to be called done for every boot-up as this information is not saved inside the flash. Region-based user gain table sent by the application is copied onto the Region-based table. SoC uses this table in FCC/ETSI/TELEC/KCC to limit the power and to not violate the allowed limits. 401 * 5. For Worldwide region, the firmware uses the Worldwide table for Tx. For other regions (FCC/ETSI/TELEC/KCC), the firmware uses the min value out of the Worldwide & Region-based table for Tx. Also, there will be part to part variation across the chips. Offsets that are estimated during the flow of manufacture will be applied as correction factor during normal mode of operation. 402 * 6. In a 2.4 GHz band, 40 MHz is not supported. 403 * 7. Executing this API will overwrite calibration values in certified modules. 404 * 8. In FCC-certified modules, this API will trigger an error SL_STATUS_SI91X_FEATURE_NOT_AVAILABLE if used, except when in SL_SI91X_TRANSMIT_TEST_MODE mode. 405 ******************************************************************************/ 406 sl_status_t sl_wifi_update_gain_table(uint8_t band, uint8_t bandwidth, uint8_t *payload, uint16_t payload_len); 407 408 /***************************************************************************/ /** 409 * @brief 410 * Configure the 11ax params. This is a blocking API. 411 * @pre Pre-conditions: 412 * - 413 * This API should be called before @ref sl_wifi_connect 414 * @param[in] guard_interval 415 * Period of time delta between two packets in wireless transmission. Valid values : 0 - 3 (0 = 8 us, 1 = 16 us, 2 = 32 us, 3 = 64 us). 416 * @return 417 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 418 ******************************************************************************/ 419 sl_status_t sl_wifi_set_11ax_config(uint8_t guard_interval); 420 421 /** @} */ 422 423 /** \addtogroup WIFI_SCANNING_API Scanning 424 * \ingroup SL_WIFI_FUNCTIONS 425 * @{ */ 426 427 // Scanning functions 428 /***************************************************************************/ /** 429 * @brief 430 * Initiates a Wi-Fi scan operation on the specified interface, supporting advanced and background scan types. 431 * @pre Pre-conditions: 432 * - 433 * @ref sl_wifi_init should be called before this API. 434 * @param[in] interface 435 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 436 * @param[in] optional_ssid 437 * Optional SSID of type @ref sl_wifi_ssid_t can be used to scan for a particular Wi-Fi network 438 * @param[in] configuration 439 * @ref sl_wifi_scan_configuration_t 440 * @return 441 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 442 * @note 443 * For 911x, advanced scan results are not populated to user. 444 * Default Active Channel time is 100 milliseconds. If the user wants to modify the time, 445 * sl_wifi_set_advanced_scan_configuration can be called. If the scan_type is not ADV_SCAN, then 446 * the time is for foreground scan. Otherwise, it is used for background scanning. 447 * If the user wants to enable Passive Scanning, user should set the scan_type to SL_WIFI_SCAN_TYPE_PASSIVE. 448 * If the user wants to enable Low Power (LP) mode in Passive Scan, user should enable lp_mode in sl_wifi_scan_configuration_t. 449 * 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. 450 * 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. 451 * Default Passive Scan Channel time is 400 milliseconds. If the user wants to modify the time, sl_si91x_set_timeout can be called. 452 * In case of SL_WIFI_SCAN_TYPE_EXTENDED scan type, use @ref sl_wifi_get_stored_scan_results() API to get the scan results; after the scan status callback is received. 453 * This API is not applicable for ADV_SCAN scan_type in AP mode 454 * AP scan is supported - to trigger this, send a scan after sl_wifi_start_ap() API with the SL_WIFI_SCAN_TYPE_ACTIVE scan_type. 455 ******************************************************************************/ 456 sl_status_t sl_wifi_start_scan(sl_wifi_interface_t interface, 457 const sl_wifi_ssid_t *optional_ssid, 458 const sl_wifi_scan_configuration_t *configuration); 459 460 /***************************************************************************/ /** 461 * @brief 462 * Returns the stored scan results of a detailed scan in the user provided scan results array. 463 * @pre Pre-conditions: 464 * - 465 * @ref sl_wifi_init should be called before this API. 466 * @param[in] interface 467 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 468 * @param[in out] extended_scan_parameters 469 * A pointer to a structure of type @ref sl_wifi_extended_scan_result_parameters_t, where the scan results will be stored. 470 * @return 471 * sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details. 472 * @note 473 * This API will only hold scan results if sl_wifi_start_scan is called with scan type as SL_WIFI_SCAN_TYPE_EXTENDED. 474 * These results are stored until another call to sl_wifi_start_scan is made with scan type as SL_WIFI_SCAN_TYPE_EXTENDED. 475 ******************************************************************************/ 476 sl_status_t sl_wifi_get_stored_scan_results(sl_wifi_interface_t interface, 477 sl_wifi_extended_scan_result_parameters_t *extended_scan_parameters); 478 479 /***************************************************************************/ /** 480 * @brief 481 * Stops an ongoing Wi-Fi scan operation on the specified interface, including background scanning. 482 * @pre Pre-conditions: 483 * This API is applicable only for client interface. 484 * @ref sl_wifi_init should be called before this API. 485 * @param[in] interface 486 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 487 * @return 488 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 489 * @note 490 * For 911x, sl_wifi_stop_scan is ONLY supported for advanced scan. 491 ******************************************************************************/ 492 sl_status_t sl_wifi_stop_scan(sl_wifi_interface_t interface); 493 494 /***************************************************************************/ /** 495 * @brief 496 * Configures advanced scan settings for a Wi-Fi interface and enables instant scan capability. 497 * @details 498 * @ref sl_wifi_advanced_scan_configuration_t object that will contain the advanced scan configuration. 499 * @pre Pre-conditions: 500 * - 501 * @ref sl_wifi_init should be called before this API. 502 * @param[in] configuration 503 * Set advanced scan configuration as identified by @ref sl_wifi_advanced_scan_configuration_t 504 * @return 505 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 506 * @note 507 * Advance scan is not applicable in AP mode. 508 ******************************************************************************/ 509 sl_status_t sl_wifi_set_advanced_scan_configuration(const sl_wifi_advanced_scan_configuration_t *configuration); 510 511 /***************************************************************************/ /** 512 * @brief 513 * Retrieves the current advanced scan configuration parameters from the Wi-Fi interface. 514 * @details 515 * This function should be used after successful Wi-Fi connection. 516 * @pre Pre-conditions: 517 * - 518 * @ref sl_wifi_init should be called before this API. 519 * @param[out] configuration 520 * @ref sl_wifi_advanced_scan_configuration_t object that will contain the current advanced scan configuration. 521 * @return 522 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 523 ******************************************************************************/ 524 sl_status_t sl_wifi_get_advanced_scan_configuration(sl_wifi_advanced_scan_configuration_t *configuration); 525 526 /***************************************************************************/ /** 527 * @brief 528 * Wait for current scan to complete and store the results in the provided array. 529 * @pre Pre-conditions: 530 * - 531 * This function also returns when the scan result array is full. 532 * @pre Pre-conditions: 533 * - 534 * Once the scan result array is full, any further scan results will be lost. 535 * @param[in] scan_result_array 536 * Array of @ref sl_wifi_scan_result_t objects to store the scan results. 537 * @param[in] max_scan_result_count 538 * The maximum number of scan result objects that can fit in the scan result array. 539 * @return 540 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 541 * @note 542 * This API is not supported in the current release. 543 ******************************************************************************/ 544 sl_status_t sl_wifi_wait_for_scan_results(sl_wifi_scan_result_t **scan_result_array, uint32_t max_scan_result_count); 545 546 /** @} */ 547 548 /** \addtogroup WIFI_CLIENT_API Client 549 * \ingroup SL_WIFI_FUNCTIONS 550 * @{ */ 551 // Wi-Fi Client functions 552 553 /***************************************************************************/ /** 554 * @brief 555 * Connect to the given Wi-Fi AP. 556 * @pre Pre-conditions: 557 * - 558 * @ref sl_wifi_init should be called before this API. 559 * @param[in] interface 560 * Wi-Fi client interface as identified by @ref sl_wifi_interface_t 561 * @param[in] access_point 562 * @ref sl_wifi_client_configuration_t object that contains the Access Point details. 563 * @param[in] timeout_ms 564 * Timeout value in milliseconds. The function will abort and return when the timeout timer expires. 565 * A value of 0 indicates an asynchronous action. 566 * @return 567 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 568 * @note 569 * If channel, band, and BSSID are provided, this API will attempt to connect without scanning. 570 * If security_type is SL_WIFI_WPA3/SL_WIFI_WPA3_ENTERPRISE then SL_SI91X_JOIN_FEAT_MFP_CAPABLE_REQUIRED join feature is enabled internally by SDK. 571 * If security_type is SL_WIFI_WPA3_TRANSITION/SL_WIFI_WPA3_TRANSITION_ENTERPRISE 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. 572 * Default Active Channel time is 100 milliseconds. If the user wants to modify the time, sl_wifi_set_advanced_scan_configuration can be called. 573 * Default Authentication timeout and Association timeout is 300 milliseconds. If the user wants to modify the time, sl_wifi_set_advanced_client_configuration can be called. 574 * Default Keep Alive timeout is 30 milliseconds. If the user wants to modify the time, sl_wifi_set_advanced_client_configuration can be called. 575 * @note 576 * In FCC certified module the behavior is as follows 577 * 1. Region configuration is not supported and if triggered will return error SL_STATUS_SI91X_FEATURE_NOT_AVAILABLE. 578 * 2. STA mode channels 1 to 11 are actively scanned and 12,13,14 are passively scanned. 579 * 3. Concurrent mode supports only 1 to 11 channels. 580 ******************************************************************************/ 581 sl_status_t sl_wifi_connect(sl_wifi_interface_t interface, 582 const sl_wifi_client_configuration_t *access_point, 583 uint32_t timeout_ms); 584 585 /***************************************************************************/ /** 586 * @brief 587 * Disconnect the Wi-Fi client interface. 588 * @pre Pre-conditions: 589 * - 590 * @ref sl_wifi_connect should be called before this API. 591 * @param[in] interface 592 * Wi-Fi client interface as identified by @ref sl_wifi_interface_t 593 * @return 594 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 595 ******************************************************************************/ 596 sl_status_t sl_wifi_disconnect(sl_wifi_interface_t interface); 597 598 /***************************************************************************/ /** 599 * @brief 600 * Retrieve the RSSI value of the Access Point to which the Wi-Fi client is connected. 601 * @pre Pre-conditions: 602 * - 603 * @ref sl_wifi_connect should be called before this API. 604 * @param[in] interface 605 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 606 * @param[in] rssi 607 * signal strength (RSSI) in dBm. 608 * @return 609 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 610 ******************************************************************************/ 611 sl_status_t sl_wifi_get_signal_strength(sl_wifi_interface_t interface, int32_t *rssi); 612 613 /***************************************************************************/ /** 614 * @brief 615 * Get the station Timing Synchronization Function (TSF) time which is synchronised with connected AP beacon TSF. 616 * @pre 617 * Pre-condition: @ref sl_wifi_connect should be called before this API. 618 * @param[in] interface 619 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 620 * @param[out] tsf 621 * 64-bit TSF time in microseconds stored in @ref sl_wifi_tsf64_t structure. 622 * @return 623 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 624 * @note 625 * This API returns an error if the station is not connected to an Access Point or at least one beacon is not received. 626 ******************************************************************************/ 627 sl_status_t sl_wifi_get_sta_tsf(sl_wifi_interface_t interface, sl_wifi_tsf64_t *tsf); 628 629 /***************************************************************************/ /** 630 * @brief 631 * Set the Wi-Fi roaming configuration. 632 * @pre Pre-conditions: 633 * - 634 * @ref sl_wifi_set_advanced_scan_configuration should be called before this API. 635 * @param[in] interface 636 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 637 * @param[in] roam_configuration 638 * @ref sl_wifi_roam_configuration_t object to store Wi-Fi roaming configuration. 639 * @return 640 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 641 * @note 642 * For si91x chips, following ranges are valid: 643 * trigger_level: [-10, -100] , 644 * trigger_level_change: [0, 90] 645 ******************************************************************************/ 646 sl_status_t sl_wifi_set_roam_configuration(sl_wifi_interface_t interface, 647 sl_wifi_roam_configuration_t *roam_configuration); 648 649 /***************************************************************************/ /** 650 * @brief 651 * Get the Wi-Fi roaming configuration. 652 * @param[in] interface 653 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 654 * @param[out] roam_configuration 655 * @ref sl_wifi_roam_configuration_t object that will contain the current roam configuration. 656 * @return 657 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 658 * @note 659 * This API is not yet implemented. 660 ******************************************************************************/ 661 sl_status_t sl_wifi_get_roam_configuration(sl_wifi_interface_t interface, 662 sl_wifi_roam_configuration_t *roam_configuration); 663 664 /***************************************************************************/ /** 665 * @brief 666 * Verify the Wi-Fi client configuration is valid and available. 667 * @pre Pre-conditions: 668 * - 669 * @ref sl_wifi_init should be called before this API. 670 * @param[in] interface 671 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 672 * @param[in] ap 673 * @ref sl_wifi_client_configuration_t object that contains the details of Access Point. 674 * @param[in] timeout_ms 675 * Timeout value in milliseconds. The function will abort and return when the timeout timer expires. 676 * 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. 677 * @return 678 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 679 ******************************************************************************/ 680 sl_status_t sl_wifi_test_client_configuration(sl_wifi_interface_t interface, 681 const sl_wifi_client_configuration_t *ap, 682 uint32_t timeout_ms); 683 684 /***************************************************************************/ /** 685 * @brief 686 * Load the certificate into the device. 687 * @pre Pre-conditions: 688 * - 689 * @ref sl_wifi_init should be called before this API. 690 * @param[in] certificate_type 691 * Certificate type being set 692 * @param[in] buffer 693 * Pointer to buffer containing the certificate. 694 * @param[in] certificate_length 695 * Length of certificate buffer data. 696 * @return 697 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 698 ******************************************************************************/ 699 sl_status_t sl_wifi_set_certificate(uint8_t certificate_type, const uint8_t *buffer, uint32_t certificate_length); 700 701 /***************************************************************************/ /** 702 * @brief 703 * Load the certificate into the device. 704 * @pre Pre-conditions: 705 * - 706 * @ref sl_wifi_init should be called before this API. 707 * @param[in] certificate_type 708 * Certificate type being set. 709 * @param[in] certificate_index 710 * Certificate to be loaded in specified index. 711 * @param[in] buffer 712 * Pointer to buffer containing the certificate. 713 * @param[in] certificate_length 714 * Length of certificate buffer data. 715 * @return 716 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 717 ******************************************************************************/ 718 sl_status_t sl_wifi_set_certificate_with_index(uint8_t certificate_type, 719 uint8_t certificate_index, 720 uint8_t *buffer, 721 uint32_t certificate_length); 722 723 /***************************************************************************/ /** 724 * Set the advanced configuration options of a client interface. 725 * @pre Pre-conditions: 726 * - 727 * @ref sl_wifi_init should be called before this API. 728 * @param[in] interface 729 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 730 * @param[in] configuration 731 * Wi-Fi client advanced configuration. See @ref sl_wifi_advanced_client_configuration_t 732 * @return 733 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 734 ******************************************************************************/ 735 sl_status_t sl_wifi_set_advanced_client_configuration(sl_wifi_interface_t interface, 736 const sl_wifi_advanced_client_configuration_t *configuration); 737 738 /***************************************************************************/ /** 739 * @brief 740 * Send raw data frame. 741 * @pre Pre-conditions: 742 * - 743 * @ref sl_wifi_init should be called before this API. 744 * @param[in] interface 745 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 746 * @param[in] data 747 * Data buffer. 748 * @param[in] data_length 749 * length of the data. 750 * @return 751 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 752 ******************************************************************************/ 753 sl_status_t sl_wifi_send_raw_data_frame(sl_wifi_interface_t interface, const void *data, uint16_t data_length); 754 755 /***************************************************************************/ /** 756 * @brief 757 * Configure TWT parameters. Enables a TWT session. This is blocking API. 758 * @pre Pre-conditions: 759 * - 760 * @ref sl_wifi_connect should be called before this API. 761 * @param[in] twt_req 762 * Configurable TWT parameters specified in @ref sl_wifi_twt_request_t. 763 * @return 764 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 765 ******************************************************************************/ 766 sl_status_t sl_wifi_enable_target_wake_time(sl_wifi_twt_request_t *twt_req); 767 768 /***************************************************************************/ /** 769 * @brief 770 * Configure TWT parameters. Disables a TWT session. This is blocking API. 771 * @pre Pre-conditions: 772 * - 773 * @ref sl_wifi_enable_target_wake_time should be called before this API. 774 * @param[in] twt_req 775 * Configurable TWT parameters specified in @ref sl_wifi_twt_request_t. 776 * @return 777 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 778 ******************************************************************************/ 779 sl_status_t sl_wifi_disable_target_wake_time(sl_wifi_twt_request_t *twt_req); 780 781 /***************************************************************************/ /** 782 * @brief 783 * Calculates and configures TWT parameters based on the given inputs. Enables or disables a TWT session. This is blocking API. 784 * @pre Pre-conditions: 785 * - 786 * @ref sl_wifi_connect should be called before this API. 787 * @param[in] twt_selection_req 788 * @ref sl_wifi_twt_selection_t object containing configurable TWT selection parameters. 789 * @return 790 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 791 ******************************************************************************/ 792 sl_status_t sl_wifi_target_wake_time_auto_selection(sl_wifi_twt_selection_t *twt_selection_req); 793 794 /***************************************************************************/ /** 795 * @brief 796 * Suspends the TWT agreement corresponding to given flow id and resumes it when suspend duration expires. 797 * This API performs the following actions on TWT agreement: SL_WIFI_SUSPEND_INDEFINITELY, SL_WIFI_RESUME_IMMEDIATELY, SL_WIFI_SUSPEND_FOR_DURATION. 798 * @note 799 * The reschedule TWT actions are valid till the end of current TWT agreement. If the TWT agreement is terminated 800 * (TWT tear down or WLAN disconnection), these actions are not retained. 801 * To reapply these actions upon new TWT agreement, the user must re-issue the command. 802 * @pre Pre-conditions: 803 * - 804 * @ref sl_wifi_connect should be called before this API. 805 * @param[in] flow_id 806 * Flow id of the twt agreement. 807 * @param[in] twt_action 808 * @ref sl_wifi_reschedule_twt_action_t specifying different actions that can be taken in relation to rescheduling TWT. 809 * @param[in] suspend_duration 810 * Time interval until which twt agreement is suspended, value taken in milliseconds. 811 * ## The table below outlines the valid values for TWT actions and their corresponding suspend durations: 812 * | twt_action | Valid values for suspend duration | 813 * | -------------------- | --------------------------------- | 814 * | SL_WIFI_SUSPEND_INDEFINITELY | 0 | 815 * | SL_WIFI_RESUME_IMMEDIATELY | 0 | 816 * | SL_WIFI_SUSPEND_FOR_DURATION | 1 to 86400000 | 817 * @return 818 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 819 ******************************************************************************/ 820 sl_status_t sl_wifi_reschedule_twt(uint8_t flow_id, 821 sl_wifi_reschedule_twt_action_t twt_action, 822 uint64_t suspend_duration); 823 824 /***************************************************************************/ /** 825 * @brief 826 * Send Filter Broadcast Request frame. 827 * @pre Pre-conditions: 828 * - 829 * @ref sl_wifi_init should be called before this API. 830 * @param[in] beacon_drop_threshold 831 * The amount of time that FW waits to receive full beacon. Default value is 5000 ms. 832 * @param[in] filter_bcast_in_tim 833 * 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. 834 * @param[in] filter_bcast_tim_till_next_cmd 835 * 0 - filter_bcast_in_tim is valid till disconnect of the STA. 836 * 1 - filter_bcast_in_tim is valid till next update by giving the same command. 837 * @return 838 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 839 ******************************************************************************/ 840 sl_status_t sl_wifi_filter_broadcast(uint16_t beacon_drop_threshold, 841 uint8_t filter_bcast_in_tim, 842 uint8_t filter_bcast_tim_till_next_cmd); 843 844 /***************************************************************************/ /** 845 * @brief 846 * Generate PMK if PSK and SSID are provided. This is a blocking API. 847 * @pre Pre-conditions: 848 * - 849 * This API should be called after @ref sl_wifi_init and called before @ref sl_wifi_connect. 850 * @param[in] interface 851 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 852 * @param[in] type 853 * Possible values of this field are 1, 2, and 3, but we only pass 3 for generation of PMK. 854 * @param[in] ssid 855 * SSID of type @ref sl_wifi_ssid_t has the SSID of the access point 856 * @param[in] pre_shared_key 857 * Expected parameters are pre-shared key(PSK) of the access point 858 * @param[in] pairwise_master_key 859 * PMK array 860 * @return 861 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 862 ******************************************************************************/ 863 sl_status_t sl_wifi_get_pairwise_master_key(sl_wifi_interface_t interface, 864 const uint8_t type, 865 const sl_wifi_ssid_t *ssid, 866 const char *pre_shared_key, 867 uint8_t *pairwise_master_key); 868 869 /***************************************************************************/ /** 870 * @brief 871 * Configure multicast filter parameters. This is a blocking API. 872 * @pre Pre-conditions: 873 * - 874 * @ref sl_wifi_init should be called before this API. 875 * @param[in] multicast_filter_info 876 * Configurable multicast filter parameters specified in @ref sl_wifi_multicast_filter_info_t. 877 * @return 878 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 879 ******************************************************************************/ 880 sl_status_t sl_wifi_configure_multicast_filter(sl_wifi_multicast_filter_info_t *multicast_filter_info); 881 882 /** @} */ 883 884 /** \addtogroup WIFI_AP_API Access Point 885 * \ingroup SL_WIFI_FUNCTIONS 886 * @{ */ 887 // Access point functions 888 889 /***************************************************************************/ /** 890 * @brief 891 * Start a Wi-Fi access point (AP) interface. 892 * @pre Pre-conditions: 893 * - 894 * @ref sl_wifi_init should be called before this API. 895 * @param[in] interface 896 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 897 * @param[in] configuration 898 * Wi-Fi AP configuration. See @ref sl_wifi_ap_configuration_t 899 * @return 900 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 901 * @note 902 * For AP mode with WPA3 security, only SAE-H2E method is supported. SAE hunting and pecking method is not supported. 903 * TKIP encryption mode is not supported. Encryption mode is automatically configured to RSI_CCMP. 904 * PMKSA is not supported in WPA3 AP mode. 905 * @note 906 * In FCC-certified modules, 907 * 1. Region configuration is not supported and if triggered will return error SL_STATUS_SI91X_FEATURE_NOT_AVAILABLE. 908 * 2. AP supports only 1 to 11 channels. 909 * 3. AP will not advertise the Country IE. 910 ******************************************************************************/ 911 sl_status_t sl_wifi_start_ap(sl_wifi_interface_t interface, const sl_wifi_ap_configuration_t *configuration); 912 913 /***************************************************************************/ /** 914 * @brief 915 * Reconfigure the dynamic parameters of a Wi-Fi access point (AP) interface. 916 * @pre 917 * @ref sl_wifi_start_ap should be called before this API. 918 * @param[in] interface 919 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 920 * @param[in] config 921 * Wi-Fi AP dynamic configuration. See @ref sl_si91x_ap_reconfiguration_t 922 * @return 923 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 924 * @note 925 * The access point continues to transmit beacons when a client is connected, regardless of the beacon_stop configuration. 926 ******************************************************************************/ 927 sl_status_t sl_wifi_reconfigure_ap(sl_wifi_interface_t interface, sl_si91x_ap_reconfiguration_t config); 928 929 /***************************************************************************/ /** 930 * @brief 931 * Set the configuration of a running Wi-Fi access point (AP). 932 * If the new configuration modifies vital settings such as SSID or security, the AP will be stopped and restarted automatically. 933 * @param[in] interface 934 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 935 * @param[in] configuration 936 * Wi-Fi AP configuration. See @ref sl_wifi_ap_configuration_t 937 * @return 938 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 939 * @note 940 * This API is not yet implemented. 941 ******************************************************************************/ 942 sl_status_t sl_wifi_set_ap_configuration(sl_wifi_interface_t interface, 943 const sl_wifi_ap_configuration_t *configuration); 944 945 /***************************************************************************/ /** 946 * @brief 947 * Get the configuration of a Wi-Fi AP interface. 948 * @pre Pre-conditions: 949 * - 950 * @ref sl_wifi_init should be called before this API. 951 * @param[in] interface 952 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 953 * @param[out] configuration 954 * @ref sl_wifi_ap_configuration_t object that contains the AP configuration. 955 * @return 956 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 957 ******************************************************************************/ 958 sl_status_t sl_wifi_get_ap_configuration(sl_wifi_interface_t interface, sl_wifi_ap_configuration_t *configuration); 959 960 /***************************************************************************/ /** 961 * @brief 962 * Set the advanced configuration options of a running Wi-Fi access point (AP). 963 * @param[in] interface 964 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 965 * @param[in] configuration 966 * Wi-Fi AP advanced configuration. See @ref sl_wifi_advanced_ap_configuration_t 967 * @return 968 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 969 * @note 970 * This API is not yet implemented. 971 ******************************************************************************/ 972 sl_status_t sl_wifi_set_advanced_ap_configuration(sl_wifi_interface_t interface, 973 const sl_wifi_advanced_ap_configuration_t *configuration); 974 975 /***************************************************************************/ /** 976 * @brief 977 * Get the advanced configuration options of a running Wi-Fi access point interface. 978 * @param[in] interface 979 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 980 * @param[out] configuration 981 * @ref sl_wifi_advanced_ap_configuration_t object that will contain the AP advanced configuration. 982 * @return 983 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 984 * @note 985 * This API is not yet implemented. 986 ******************************************************************************/ 987 sl_status_t sl_wifi_get_advanced_ap_configuration(sl_wifi_interface_t interface, 988 const sl_wifi_advanced_ap_configuration_t *configuration); 989 990 /***************************************************************************/ /** 991 * @brief 992 * Stop Wi-Fi access point. 993 * @pre Pre-conditions: 994 * - 995 * @ref sl_wifi_start_ap should be called before this API. 996 * @param[in] interface 997 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 998 * @return 999 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1000 ******************************************************************************/ 1001 sl_status_t sl_wifi_stop_ap(sl_wifi_interface_t interface); 1002 1003 /***************************************************************************/ /** 1004 * @brief 1005 * Disconnects a client with the specified MAC address from Access Point (AP). 1006 * @details 1007 * Use this function to disassociate (disconnect) a client from Access Point. 1008 * This API is used when the device is in AP mode. 1009 * @pre Pre-conditions: 1010 * - 1011 * @ref sl_wifi_start_ap should be called before this API. 1012 * @param[in] interface 1013 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 1014 * @param[in] mac 1015 * Wi-Fi client's MAC address of type [sl_mac_address_t](../wiseconnect-api-reference-guide-nwk-mgmt/sl-net-types#sl-mac-address-t) 1016 * @param[in] reason 1017 * Reason for de-authentication as specified in @ref sl_wifi_deauth_reason_t 1018 * @return 1019 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1020 * @note 1021 * This API is supported only in AP mode. 1022 ******************************************************************************/ 1023 sl_status_t sl_wifi_disconnect_ap_client(sl_wifi_interface_t interface, 1024 const sl_mac_address_t *mac, 1025 sl_wifi_deauth_reason_t reason); 1026 1027 /***************************************************************************/ /** 1028 * @brief 1029 * Return the Wi-Fi client information of all clients connected to the AP. 1030 * @pre Pre-conditions: 1031 * - 1032 * @ref sl_wifi_start_ap should be called before this API. 1033 * @param[in] interface 1034 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 1035 * @param[out] client_info 1036 * @ref sl_wifi_client_info_response_t object to store the client info. 1037 * @return 1038 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1039 * @note 1040 * This API is supported only in AP mode. 1041 ******************************************************************************/ 1042 sl_status_t sl_wifi_get_ap_client_info(sl_wifi_interface_t interface, sl_wifi_client_info_response_t *client_info); 1043 1044 /***************************************************************************/ /** 1045 * @brief 1046 * Return a list of Wi-Fi clients connected to the Wi-Fi access point. 1047 * @pre Pre-conditions: 1048 * - 1049 * @ref sl_wifi_start_ap should be called before this API. 1050 * @param[in] interface 1051 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 1052 * @param[in] client_list_count 1053 * The number of [sl_mac_address_t](../wiseconnect-api-reference-guide-nwk-mgmt/sl-net-types#sl-mac-address-t) objects the client_list can store. 1054 * @param[out] client_list 1055 * A pointer to an array of client_list_count number of [sl_mac_address_t](../wiseconnect-api-reference-guide-nwk-mgmt/sl-net-types#sl-mac-address-t) objects where the client list will be copied to. 1056 * @return 1057 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1058 * @note 1059 * This API is supported only in AP mode. 1060 ******************************************************************************/ 1061 sl_status_t sl_wifi_get_ap_client_list(sl_wifi_interface_t interface, 1062 uint16_t client_list_count, 1063 sl_mac_address_t *client_list); 1064 1065 /***************************************************************************/ /** 1066 * @brief 1067 * Provide the number of Wi-Fi clients connected to the Wi-Fi access point 1068 * @pre Pre-conditions: 1069 * - 1070 * @ref sl_wifi_start_ap should be called before this API. 1071 * @param[in] interface 1072 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 1073 * @param[out] client_count 1074 * A uint32_t pointer that will store the number of associated clients. 1075 * @return 1076 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1077 * @note 1078 * This API is supported only in AP mode. 1079 ******************************************************************************/ 1080 sl_status_t sl_wifi_get_ap_client_count(sl_wifi_interface_t interface, uint32_t *client_count); 1081 1082 /** @} */ 1083 1084 /** \addtogroup WIFI_POWER_API Power and Performance 1085 * \ingroup SL_WIFI_FUNCTIONS 1086 * @{ */ 1087 // Power management functions 1088 1089 /***************************************************************************/ /** 1090 * @brief 1091 * Set Wi-Fi performance profile. 1092 * @pre Pre-conditions: 1093 * - 1094 * @ref sl_wifi_init should be called before this API. 1095 * @param[in] profile 1096 * Wi-Fi performance profile as indicated by [sl_wifi_performance_profile_t](../wiseconnect-api-reference-guide-si91x-driver/sl-wifi-performance-profile-t) 1097 * @return 1098 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1099 * @note 1100 * For SI91x chips Enhanced MAX PSP is supported when profile is set to ASSOCIATED_POWER_SAVE_LOW_LATENCY and SL_SI91X_ENABLE_ENHANCED_MAX_PSP bit is enabled in config feature bitmap 1101 * @note 1102 * For further more details on connected and non-connected mode please refer https://www.silabs.com/documents/public/application-notes/an1430-siwx917-soc-low-power.pdf. 1103 ******************************************************************************/ 1104 sl_status_t sl_wifi_set_performance_profile(const sl_wifi_performance_profile_t *profile); 1105 1106 /***************************************************************************/ /** 1107 * @brief 1108 * Get Wi-Fi performance profile. 1109 * @pre Pre-conditions: 1110 * - 1111 * @ref sl_wifi_init should be called before this API. 1112 * @param[out] profile 1113 * Wi-Fi performance profile as indicated by [sl_wifi_performance_profile_t](../wiseconnect-api-reference-guide-si91x-driver/sl-wifi-performance-profile-t) 1114 * @return 1115 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1116 ******************************************************************************/ 1117 sl_status_t sl_wifi_get_performance_profile(sl_wifi_performance_profile_t *profile); 1118 1119 /** @} */ 1120 1121 // "Monitor Mode" functions 1122 1123 /***************************************************************************/ /** 1124 * @brief 1125 * Enable monitor (promiscuous) mode on the Wi-Fi device. 1126 * In this mode, all types of Wi-Fi frames will be forwarded to the host. 1127 * @param[in] interface 1128 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1129 * @return 1130 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1131 * @note 1132 * This API is not yet implemented. 1133 ******************************************************************************/ 1134 sl_status_t sl_wifi_enable_monitor_mode(sl_wifi_interface_t interface); 1135 1136 /***************************************************************************/ /** 1137 * @brief 1138 * Disable monitor mode on the Wi-Fi interface. 1139 * @param[in] interface 1140 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1141 * @return 1142 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1143 * @note 1144 * This API is not yet implemented. 1145 ******************************************************************************/ 1146 sl_status_t sl_wifi_disable_monitor_mode(sl_wifi_interface_t interface); 1147 1148 // P2P functions 1149 1150 /***************************************************************************/ /** 1151 * @brief 1152 * Start Wi-Fi direct discovery. 1153 * @param[in] interface 1154 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1155 * @param[in] configuration 1156 * P2P configuration as identified by @ref sl_wifi_p2p_configuration_t 1157 * @param[in] credential_id 1158 * Credential ID as identified by @ref sl_wifi_credential_id_t 1159 * @return 1160 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1161 * @note 1162 * This API is not yet implemented. 1163 ******************************************************************************/ 1164 sl_status_t sl_wifi_start_p2p_discovery(sl_wifi_interface_t interface, 1165 const sl_wifi_p2p_configuration_t *configuration, 1166 sl_wifi_credential_id_t credential_id); 1167 1168 /***************************************************************************/ /** 1169 * @brief 1170 * Start Wi-Fi direct connection. 1171 * @param[in] interface 1172 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1173 * @param[in] configuration 1174 * P2P configuration as identified by @ref sl_wifi_p2p_configuration_t 1175 * @return 1176 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1177 * @note 1178 * This API is not yet implemented. 1179 ******************************************************************************/ 1180 sl_status_t sl_wifi_p2p_connect(sl_wifi_interface_t interface, const sl_wifi_p2p_configuration_t *configuration); 1181 1182 /** \addtogroup WIFI_WPS_API Wi-Fi Protected Setup 1183 * \ingroup SL_WIFI_FUNCTIONS 1184 * @{ */ 1185 // WPS functions 1186 1187 /***************************************************************************/ /** 1188 * @brief 1189 * Generate Wi-Fi Protected Setup (WPS) pin. 1190 * @pre Pre-conditions: 1191 * - 1192 * @ref sl_wifi_init should be called before this API. 1193 * @param[out] response 1194 * @ref sl_wifi_wps_pin_t object that will contain the WPS pin. 1195 * @return 1196 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1197 ******************************************************************************/ 1198 sl_status_t sl_wifi_generate_wps_pin(sl_wifi_wps_pin_t *response); 1199 1200 /***************************************************************************/ /** 1201 * @brief 1202 * Start Wi-Fi Protected Setup (WPS). 1203 * @pre Pre-conditions: 1204 * - 1205 * @ref sl_wifi_start_ap should be called before this API. 1206 * @param[in] interface 1207 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 1208 * @param[in] mode 1209 * WPS mode as identified by @ref sl_wifi_wps_mode_t 1210 * @param[in] optional_wps_pin 1211 * WPS pin object @ref sl_wifi_wps_pin_t when @ref SL_WIFI_WPS_PIN_MODE is used. 1212 * @return 1213 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1214 * @note 1215 * This API is supported only in AP mode. 1216 ******************************************************************************/ 1217 sl_status_t sl_wifi_start_wps(sl_wifi_interface_t interface, 1218 sl_wifi_wps_mode_t mode, 1219 const sl_wifi_wps_pin_t *optional_wps_pin); 1220 1221 /***************************************************************************/ /** 1222 * @brief 1223 * Stop current running Wi-Fi Protected Setup (WPS). 1224 * @pre Pre-conditions: 1225 * - 1226 * @ref sl_wifi_start_wps should be called before this API. 1227 * @param[in] interface 1228 * Wi-Fi Access Point interface as identified by @ref sl_wifi_interface_t 1229 * @return 1230 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1231 * @note 1232 * This API is supported only in AP mode. 1233 ******************************************************************************/ 1234 sl_status_t sl_wifi_stop_wps(sl_wifi_interface_t interface); 1235 1236 /** @} */ 1237 1238 /** \addtogroup WIFI_DEBUG_API Debugging 1239 * \ingroup SL_WIFI_FUNCTIONS 1240 * @{ */ 1241 1242 // Debug functions 1243 /***************************************************************************/ /** 1244 * @brief 1245 * Return Wi-Fi operational statistics. 1246 * @pre Pre-conditions: 1247 * - 1248 * @ref sl_wifi_init should be called before this API. 1249 * @param[in] interface 1250 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1251 * @param[out] statistics 1252 * @ref sl_wifi_statistics_t object that contains Wi-Fi statistics. 1253 * @return 1254 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1255 ******************************************************************************/ 1256 sl_status_t sl_wifi_get_statistics(sl_wifi_interface_t interface, sl_wifi_statistics_t *statistics); 1257 1258 /***************************************************************************/ /** 1259 * @brief 1260 * Return Wi-Fi operational statistics. 1261 * @pre Pre-conditions: 1262 * - 1263 * @ref sl_wifi_init should be called before this API. 1264 * @param[in] interface 1265 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1266 * @param[out] operational_statistics 1267 * @ref sl_wifi_operational_statistics_t object that contains Wi-Fi statistics. 1268 * @return 1269 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1270 ******************************************************************************/ 1271 sl_status_t sl_wifi_get_operational_statistics(sl_wifi_interface_t interface, 1272 sl_wifi_operational_statistics_t *operational_statistics); 1273 1274 /***************************************************************************/ /** 1275 * @brief 1276 * Start collecting statistical data. 1277 * @pre Pre-conditions: 1278 * - 1279 * @ref sl_wifi_init should be called before this API. 1280 * @param[in] interface 1281 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1282 * @param[in] channel 1283 * Provides the statistics report on the channel specified by @ref sl_wifi_channel_t. 1284 * @return 1285 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1286 ******************************************************************************/ 1287 sl_status_t sl_wifi_start_statistic_report(sl_wifi_interface_t interface, sl_wifi_channel_t channel); 1288 1289 /***************************************************************************/ /** 1290 * @brief 1291 * Stop collecting statistical data. 1292 * @pre Pre-conditions: 1293 * - 1294 * @ref sl_wifi_start_statistic_report should be called before this API. 1295 * @param[in] interface 1296 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1297 * @return 1298 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1299 ******************************************************************************/ 1300 sl_status_t sl_wifi_stop_statistic_report(sl_wifi_interface_t interface); 1301 1302 /** @} */ 1303 1304 /***************************************************************************/ /** 1305 * @brief 1306 * Return the status of the Wi-Fi device. 1307 * @param[out] wifi_status 1308 * @ref sl_wifi_status_t object that will contain the Wi-Fi status. 1309 * @return 1310 * sl_status_t. See https://docs.silabs.com/gecko-platform/latest/platform-common/status for details. 1311 * @note 1312 * This API is not yet implemented. 1313 ******************************************************************************/ 1314 sl_status_t sl_wifi_get_status(sl_wifi_status_t *wifi_status); 1315 1316 /** \addtogroup WIFI_TRANSCEIVER_API Wi-Fi Transceiver 1317 * \ingroup SL_WIFI_FUNCTIONS 1318 * @{ */ 1319 // Wi-Fi Transceiver functions 1320 /***************************************************************************/ /** 1321 * @brief 1322 * Start a Wi-Fi Transceiver interface. 1323 * @pre Pre-conditions: 1324 * - @ref sl_wifi_init shall be called before this API. 1325 * @param[in] interface 1326 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1327 * @param[in] config 1328 * Wi-Fi Transceiver configuration. See @ref sl_wifi_transceiver_configuration_t 1329 * @return 1330 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1331 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1332 * - `0x21` - SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE 1333 * - `0x22` - SL_STATUS_NULL_POINTER 1334 * - `0x0B65` - SL_STATUS_TRANSCEIVER_INVALID_CHANNEL 1335 * - `0x0B67` - SL_STATUS_TRANSCEIVER_INVALID_CONFIG 1336 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1337 * @note `sl_wifi_transceiver_up` internally calls @ref sl_wifi_set_transceiver_parameters and @ref sl_wifi_transceiver_set_channel. Additionally, DUT MAC address is queried using @ref sl_wifi_get_mac_address and used as Addr2 for TX data packets. 1338 ******************************************************************************/ 1339 sl_status_t sl_wifi_transceiver_up(sl_wifi_interface_t interface, sl_wifi_transceiver_configuration_t *config); 1340 1341 /***************************************************************************/ /** 1342 * @brief Configure channel from the host. 1343 * 1344 * @pre Pre-conditions: 1345 * - @ref sl_wifi_init shall be called before this API. 1346 * 1347 * @param[in] interface 1348 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1349 * @param[in] channel 1350 * Application shall decide the channel at which device operates and transmits frames. See @ref sl_wifi_transceiver_set_channel_t. 1351 * | Param | Description 1352 * |:-----------------------|:----------------------------------------------------------- 1353 * |channel | Primary channel number. Valid channels are 1-14. 1354 * |band | Reserved 1355 * |bandwidth | Reserved 1356 * |tx_power | Max transmission power 1357 * 1358 * @return 1359 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1360 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1361 * - `0x21` - SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE 1362 * - `0x0B65` - SL_STATUS_TRANSCEIVER_INVALID_CHANNEL 1363 * 1364 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1365 * @note This is a blocking API. 1366 * @note The effective transmit power is subject to regional and device limitations. If the specified transmit power exceeds the maximum supported value for that region, the transmission will occur at the maximum supported transmit power. 1367 * 1368 * Sample command usage: 1369 * @code 1370 * // Initialize channel 1371 * sl_wifi_transceiver_set_channel_t channel = { 1372 * .chan_info.channel = 14, 1373 * }; 1374 * 1375 * // Set channel 1376 * sl_wifi_transceiver_set_channel(SL_WIFI_TRANSCEIVER_INTERFACE, channel); 1377 * @endcode 1378 * 1379 ******************************************************************************/ 1380 sl_status_t sl_wifi_transceiver_set_channel(sl_wifi_interface_t interface, sl_wifi_transceiver_set_channel_t channel); 1381 1382 /***************************************************************************/ /** 1383 * @brief This API shall be used to configure the CWmin, CWmax, and AIFSN per access category and retransmit count. 1384 * 1385 * @pre Pre-conditions: 1386 * - @ref sl_wifi_init shall be called before this API. 1387 * 1388 * @param[in] interface 1389 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1390 * 1391 * @param[in] params 1392 * Transceiver parameters as identified by @ref sl_wifi_transceiver_parameters_t. Shall be used to set/get the contention parameters per access category and the retransmit count in MAC layer. 1393 * 1394 * @return 1395 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1396 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1397 * - `0x21` - SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE 1398 * - `0x22` - SL_STATUS_NULL_POINTER 1399 * - `0x0B67` - SL_STATUS_TRANSCEIVER_INVALID_CONFIG 1400 * 1401 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1402 * @note Set is allowed only once before the first call to sl_wifi_transceiver_set_channel API. 1403 * @note This API is optional. Default configurations are used if API is not called. 1404 * @note This is a blocking API. 1405 * 1406 * Sample command usage: 1407 * @code 1408 * // Initialize parameters 1409 * sl_wifi_transceiver_parameters_t params = { 1410 * .set = 1, 1411 * .retransmit_count = 15, 1412 * .cw_params[0].aifsn = 3, 1413 * }; 1414 * 1415 * // Set parameters 1416 * sl_wifi_set_transceiver_parameters(SL_WIFI_TRANSCEIVER_INTERFACE, ¶ms); 1417 * @endcode 1418 ******************************************************************************/ 1419 sl_status_t sl_wifi_set_transceiver_parameters(sl_wifi_interface_t interface, sl_wifi_transceiver_parameters_t *params); 1420 1421 /***************************************************************************/ /** 1422 * @brief When new peer is added or deleted from the network, application shall call this API to update peer information to the MAC layer. 1423 * 1424 * @pre Pre-conditions: 1425 * - @ref sl_wifi_transceiver_set_channel shall be called before this API. 1426 * 1427 * @param[in] interface 1428 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1429 * @param[in] peer 1430 * Peer to be added/deleted in MAC layer. See @ref sl_wifi_transceiver_peer_update_t. 1431 * 1432 * @return 1433 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1434 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1435 * - `0x0B44` - SL_STATUS_WIFI_INTERFACE_NOT_UP 1436 * - `0x0B63` - SL_STATUS_TRANSCEIVER_INVALID_MAC_ADDRESS 1437 * - `0x0B66` - SL_STATUS_TRANSCEIVER_INVALID_DATA_RATE 1438 * - `0x10096` - SL_STATUS_SI91X_TRANSCEIVER_PEER_DS_FEAT_DISABLED 1439 * - `0x10097` - SL_STATUS_SI91X_TRANSCEIVER_PEER_ALREADY_EXISTS 1440 * - `0x10098` - SL_STATUS_SI91X_TRANSCEIVER_MAX_PEER_LIMIT_REACHED 1441 * - `0x10099` - SL_STATUS_SI91X_TRANSCEIVER_PEER_NOT_FOUND 1442 * 1443 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1444 * @note This is a blocking API. 1445 * @note MAC layer supports storing up to 100 peers. 1446 * @note To add peers in MAC layer, it is mandatory to enable SL_SI91X_FEAT_TRANSCEIVER_MAC_PEER_DS_SUPPORT/BIT(13) in [sl_wifi_device_configuration_t](../wiseconnect-api-reference-guide-si91x-driver/sl-wifi-device-configuration-t) feature_bit_map passed in @ref sl_wifi_init. 1447 * 1448 * Sample command usage: 1449 * @code 1450 * // Initialize peer 1451 * sl_wifi_transceiver_peer_update_t peer; 1452 * uint8_t peer_mac[6] = {0x00, 0x23, 0xa7, 0x20, 0x21, 0x24}; 1453 * memcpy(peer.peer_mac_address, peer_mac, 6); 1454 * peer.peer_supported_rate_bitmap = PEER_DS_BITMAP_DATA_RATE_48 | PEER_DS_BITMAP_DATA_RATE_54; 1455 * peer.flags |= BIT(0)); // Set bit 0 to add peer 1456 * 1457 * // Add peer 1458 * sl_wifi_update_transceiver_peer_list(SL_WIFI_TRANSCEIVER_INTERFACE, peer); 1459 * @endcode 1460 ******************************************************************************/ 1461 sl_status_t sl_wifi_update_transceiver_peer_list(sl_wifi_interface_t interface, sl_wifi_transceiver_peer_update_t peer); 1462 1463 /***************************************************************************/ /** 1464 * @brief This API configures the multicast MAC address to filter Rx multicast packets. 1465 * 1466 * @pre Pre-conditions: 1467 * - @ref sl_wifi_transceiver_set_channel shall be called before this API. 1468 * 1469 * @param[in] interface 1470 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1471 * @param[in] mcast 1472 * Multicast MAC address to be added/deleted from MAC layer for filtering. See @ref sl_wifi_transceiver_mcast_filter_t. 1473 * 1474 * @return 1475 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1476 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1477 * - `0x21` - SL_STATUS_INVALID_PARAMETER 1478 * - `0x0B44` - SL_STATUS_WIFI_INTERFACE_NOT_UP 1479 * - `0x0B63` - SL_STATUS_TRANSCEIVER_INVALID_MAC_ADDRESS 1480 * 1481 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1482 * @note This API can be called dynamically. 1483 * @note Maximum of two multicast MAC addresses can be configured for filtering. 1484 * 1485 * Sample command usage: 1486 * @code 1487 * // Initialize multicast filter address structure 1488 * sl_wifi_transceiver_mcast_filter_t mcast; 1489 * uint8_t filter_mac[6] = { 0x01, 0x00, 0x5e, 0x00, 0x01, 0x01 }; 1490 * mcast.flags |= BIT(0); 1491 * mcast.num_of_mcast_addr = 1; 1492 * memcpy(mcast.mac[0], filter_mac, 6); 1493 * 1494 * // Add MAC address to be filtered 1495 * sl_wifi_set_transceiver_multicast_filter(SL_WIFI_TRANSCEIVER_INTERFACE, mcast); 1496 * @endcode 1497 ******************************************************************************/ 1498 sl_status_t sl_wifi_set_transceiver_multicast_filter(sl_wifi_interface_t interface, 1499 sl_wifi_transceiver_mcast_filter_t mcast); 1500 1501 /***************************************************************************/ /** 1502 * @brief This API shall flush the entire software buffer pool. 1503 * 1504 * @pre Pre-conditions: 1505 * - @ref sl_wifi_transceiver_set_channel shall be called before this API. 1506 * 1507 * @param[in] interface 1508 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1509 * 1510 * @return 1511 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1512 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1513 * - `0x0B44` - SL_STATUS_WIFI_INTERFACE_NOT_UP 1514 * 1515 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1516 * @note All priority queues shall be flushed. 1517 * 1518 * Sample command usage: 1519 * @code 1520 * sl_wifi_flush_transceiver_data(SL_WIFI_TRANSCEIVER_INTERFACE); 1521 * @endcode 1522 ******************************************************************************/ 1523 sl_status_t sl_wifi_flush_transceiver_data(sl_wifi_interface_t interface); 1524 1525 /***************************************************************************/ /** 1526 * @brief Host shall call this API to encapsulate the data with 802.11 MAC header and send it to MAC layer. 1527 * 1528 * @pre Pre-conditions: 1529 * - @ref sl_wifi_transceiver_set_channel shall be called before this API. 1530 * 1531 * @param[in] interface 1532 * Wi-Fi interface as identified by @ref sl_wifi_interface_t 1533 * 1534 * @param[in] control 1535 * API uses metadata for preparing data packet along with MAC header for sending to MAC layer. See @ref sl_wifi_transceiver_tx_data_control_t. 1536 * @param[in] payload 1537 * Pointer to payload (encrypted by host) to be sent to LMAC. 1538 * @param[in] payload_len 1539 * Length of the payload. Valid range is 1 - 2020 bytes. 1540 * 1541 * @return 1542 * sl_status_t. See [Status Codes](../../wiseconnect-api-reference-guide-err-codes/pages/sl-additional-status-errors). Possible Error Codes: 1543 * - `0x11` - SL_STATUS_NOT_INITIALIZED 1544 * - `0x0B44` - SL_STATUS_WIFI_INTERFACE_NOT_UP 1545 * - `0x0B63` - SL_STATUS_TRANSCEIVER_INVALID_MAC_ADDRESS 1546 * - `0x0B64` - SL_STATUS_TRANSCEIVER_INVALID_QOS_PRIORITY 1547 * - `0x0B66` - SL_STATUS_TRANSCEIVER_INVALID_DATA_RATE 1548 * - `0x21` - SL_STATUS_INVALID_PARAMETER 1549 * - `0x22` - SL_STATUS_NULL_POINTER 1550 * 1551 * #### Format of encapsulated data sent to MAC #### 1552 * | Field name | Frame Control | Duration | Addr1 | Addr2 | Adddr3 | Seq Ctrl | Addr4 | QoS ctrl | Payload (LLC + Data) | 1553 * |:-----------|:---------------|:---------|:------|:------|:-------|:---------|:-----------------------|:----------------------|:----------------------| 1554 * | Size(bytes)| 2 | 2 | 6 | 6 | 6 | 2 | 6 (Optionally present) | 2 (Optionally present)| Variable | 1555 * 1556 * @note This API is only supported in Wi-Fi Transceiver opermode (7). 1557 * @note Once sl_wifi_send_transceiver_data() returns, the calling API is responsible for freeing control and payload. The calling API refers to the function that invoked sl_wifi_send_transceiver_data(). 1558 * @note On chip MAC level encryption is not supported in transceiver mode. 1559 * @note This is not a blocking API. Callback SL_WIFI_TRANSCEIVER_TX_DATA_STATUS_CB can be registered to get the status report from firmware. 1560 * @note Only 11b/g rates shall be supported. 1561 * @note It is recommended to use basic rate for multicast/broadcast packets. 1562 * @note Sample command usage: 1563 * @code 1564 * // Prepare payload 1565 * <Prepare data payload in "payload" buffer> 1566 * <Initialize data control block @ref sl_wifi_transceiver_tx_data_control_t > 1567 * control->ctrl_flags = BIT(0) | BIT(1) | BIT(2) | BIT(5); // Enable 4-addr MAC hdr, QoS frame, Fixed data rate, send status report for data packet 1568 * control->priority = 2; // Voice priority queue 1569 * control->rate = SL_WIFI_DATA_RATE_36; 1570 * control->token = token; 1571 * <Fill control addr1, addr2, addr3 and addr4(optionally) with 6 byte RA, NWP, DA and SA MAC addresses respectively> 1572 * 1573 * // Call API to encapsulate the data with 802.11 MAC header and send it to MAC layer. 1574 * sl_wifi_send_transceiver_data(SL_WIFI_TRANSCEIVER_INTERFACE, control, payload, payload_len); 1575 * @endcode 1576 ******************************************************************************/ 1577 sl_status_t sl_wifi_send_transceiver_data(sl_wifi_interface_t interface, 1578 sl_wifi_transceiver_tx_data_control_t *control, 1579 uint8_t *payload, 1580 uint16_t payload_len); 1581 /** @} */ 1582 1583 /** 1584 * @brief Refreshes the Access Point (AP) client information. 1585 * 1586 * This function fetches the current client details for the specified 1587 * AP interface and updates the internal client information structure sl_wifi_client_info_t for all connected clients. 1588 * 1589 * @return sl_status_t 1590 * - SL_STATUS_OK if the operation is successful. 1591 * - Appropriate error code otherwise. 1592 */ 1593 sl_status_t sli_si91x_update_ap_client_info(); 1594 1595 /** 1596 * @brief Retrieve the IP address of an AP client using its MAC address. 1597 * 1598 * This function searches through the list of connected clients and returns the IP address 1599 * of the client that matches the provided MAC address. 1600 * 1601 * @param[in] mac_add The MAC address of the client whose IP address is to be retrieved. 1602 * 1603 * @return A pointer to the IP address of the client if found, otherwise NULL. 1604 */ 1605 sl_ip_address_t *sli_si91x_get_ap_client_ip_address_from_mac_address(const sl_mac_address_t mac_add);