From 414b8437557836f47f281f990b9771710701d6f9 Mon Sep 17 00:00:00 2001 From: xiehang Date: Tue, 10 Mar 2020 20:01:39 +0800 Subject: [PATCH] esp_wifi: Update WiFi lib 1,Fix sniffer bug caused by mode switch 2,Reduce WiFi bin size 3,Add TX packets size check 4,Fix scan get rssi error 5,Add wifi stop check at WiFi deinit entry 6,Return fail when setting AP's channel is out of range 7,Fix the bug for setting channel when WiFi in NULL mode --- components/esp32/esp_adapter.c | 1 + components/esp32/include/esp_wifi_os_adapter.h | 1 + components/esp32/include/esp_wifi_types.h | 2 +- components/esp32/lib | 2 +- .../idf_test/integration_test/TC_IT_WIFI_CONN.yml | 2 +- components/log/include/esp_log.h | 9 +++++++++ components/log/log.c | 14 +++++++++++--- 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/components/esp32/esp_adapter.c b/components/esp32/esp_adapter.c index 3da0d7e18..18c4b0181 100644 --- a/components/esp32/esp_adapter.c +++ b/components/esp32/esp_adapter.c @@ -584,6 +584,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = { ._get_time = get_time_wrapper, ._random = os_random, ._log_write = esp_log_write, + ._log_writev = esp_log_writev, ._log_timestamp = esp_log_timestamp, ._malloc_internal = malloc_internal_wrapper, ._realloc_internal = realloc_internal_wrapper, diff --git a/components/esp32/include/esp_wifi_os_adapter.h b/components/esp32/include/esp_wifi_os_adapter.h index 89778661a..666c44d92 100644 --- a/components/esp32/include/esp_wifi_os_adapter.h +++ b/components/esp32/include/esp_wifi_os_adapter.h @@ -105,6 +105,7 @@ typedef struct { int32_t (* _get_time)(void *t); unsigned long (* _random)(void); void (* _log_write)(uint32_t level, const char* tag, const char* format, ...); + void (* _log_writev)(uint32_t level, const char* tag, const char* format, va_list args); uint32_t (* _log_timestamp)(void); void * (* _malloc_internal)(size_t size); void * (* _realloc_internal)(void *ptr, size_t size); diff --git a/components/esp32/include/esp_wifi_types.h b/components/esp32/include/esp_wifi_types.h index 3f6eccde0..2f50da3c5 100644 --- a/components/esp32/include/esp_wifi_types.h +++ b/components/esp32/include/esp_wifi_types.h @@ -214,7 +214,7 @@ typedef struct { uint8_t channel; /**< Channel of ESP32 soft-AP */ wifi_auth_mode_t authmode; /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */ uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */ - uint8_t max_connection; /**< Max number of stations allowed to connect in, default 4, max 4 */ + uint8_t max_connection; /**< Max number of stations allowed to connect in, default 4, max 10 */ uint16_t beacon_interval; /**< Beacon interval, 100 ~ 60000 ms, default 100 ms */ } wifi_ap_config_t; diff --git a/components/esp32/lib b/components/esp32/lib index 369f45ebc..3b3791807 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 369f45ebc7224544cd6729ea7e38c76b1a518163 +Subproject commit 3b3791807d8cff8cf2d149b300fe5e7fe03e0df2 diff --git a/components/idf_test/integration_test/TC_IT_WIFI_CONN.yml b/components/idf_test/integration_test/TC_IT_WIFI_CONN.yml index 1054be23c..ec0edb142 100644 --- a/components/idf_test/integration_test/TC_IT_WIFI_CONN.yml +++ b/components/idf_test/integration_test/TC_IT_WIFI_CONN.yml @@ -78,7 +78,7 @@ test cases: - - SSC SSC2 sta -C -s - - R SSC2 RE "\+JAP:CONNECTED,%%s"%%() - - SSC SSC1 ap -S -s -n 15 - - - R SSC1 C +SAP:OK + - - R SSC1 C +SAP:ERROR - - SSC SSC2 sta -C -s - - R SSC2 RE "\+JAP:CONNECTED,%%s"%%() - - SSC SSC2 sta -D diff --git a/components/log/include/esp_log.h b/components/log/include/esp_log.h index e57aabbdd..8616c5610 100644 --- a/components/log/include/esp_log.h +++ b/components/log/include/esp_log.h @@ -108,6 +108,15 @@ void esp_log_write(esp_log_level_t level, const char* tag, const char* format, . /** @cond */ +/** + * @brief Write message into the log, va_list variant + * @see esp_log_write() + * + * This function is provided to ease integration toward other logging framework, + * so that esp_log can be used as a log sink. + */ +void esp_log_writev(esp_log_level_t level, const char* tag, const char* format, va_list args); + #include "esp_log_internal.h" #ifndef LOG_LOCAL_LEVEL diff --git a/components/log/log.c b/components/log/log.c index 28bd89d80..429a5ae21 100644 --- a/components/log/log.c +++ b/components/log/log.c @@ -184,9 +184,10 @@ void clear_log_level_list() #endif } -void IRAM_ATTR esp_log_write(esp_log_level_t level, +void IRAM_ATTR esp_log_writev(esp_log_level_t level, const char* tag, - const char* format, ...) + const char* format, + va_list args) { if (!s_log_mutex) { s_log_mutex = xSemaphoreCreateMutex(); @@ -210,9 +211,16 @@ void IRAM_ATTR esp_log_write(esp_log_level_t level, return; } + (*s_log_print_func)(format, args); +} + +void esp_log_write(esp_log_level_t level, + const char *tag, + const char *format, ...) +{ va_list list; va_start(list, format); - (*s_log_print_func)(format, list); + esp_log_writev(level, tag, format, list); va_end(list); }