Merge branch 'bugfix/fix_some_wifi_bugs_0427_v4.0' into 'release/v4.0'

Bugfix/fix some wifi bugs 0427 (v4.0)

See merge request espressif/esp-idf!8571
This commit is contained in:
Jiang Jiang Jian 2020-05-27 14:45:04 +08:00
commit 20c34cac2d
4 changed files with 12 additions and 4 deletions

View File

@ -115,7 +115,7 @@ typedef struct {
} wifi_active_scan_time_t; } wifi_active_scan_time_t;
/** @brief Aggregate of active & passive scan time per channel */ /** @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. */ 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 uint32_t passive; /**< passive scan time per channel, units: millisecond, values above 1500ms may
cause station to disconnect from AP and are not recommended. */ cause station to disconnect from AP and are not recommended. */

@ -1 +1 @@
Subproject commit f95cd7c239868c09a023eb36cf7fde3940e0ca22 Subproject commit 97348f88d4ab3fe5c4b153cc078d4799bac838a2

View File

@ -11,6 +11,12 @@ menu "Example Configuration"
default "mypassword" default "mypassword"
help help
WiFi password (WPA or WPA2) for the example to use. 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 config ESP_MAX_STA_CONN
int "Maximal STA connections" int "Maximal STA connections"

View File

@ -25,6 +25,7 @@
*/ */
#define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID #define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID
#define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD #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 #define EXAMPLE_MAX_STA_CONN CONFIG_ESP_MAX_STA_CONN
static const char *TAG = "wifi softAP"; static const char *TAG = "wifi softAP";
@ -57,6 +58,7 @@ void wifi_init_softap()
.ap = { .ap = {
.ssid = EXAMPLE_ESP_WIFI_SSID, .ssid = EXAMPLE_ESP_WIFI_SSID,
.ssid_len = strlen(EXAMPLE_ESP_WIFI_SSID), .ssid_len = strlen(EXAMPLE_ESP_WIFI_SSID),
.channel = EXAMPLE_ESP_WIFI_CHANNEL,
.password = EXAMPLE_ESP_WIFI_PASS, .password = EXAMPLE_ESP_WIFI_PASS,
.max_connection = EXAMPLE_MAX_STA_CONN, .max_connection = EXAMPLE_MAX_STA_CONN,
.authmode = WIFI_AUTH_WPA_WPA2_PSK .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_set_config(ESP_IF_WIFI_AP, &wifi_config));
ESP_ERROR_CHECK(esp_wifi_start()); ESP_ERROR_CHECK(esp_wifi_start());
ESP_LOGI(TAG, "wifi_init_softap finished. SSID:%s password:%s", ESP_LOGI(TAG, "wifi_init_softap finished. SSID:%s password:%s channel:%d",
EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS, EXAMPLE_ESP_WIFI_CHANNEL);
} }
void app_main() void app_main()