From 100d2dd938d1188ea23baddf77737c66072da5c5 Mon Sep 17 00:00:00 2001 From: XiaXiaotian Date: Wed, 26 Apr 2017 11:45:30 +0800 Subject: [PATCH] optimize scan before station connecting to AP 1. Store the information of AP(ssid, password, bssid, channel, etc) into nvs when station connects to AP successfully. If station connects to the same AP next time, it will scan the stored channel of the AP first. 2. Add a parameter of channel for scanning before connecting to AP. If it is set to 1~13, station will scan starting from the channel. If the channel of AP is unknown, set it to 0. --- components/esp32/include/esp_wifi_types.h | 1 + components/esp32/lib | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp32/include/esp_wifi_types.h b/components/esp32/include/esp_wifi_types.h index a473d3b04d..1ab6a464fd 100755 --- a/components/esp32/include/esp_wifi_types.h +++ b/components/esp32/include/esp_wifi_types.h @@ -164,6 +164,7 @@ typedef struct { uint8_t password[64]; /**< password of target AP*/ bool bssid_set; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/ uint8_t bssid[6]; /**< MAC address of target AP*/ + uint8_t channel; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/ } wifi_sta_config_t; typedef union { diff --git a/components/esp32/lib b/components/esp32/lib index 53aac75afe..fd7893d22a 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 53aac75afe219af9feca42aca7f1126d394844c9 +Subproject commit fd7893d22ae4d43488c950583db7125c37b5ba80