From 93e77a4df6843f14c4962d38559a843acd71a47b Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Fri, 25 Oct 2024 14:58:18 +0800 Subject: [PATCH 1/2] fix(wifi): modify bandwidth in wifi_ap_record_t --- .../esp_wifi/include/esp_wifi_types_generic.h | 30 +++++++++---------- components/esp_wifi/lib | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index 6d13536347..832ce0cfb6 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -269,6 +269,19 @@ typedef enum { WIFI_CIPHER_TYPE_UNKNOWN, /**< The cipher type is unknown */ } wifi_cipher_type_t; +/** + * @brief Wi-Fi bandwidth type + */ +typedef enum { + WIFI_BW_HT20 = 1, /**< Bandwidth is HT20 */ + WIFI_BW20 = WIFI_BW_HT20, /**< Bandwidth is 20 MHz */ + WIFI_BW_HT40 = 2, /**< Bandwidth is HT40 */ + WIFI_BW40 = WIFI_BW_HT40, /**< Bandwidth is 40 MHz */ + WIFI_BW80 = 3, /**< Bandwidth is 80 MHz */ + WIFI_BW160 = 4, /**< Bandwidth is 160 MHz */ + WIFI_BW80_BW80 = 5, /**< Bandwidth is 80 + 80 MHz */ +} wifi_bandwidth_t; + /** * @brief Wi-Fi antenna */ @@ -314,9 +327,7 @@ typedef struct { uint32_t reserved: 22; /**< Bit: 10..31 reserved */ wifi_country_t country; /**< Country information of AP */ wifi_he_ap_info_t he_ap; /**< HE AP info */ - uint8_t bandwidth; /**< For either 20 MHz or 40 MHz operation, the channel width field is set to 0. - For AP 80 MHz, this value is set to 1. For AP 160 MHz, this value is set to 2. - For AP 80 + 80 MHz, this value is set to 3.*/ + wifi_bandwidth_t bandwidth; /**< Bandwidth of AP */ uint8_t vht_ch_freq1; /**< This fields are used only AP bandwidth is 80 and 160 MHz, to transmit the center channel frequency of the BSS. For AP bandwidth is 80 + 80 MHz, it is the center channel frequency of the lower frequency segment.*/ @@ -458,19 +469,6 @@ typedef struct { uint16_t ghz_5g; /**< Represents 5 GHz protocol, support 802.11a or 802.11n or 802.11ac or 802.11ax */ } wifi_protocols_t; -/** - * @brief Wi-Fi bandwidth type - */ -typedef enum { - WIFI_BW_HT20 = 1, /**< Bandwidth is HT20 */ - WIFI_BW20 = WIFI_BW_HT20, /**< Bandwidth is 20 MHz */ - WIFI_BW_HT40 = 2, /**< Bandwidth is HT40 */ - WIFI_BW40 = WIFI_BW_HT40, /**< Bandwidth is 40 MHz */ - WIFI_BW80 = 3, /**< Bandwidth is 80 MHz */ - WIFI_BW160 = 4, /**< Bandwidth is 160 MHz */ - WIFI_BW80_BW80 = 5, /**< Bandwidth is 80 + 80 MHz */ -} wifi_bandwidth_t; - /** * @brief Description of a Wi-Fi band bandwidths */ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 110a486f37..a663beed1a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 110a486f374d2d0e5c417bd0c7df86ce9a1a664b +Subproject commit a663beed1a9ef3a316e8502268c14e053db108e1 From 403d44ae6822a0e68913e83f249ac6227fb1a531 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 30 Oct 2024 19:57:43 +0800 Subject: [PATCH 2/2] docs(wifi): add migration guide for types change in wifi --- .../release-5.x/5.4/index.rst | 1 + .../migration-guides/release-5.x/5.4/wifi.rst | 22 +++++++++++++++++ .../release-5.x/5.4/index.rst | 1 + .../migration-guides/release-5.x/5.4/wifi.rst | 24 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 docs/en/migration-guides/release-5.x/5.4/wifi.rst create mode 100644 docs/zh_CN/migration-guides/release-5.x/5.4/wifi.rst diff --git a/docs/en/migration-guides/release-5.x/5.4/index.rst b/docs/en/migration-guides/release-5.x/5.4/index.rst index 08ce135e44..f6b85cb5e7 100644 --- a/docs/en/migration-guides/release-5.x/5.4/index.rst +++ b/docs/en/migration-guides/release-5.x/5.4/index.rst @@ -10,3 +10,4 @@ Migration from 5.3 to 5.4 system bluetooth-classic storage + wifi diff --git a/docs/en/migration-guides/release-5.x/5.4/wifi.rst b/docs/en/migration-guides/release-5.x/5.4/wifi.rst new file mode 100644 index 0000000000..ddcc2c49f1 --- /dev/null +++ b/docs/en/migration-guides/release-5.x/5.4/wifi.rst @@ -0,0 +1,22 @@ +Wi-Fi +====== + +:link_to_translation:`zh_CN:[中文]` + + +Wi-Fi Scan and Connect +------------------------ + + The following types have been modified: + + - :component_file:`esp_wifi/include/esp_wifi_he_types.h` + + - :cpp:struct:`esp_wifi_htc_omc_t`: + + - ``uph_id``, ``ul_pw_headroom``, ``min_tx_pw_flag`` are deprecated. + + - :component_file:`esp_wifi/include/esp_wifi_types_generic.h` + + - :cpp:struct:`wifi_ap_record_t`: + + - The type of ``bandwidth`` has been changed from ``uint8_t`` to ``wifi_bandwidth_t`` diff --git a/docs/zh_CN/migration-guides/release-5.x/5.4/index.rst b/docs/zh_CN/migration-guides/release-5.x/5.4/index.rst index 5d15a086f3..e2256533e9 100644 --- a/docs/zh_CN/migration-guides/release-5.x/5.4/index.rst +++ b/docs/zh_CN/migration-guides/release-5.x/5.4/index.rst @@ -10,3 +10,4 @@ system bluetooth-classic storage + wifi diff --git a/docs/zh_CN/migration-guides/release-5.x/5.4/wifi.rst b/docs/zh_CN/migration-guides/release-5.x/5.4/wifi.rst new file mode 100644 index 0000000000..ed9be5db8d --- /dev/null +++ b/docs/zh_CN/migration-guides/release-5.x/5.4/wifi.rst @@ -0,0 +1,24 @@ +Wi-Fi +===== + +:link_to_translation:`en:[English]` + + +Wi-Fi 扫描和连接 +------------------------ + + 以下类型已被更改: + - :component_file:`esp_wifi/include/esp_wifi_he_types.h` + + - :cpp:struct:`esp_wifi_htc_omc_t` 中: + + - ``uph_id``, ``ul_pw_headroom``, ``min_tx_pw_flag`` 字段被弃用 + + - :component_file:`esp_wifi/include/esp_wifi_types_generic.h` + + - :cpp:struct:`wifi_ap_record_t` 中: + + - ``bandwidth`` 的类型从 ``uint8_t`` 更改为 ``wifi_bandwidth_t`` + + +