From a571bc0d0a8b282221f89277dcdccbd1467c5e92 Mon Sep 17 00:00:00 2001 From: ronghulin Date: Mon, 7 Sep 2020 11:43:04 +0800 Subject: [PATCH] bugfix: fix some wifi bugs 1. add sta connect again ap sent disconnect event 2. add set/get inactive time api 3. fix connect hidden AP doesn't update information 4. add rf test long short support --- components/esp32/include/esp_wifi.h | 33 +++++++++++++++++++++++++++++ components/esp32/lib | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index e82c05911..f920c57bc 100644 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -1111,6 +1111,39 @@ esp_err_t esp_wifi_set_ant(const wifi_ant_config_t *config); */ esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config); +/** + * @brief Set the inactive time of the ESP32 STA or AP + * + * @attention 1. For Station, If the station does not receive a beacon frame from the connected SoftAP during the inactive time, + * disconnect from SoftAP. Default 6s. + * @attention 2. For SoftAP, If the softAP doesn't receive any data from the connected STA during inactive time, + * the softAP will force deauth the STA. Default is 300s. + * @attention 3. The inactive time configuration is not stored into flash + * + * @param ifx interface to be configured. + * @param sec Inactive time. Unit seconds. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start + * - ESP_ERR_WIFI_ARG: invalid argument, For Station, if sec is less than 3. For SoftAP, if sec is less than 10. + */ +esp_err_t esp_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec); + +/** + * @brief Get inactive time of specified interface + * + * @param ifx Interface to be configured. + * @param sec Inactive time. Unit seconds. + * + * @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_get_inactive_time(wifi_interface_t ifx, uint16_t *sec); + #ifdef __cplusplus } #endif diff --git a/components/esp32/lib b/components/esp32/lib index d376d65d8..aa15b130d 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit d376d65d84f363418db58d8a78545b73ffb91de7 +Subproject commit aa15b130d5162c16a76f3a23dc6d985bd1447e8d