From 05695f7cba49609750c7f105db5d9469f84e0057 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 6 Jul 2023 14:35:56 +0800 Subject: [PATCH 1/4] feat(wifi): Add API to get RSSI info after station connects to AP - Add esp_wifi_sta_get_rssi() function to retrieve RSSI info after station connects to AP --- components/esp_wifi/include/esp_wifi.h | 33 +++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index bc3cddf615..119b8b3334 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -1,17 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - +/* + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /* Notes about WiFi Programming * @@ -1325,6 +1316,20 @@ esp_err_t esp_wifi_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t ra */ esp_err_t esp_wifi_disable_pmf_config(wifi_interface_t ifx); +/** + * @brief Get the rssi info after station connected to AP + * + * @attention This API should be called after station connected to AP. + * + * @param rssi store the rssi info received from last beacon. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_FAIL: failed + */ +esp_err_t esp_wifi_sta_get_rssi(int *rssi); + #ifdef __cplusplus } #endif From 5bce0abff8f9a354e0cf434b924a195716f88892 Mon Sep 17 00:00:00 2001 From: david zuhn Date: Mon, 5 Sep 2022 16:08:14 -0500 Subject: [PATCH 2/4] spelling correction in documentation Signed-off-by: zhangyanjiao Closes https://github.com/espressif/esp-idf/pull/9721 --- components/esp_wifi/include/esp_wifi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 119b8b3334..67e434c18b 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -617,7 +617,7 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); * it's up to the user to fill in all fields according to local regulations. * Please use esp_wifi_set_country_code instead. * @attention 2. The default country is CHINA {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}. - * @attention 3. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 3. The third octet of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} @@ -1265,7 +1265,7 @@ esp_err_t esp_wifi_set_connectionless_wake_interval(uint16_t interval); * * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. * @attention 8. The default country is "CN" and ieee80211d_enabled is TRUE. - * @attention 9. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 9. The third octet of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * * @param country the configured country ISO code * @param ieee80211d_enabled 802.11d is enabled or not From 7358881dd44bfe48ddde3ced14b4615a073f4939 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Thu, 20 Oct 2022 00:44:45 +0200 Subject: [PATCH 3/4] doc: remove WEP as security mode Signed-off-by: zhangyanjiao Closes https://github.com/espressif/esp-idf/pull/10015 --- docs/en/api-reference/network/esp_wifi.rst | 2 +- docs/zh_CN/api-reference/network/esp_wifi.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/api-reference/network/esp_wifi.rst b/docs/en/api-reference/network/esp_wifi.rst index 15c33ddc6f..174ff0995b 100644 --- a/docs/en/api-reference/network/esp_wifi.rst +++ b/docs/en/api-reference/network/esp_wifi.rst @@ -12,7 +12,7 @@ The Wi-Fi libraries provide support for configuring and monitoring the {IDF_TARG - AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the {IDF_TARGET_NAME}. - Combined AP-STA mode ({IDF_TARGET_NAME} is concurrently an access point and a station connected to another access point). -- Various security modes for the above (WPA, WPA2, WEP, etc.) +- Various security modes for the above (WPA2, WPA3, etc.) - Scanning for access points (active & passive scanning). - Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets. diff --git a/docs/zh_CN/api-reference/network/esp_wifi.rst b/docs/zh_CN/api-reference/network/esp_wifi.rst index 36df726bcb..2cc66f307d 100644 --- a/docs/zh_CN/api-reference/network/esp_wifi.rst +++ b/docs/zh_CN/api-reference/network/esp_wifi.rst @@ -14,7 +14,7 @@ Wi-Fi 库支持配置及监控 {IDF_TARGET_NAME} Wi-Fi 连网功能。 - AP 模式(即 Soft-AP 模式或接入点模式),此时基站连接到 {IDF_TARGET_NAME}。 - AP-STA 共存模式({IDF_TARGET_NAME} 既是接入点,同时又作为基站连接到另外一个接入点)。 -- 上述模式的各种安全模式(WPA、WPA2 及 WEP 等)。 +- 上述模式的各种安全模式(WPA2、WPA3 等)。 - 扫描接入点(包括主动扫描及被动扫描)。 - 使用混杂模式监控 IEEE802.11 Wi-Fi 数据包。 From 2ab431b060d1e4ee6d6a668ca66b55356f986ffe Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Fri, 26 May 2023 17:24:18 +0800 Subject: [PATCH 4/4] fix(wifi): Add bugfixes and improvements 1. Update wifi security mode 2. Add check for memory allocation in tx buffers 3. Fix association refused temporarily comeback time set to zero issue 4. Vnd ie callback can be set to null 5. Check the second channel info when bandwidth is ht40 6. Fix softap qos null issue 7. Fix the mac bug that hardware parse beacon of ie length equal to zero 8. Remove waiting RX/TXING during hw mac deinit --- components/esp_wifi/lib | 2 +- docs/en/api-reference/network/esp_wifi.rst | 2 +- docs/zh_CN/api-reference/network/esp_wifi.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index b98ee49967..f19cccdb30 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit b98ee4996781f14b000384703468270a02a70384 +Subproject commit f19cccdb30feafb49501c03852b96073ef3b87da diff --git a/docs/en/api-reference/network/esp_wifi.rst b/docs/en/api-reference/network/esp_wifi.rst index 174ff0995b..da95963afe 100644 --- a/docs/en/api-reference/network/esp_wifi.rst +++ b/docs/en/api-reference/network/esp_wifi.rst @@ -12,7 +12,7 @@ The Wi-Fi libraries provide support for configuring and monitoring the {IDF_TARG - AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the {IDF_TARGET_NAME}. - Combined AP-STA mode ({IDF_TARGET_NAME} is concurrently an access point and a station connected to another access point). -- Various security modes for the above (WPA2, WPA3, etc.) +- Various security modes for the above (WPA, WPA2, WPA3, etc.) - Scanning for access points (active & passive scanning). - Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets. diff --git a/docs/zh_CN/api-reference/network/esp_wifi.rst b/docs/zh_CN/api-reference/network/esp_wifi.rst index 2cc66f307d..13572514dd 100644 --- a/docs/zh_CN/api-reference/network/esp_wifi.rst +++ b/docs/zh_CN/api-reference/network/esp_wifi.rst @@ -14,7 +14,7 @@ Wi-Fi 库支持配置及监控 {IDF_TARGET_NAME} Wi-Fi 连网功能。 - AP 模式(即 Soft-AP 模式或接入点模式),此时基站连接到 {IDF_TARGET_NAME}。 - AP-STA 共存模式({IDF_TARGET_NAME} 既是接入点,同时又作为基站连接到另外一个接入点)。 -- 上述模式的各种安全模式(WPA2、WPA3 等)。 +- 上述模式的各种安全模式(WPA、WPA2、WPA3 等)。 - 扫描接入点(包括主动扫描及被动扫描)。 - 使用混杂模式监控 IEEE802.11 Wi-Fi 数据包。