From dc33626566513c1de779d9a9de9fb5a79fed8336 Mon Sep 17 00:00:00 2001 From: aditi_lonkar Date: Wed, 29 Mar 2023 13:16:30 +0530 Subject: [PATCH] esp_wifi: Add APIs to get Assoc id and negotiated phymode. --- components/esp_wifi/include/esp_wifi.h | 23 ++++++++++++++++++++ components/esp_wifi/include/esp_wifi_types.h | 13 +++++++++++ components/esp_wifi/lib | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index ab138a9692..974bf84b1d 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -1318,6 +1318,29 @@ 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 Association id assigned to STA by AP + * + * @param[out] aid store the aid + * + * @attention aid = 0 if station is not connected to AP. + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_sta_get_aid(uint16_t *aid); + +/** + * @brief Get the negotiated phymode after connection. + * + * @param[out] phymode store the negotiated phymode. + * + * @attention Operation phy mode, BIT[5]: indicate whether LR enabled, BIT[0-4]: wifi_phy_mode_t + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); #ifdef __cplusplus } #endif diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index 76fce94225..9b13cdbc6c 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -350,6 +350,19 @@ typedef enum { #define WIFI_VENDOR_IE_ELEMENT_ID 0xDD +/** + * @brief Operation Phymode + */ +typedef enum +{ + WIFI_PHY_MODE_LR, /**< PHY mode for Low Rate */ + WIFI_PHY_MODE_11B, /**< PHY mode for 11b */ + WIFI_PHY_MODE_11G, /**< PHY mode for 11g */ + WIFI_PHY_MODE_HT20, /**< PHY mode for Bandwidth HT20 */ + WIFI_PHY_MODE_HT40, /**< PHY mode for Bandwidth HT40 */ + WIFI_PHY_MODE_HE20, /**< PHY mode for Bandwidth HE20 */ +} wifi_phy_mode_t; + /** * @brief Vendor Information Element header * diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 5680c099ed..4f8af817cd 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 5680c099eda60a8f05accbfd6f7e5fe582cfefb7 +Subproject commit 4f8af817cd2a56c6fda8b3430c45d0579d1653fa