From 0e24eacc81d6e923e09a1b31f5cebb79517da8dd Mon Sep 17 00:00:00 2001 From: ronghulin Date: Tue, 14 Jul 2020 15:15:00 +0800 Subject: [PATCH 1/2] bugfix: fix softap mode event issue 1. add sta connect again ap sent disconnect event 2. add set/get inactive time api Closes https://github.com/espressif/esp-idf/issues/4401 Closes https://github.com/espressif/esp-idf/issues/4987 Closes https://github.com/espressif/esp-idf/issues/2375 --- components/esp_wifi/include/esp_wifi.h | 33 ++++++++++++++++++++++++++ components/esp_wifi/lib | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 2f3f77bf5c..4b2f2656bb 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -1106,6 +1106,39 @@ esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config); */ int64_t esp_wifi_get_tsf_time(wifi_interface_t interface); +/** + * @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/esp_wifi/lib b/components/esp_wifi/lib index 1dc481e59a..f6ca306461 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 1dc481e59a8099299b6b1c60b14fe3672f13a0a9 +Subproject commit f6ca3064619741f4fdd8297021318421c3e88f20 From a57fb727e7906a9a28d53fd6e6eb68d510cbb6a7 Mon Sep 17 00:00:00 2001 From: ChenJianxing Date: Wed, 12 Aug 2020 21:59:37 +0800 Subject: [PATCH 2/2] esp_wifi: backport some wifi fix to v4.2 1.Fix WiFi fragment issue 2.fix the bug for softAP power save buffer issue 3.fix softap mode event issue 4.fix connect hidden AP doesn't update information 5.update esp32 phy v4370 --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index f6ca306461..c934be7c20 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit f6ca3064619741f4fdd8297021318421c3e88f20 +Subproject commit c934be7c20279db86e825fd44f7bc7eef9929ac1