From 6a080febbca9741a2f1ad0a6bab996e578a76263 Mon Sep 17 00:00:00 2001 From: Liu Zhi Fu Date: Sun, 26 Aug 2018 12:38:06 +0800 Subject: [PATCH] esp32: update wifi lib to fix several WiFi bugs Fix following WiFi bugs: 1. Shouldn't scan when connect 2. Check beacon length in modem sleep 3. Fix the bug that AP may deauth wrong station when inactivity timer expires 4. Fix the bug that WiFi assert the system when receiving empty MCS in association response frame --- components/esp32/include/esp_wifi.h | 9 ++++++++- components/esp32/lib | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/esp32/include/esp_wifi.h b/components/esp32/include/esp_wifi.h index d4c11c387..04b999803 100644 --- a/components/esp32/include/esp_wifi.h +++ b/components/esp32/include/esp_wifi.h @@ -303,7 +303,13 @@ esp_err_t esp_wifi_restore(void); * * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode * @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect. - * + * @attention 3. The scanning triggered by esp_wifi_start_scan() will not be effective until connection between ESP32 and the AP is established. + * If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error + * number ESP_ERR_WIFI_STATE. + * If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called + * scan will not work. This is especially true when the AP doesn't exist, and you still try reconnection after ESP32 received disconnect + * event with the reason code WIFI_REASON_NO_AP_FOUND. + * * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init @@ -366,6 +372,7 @@ esp_err_t esp_wifi_deauth_sta(uint16_t aid); * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start * - ESP_ERR_WIFI_TIMEOUT: blocking scan is timeout + * - ESP_ERR_WIFI_STATE: wifi still connecting when invoke esp_wifi_scan_start * - others: refer to error code in esp_err.h */ esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, bool block); diff --git a/components/esp32/lib b/components/esp32/lib index 3a57e7198..2cb4ce3da 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 3a57e719887cfa3f72abc27e7d3102800cd7eb65 +Subproject commit 2cb4ce3da5abf2ed51a1aa79b119625b02e521a2