From ddc242738572eaa22cb01e0775bd73b4406ffc79 Mon Sep 17 00:00:00 2001 From: xiehang Date: Fri, 17 Apr 2020 17:31:46 +0800 Subject: [PATCH 1/2] esp_wifi:Add softap example channel configuration --- examples/wifi/getting_started/softAP/main/Kconfig.projbuild | 6 ++++++ .../wifi/getting_started/softAP/main/softap_example_main.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/wifi/getting_started/softAP/main/Kconfig.projbuild b/examples/wifi/getting_started/softAP/main/Kconfig.projbuild index 378290502..19e9f86e0 100644 --- a/examples/wifi/getting_started/softAP/main/Kconfig.projbuild +++ b/examples/wifi/getting_started/softAP/main/Kconfig.projbuild @@ -11,6 +11,12 @@ menu "Example Configuration" default "mypassword" help WiFi password (WPA or WPA2) for the example to use. + config ESP_WIFI_CHANNEL + int "WiFi Channel" + range 1 13 + default 1 + help + WiFi channel (network channel) for the example to use. config ESP_MAX_STA_CONN int "Maximal STA connections" diff --git a/examples/wifi/getting_started/softAP/main/softap_example_main.c b/examples/wifi/getting_started/softAP/main/softap_example_main.c index 010289554..ca6d0933d 100644 --- a/examples/wifi/getting_started/softAP/main/softap_example_main.c +++ b/examples/wifi/getting_started/softAP/main/softap_example_main.c @@ -25,6 +25,7 @@ */ #define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID #define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD +#define EXAMPLE_ESP_WIFI_CHANNEL CONFIG_ESP_WIFI_CHANNEL #define EXAMPLE_MAX_STA_CONN CONFIG_ESP_MAX_STA_CONN static const char *TAG = "wifi softAP"; @@ -57,6 +58,7 @@ void wifi_init_softap() .ap = { .ssid = EXAMPLE_ESP_WIFI_SSID, .ssid_len = strlen(EXAMPLE_ESP_WIFI_SSID), + .channel = EXAMPLE_ESP_WIFI_CHANNEL, .password = EXAMPLE_ESP_WIFI_PASS, .max_connection = EXAMPLE_MAX_STA_CONN, .authmode = WIFI_AUTH_WPA_WPA2_PSK @@ -70,8 +72,8 @@ void wifi_init_softap() ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config)); ESP_ERROR_CHECK(esp_wifi_start()); - ESP_LOGI(TAG, "wifi_init_softap finished. SSID:%s password:%s", - EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); + ESP_LOGI(TAG, "wifi_init_softap finished. SSID:%s password:%s channel:%d", + EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS, EXAMPLE_ESP_WIFI_CHANNEL); } void app_main() From e430860df348d3ee36aacbe441d06b4999f98602 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 20 May 2020 18:13:07 +0800 Subject: [PATCH 2/2] wifi changes: 1. fix the bug for softAP update second channel wrong 2. change wifi_scan_time_t from union to struct 3. query country code wrong when policy change from manual to auto 4. fix the timeout issue of EAPOL four-way handshake 5. fix the crash issue when fetch peer after delete the cur_peer --- components/esp_wifi/include/esp_wifi_types.h | 2 +- components/esp_wifi/lib_esp32 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index d194265f1..035a435a7 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -115,7 +115,7 @@ typedef struct { } wifi_active_scan_time_t; /** @brief Aggregate of active & passive scan time per channel */ -typedef union { +typedef struct { wifi_active_scan_time_t active; /**< active scan time per channel, units: millisecond. */ uint32_t passive; /**< passive scan time per channel, units: millisecond, values above 1500ms may cause station to disconnect from AP and are not recommended. */ diff --git a/components/esp_wifi/lib_esp32 b/components/esp_wifi/lib_esp32 index f95cd7c23..97348f88d 160000 --- a/components/esp_wifi/lib_esp32 +++ b/components/esp_wifi/lib_esp32 @@ -1 +1 @@ -Subproject commit f95cd7c239868c09a023eb36cf7fde3940e0ca22 +Subproject commit 97348f88d4ab3fe5c4b153cc078d4799bac838a2