feat(wifi): add 11kv roaming support

This commit is contained in:
Zhang Jun Hao
2020-08-27 10:55:51 +08:00
parent c528739394
commit 6cf4b3de83
40 changed files with 5089 additions and 125 deletions

View File

@ -992,6 +992,33 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
*/
wifi_state_t esp_wifi_get_state(void);
/**
* @brief Set RSSI threshold below which APP will get an event
*
* @attention This API needs to be called every time after WIFI_EVENT_STA_BSS_RSSI_LOW event is received.
*
* @param rssi threshold value in dbm between -100 to 0
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
* - ESP_ERR_WIFI_ARG: invalid argument
*/
esp_err_t esp_wifi_set_rssi_threshold(int32_t rssi);
/**
* @brief Get the TSF time
* In Station mode or SoftAP+Station mode if station is not connected or station doesn't receive at least
* one beacon after connected, will return 0
*
* @attention Enabling power save may cause the return value inaccurate, except WiFi modem sleep
*
* @param interface The interface whose tsf_time is to be retrieved.
*
* @return 0 or the TSF time
*/
int64_t esp_wifi_get_tsf_time(wifi_interface_t interface);
#ifdef __cplusplus
}
#endif

View File

@ -272,6 +272,9 @@ typedef struct {
wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */
wifi_fast_scan_threshold_t threshold; /**< When scan_method is set to WIFI_FAST_SCAN, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */
wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame. Will be advertized in RSN Capabilities in RSN IE. */
uint32_t rm_enabled:1; /**< Whether radio measurements are enabled for the connection */
uint32_t btm_enabled:1; /**< Whether BTM is enabled for the connection */
uint32_t reserved:30; /**< Reserved for future feature set */
} wifi_sta_config_t;
/** @brief Configuration data for ESP8266 AP or STA.
@ -481,6 +484,7 @@ typedef enum {
WIFI_EVENT_STA_CONNECTED, /**< station connected to AP */
WIFI_EVENT_STA_DISCONNECTED, /**< station disconnected from AP */
WIFI_EVENT_STA_AUTHMODE_CHANGE, /**< the auth mode of AP connected by station changed */
WIFI_EVENT_STA_BSS_RSSI_LOW, /**< AP's RSSI crossed configured threshold */
WIFI_EVENT_STA_WPS_ER_SUCCESS, /**< station wps succeeds in enrollee mode */
WIFI_EVENT_STA_WPS_ER_FAILED, /**< station wps fails in enrollee mode */
WIFI_EVENT_STA_WPS_ER_TIMEOUT, /**< station wps timeout in enrollee mode */
@ -556,6 +560,11 @@ typedef struct {
uint8_t reason; /**< reason of disconnection */
} wifi_event_sta_disconnected_t;
/** Argument structure for WIFI_EVENT_STA_BSS_RSSI_LOW event */
typedef struct {
int32_t rssi; /**< RSSI value of bss */
} wifi_event_bss_rssi_low_t;
#ifdef __cplusplus
}
#endif