diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 787ec9d9b3..9152c68d27 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -730,8 +730,8 @@ esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap); /** * @brief Set the bandwidth of specified interface * - * @attention 1. WIFI_BW_HT40 is supported only when the interface support 11N - * @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW_HT20. + * @attention 1. WIFI_BW40 is supported only when the interface support 11N + * @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW20. * @attention 3. Can not set WiFi bandwidth under band mode 2.4G + 5G (WIFI_BAND_MODE_AUTO), you can use esp_wifi_set_bandwidths instead * @attention 4. API return ESP_ERR_NOT_SUPPORTED if the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) * @@ -1092,6 +1092,9 @@ typedef void (*esp_vendor_ie_cb_t)(void *ctx, wifi_vendor_ie_type_t type, const * @param vnd_ie Pointer to vendor specific element data. First 6 bytes should be a header with fields matching vendor_ie_data_t. * If enable is false, this argument is ignored and can be NULL. Data does not need to remain valid after the function returns. * + * @attention If user set the same vendor ie twice, the second set will fail and return ESP_ERR_INVALID_ARG. + * Please clear the vendor ie before setting again. + * * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init() @@ -1737,8 +1740,8 @@ esp_err_t esp_wifi_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protoco /** * @brief Set the bandwidth of specified interface and specified band * - * @attention 1. WIFI_BW_HT40 is supported only when the interface support 11N - * @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW_HT20. + * @attention 1. WIFI_BW40 is supported only when the interface support 11N + * @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW20. * @attention 3. When the WiFi band mode is set to 2.4G only, it will not set 5G bandwidth * @attention 4. When the WiFi band mode is set to 5G only, it will not set 2.4G bandwidth * diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index f5694c19cf..784fb4ed2c 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -276,10 +276,8 @@ typedef enum { * @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_BW20 = 1, /**< Bandwidth is 20 MHz */ + WIFI_BW40 = 2, /**< 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 */ @@ -532,7 +530,7 @@ typedef struct { wifi_cipher_type_t pairwise_cipher; /**< Pairwise cipher of SoftAP, group cipher will be derived using this. Cipher values are valid starting from WIFI_CIPHER_TYPE_TKIP, enum values before that will be considered as invalid and default cipher suites(TKIP+CCMP) will be used. Valid cipher suites in softAP mode are WIFI_CIPHER_TYPE_TKIP, WIFI_CIPHER_TYPE_CCMP, WIFI_CIPHER_TYPE_TKIP_CCMP, WIFI_CIPHER_TYPE_GCMP and WIFI_CIPHER_TYPE_GCMP256. */ bool ftm_responder; /**< Enable FTM Responder mode */ wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame */ - wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method. Default value :2 (WPA3_SAE_PWE_BOTH) */ uint8_t transition_disable: 1; /**< Whether to enable transition disable feature */ uint8_t sae_ext: 1; /**< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. */ uint8_t wpa3_compatible_mode: 1; /**< Enable WPA3 compatible authmode feature. Note: Enabling this will override the AP configuration's authmode and pairwise_cipher. The AP will operate as a WPA2 access point for all stations except for those that support WPA3 compatible mode. Only WPA3 compatibility mode stations will be able to use WPA3-SAE */ @@ -565,7 +563,7 @@ typedef struct { uint32_t transition_disable: 1; /**< Whether to enable transition disable feature */ uint32_t disable_wpa3_compatible_mode: 1; /**< Whether to disable wpa3 compatible authmode feature. Disabling this prevents connecting to WPA3-Personal RSN override (compatibility mode) APs; connection falls back to WPA2 only. */ uint32_t reserved1: 25; /**< Reserved for future feature set */ - wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method. Default value :2 (WPA3_SAE_PWE_BOTH) */ wifi_sae_pk_mode_t sae_pk_mode; /**< Configuration for SAE-PK (Public Key) Authentication method */ uint8_t failure_retry_cnt; /**< Number of connection retries station will do before moving to next AP. scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. Note: Enabling this may cause connection time to increase in case best AP doesn't behave properly. */ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index f81d2dc829..a1f781901a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit f81d2dc82923e452cb990c1f74fdda4267ff2f6b +Subproject commit a1f781901a39264308230578a6fc75f1fcd50d26 diff --git a/docs/en/api-guides/wifi-driver/overview.rst b/docs/en/api-guides/wifi-driver/overview.rst index 14ed5e01a5..e3fba0d2ff 100644 --- a/docs/en/api-guides/wifi-driver/overview.rst +++ b/docs/en/api-guides/wifi-driver/overview.rst @@ -723,7 +723,7 @@ Wi-Fi Bandwidth Mode esp_wifi_set_protocol(WIFI_IF_STA, protocol); // Set STA interface bandwidth to 40 MHz - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT40); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW40); .. only:: esp32c6 @@ -748,7 +748,7 @@ Wi-Fi Bandwidth Mode esp_wifi_set_protocol(WIFI_IF_STA, protocol); // Set bandwidth of station to 40 MHz - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT40); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW40); .. only:: esp32c5 @@ -777,8 +777,8 @@ Wi-Fi Bandwidth Mode // Set bandwidth to 20 MHz for 2.4 GHz band and 40 MHz for 5 GHz band wifi_bandwidths_t bw = { - .ghz_2g = WIFI_BW_HT20, - .ghz_5g = WIFI_BW_HT40 + .ghz_2g = WIFI_BW20, + .ghz_5g = WIFI_BW40 }; esp_wifi_set_bandwidths(WIFI_IF_STA, &bw); @@ -801,7 +801,7 @@ Wi-Fi Bandwidth Mode esp_wifi_set_protocol(WIFI_IF_STA, protocol); // Set bandwidth of the station interface to 40 MHz - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT40); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW40); .. note:: diff --git a/docs/en/migration-guides/release-6.x/6.0/wifi.rst b/docs/en/migration-guides/release-6.x/6.0/wifi.rst index 1cdb5d2ec6..9763214135 100644 --- a/docs/en/migration-guides/release-6.x/6.0/wifi.rst +++ b/docs/en/migration-guides/release-6.x/6.0/wifi.rst @@ -37,6 +37,8 @@ Removed Variables, Macros and Enum Values - **FTM:** Field ``use_get_report_api`` from structure ``wifi_ftm_initiator_cfg_t`` and field ``ftm_report_data`` from structure ``wifi_event_ftm_report_t`` has been removed. Please use ``esp_wifi_ftm_get_report`` to fetch raw FTM report data instead. +- **Wi-Fi Bandwidth:** The enum values ``WIFI_BW_HT20`` and ``WIFI_BW_HT40`` have been removed. Please use the enum values ``WIFI_BW20`` and ``WIFI_BW40`` directly. + Modified Functions and Types ---------------------------- diff --git a/docs/zh_CN/api-guides/wifi-driver/overview.rst b/docs/zh_CN/api-guides/wifi-driver/overview.rst index c81a776cfa..1d13b5af76 100644 --- a/docs/zh_CN/api-guides/wifi-driver/overview.rst +++ b/docs/zh_CN/api-guides/wifi-driver/overview.rst @@ -723,7 +723,7 @@ Wi-Fi 带宽模式 esp_wifi_set_protocol(WIFI_IF_STA, protocol); // 设置 STA 的带宽为 40 MHz - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT40); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW40); .. only:: esp32c6 @@ -748,7 +748,7 @@ Wi-Fi 带宽模式 esp_wifi_set_protocol(WIFI_IF_STA, protocol); // 设置 STA 的带宽为 40 MHz - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT40); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW40); .. only:: esp32c5 @@ -777,8 +777,8 @@ Wi-Fi 带宽模式 // 设置 2.4 GHz 带宽为 20 MHz,5 GHz 带宽为 40 MHz wifi_bandwidths_t bw = { - .ghz_2g = WIFI_BW_HT20, - .ghz_5g = WIFI_BW_HT40 + .ghz_2g = WIFI_BW20, + .ghz_5g = WIFI_BW40 }; esp_wifi_set_bandwidths(WIFI_IF_STA, &bw); @@ -801,7 +801,7 @@ Wi-Fi 带宽模式 esp_wifi_set_protocol(WIFI_IF_STA, protocol); // 设置 STA 的带宽为 40 MHz - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT40); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW40); .. note:: diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/wifi.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/wifi.rst index c1547b1af6..cd7fef2ac4 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/wifi.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/wifi.rst @@ -37,6 +37,8 @@ Wi-Fi - **FTM:** 结构体 ``wifi_ftm_initiator_cfg_t`` 中的字段 ``use_get_report_api`` 和结构体 ``wifi_event_ftm_report_t`` 中的字段 ``ftm_report_data`` 已被移除。请改用 ``esp_wifi_ftm_get_report`` 获取原始 FTM 报告数据。 +- **Wi-Fi 接口宏:** 枚举值 ``WIFI_BW_HT20`` 和 ``WIFI_BW_HT40`` 已被移除。请直接使用枚举值 ``WIFI_BW20`` 和 ``WIFI_BW40``。 + 已修改的函数和类型 ------------------ diff --git a/examples/wifi/ftm/main/ftm_main.c b/examples/wifi/ftm/main/ftm_main.c index 9f6b1c0ee2..b7797a07bb 100644 --- a/examples/wifi/ftm/main/ftm_main.c +++ b/examples/wifi/ftm/main/ftm_main.c @@ -437,10 +437,10 @@ static bool wifi_cmd_ap_set(const char* ssid, const char* pass, uint8_t channel, proto.ghz_2g = WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N; proto.ghz_5g = 0; esp_wifi_set_protocols(WIFI_IF_AP, &proto); - bws.ghz_2g = WIFI_BW_HT40; + bws.ghz_2g = WIFI_BW40; esp_wifi_set_bandwidths(WIFI_IF_AP, &bws); } else { - bws.ghz_2g = WIFI_BW_HT20; + bws.ghz_2g = WIFI_BW20; esp_wifi_set_bandwidths(WIFI_IF_AP, &bws); } } else { @@ -449,13 +449,13 @@ static bool wifi_cmd_ap_set(const char* ssid, const char* pass, uint8_t channel, proto.ghz_2g = 0; proto.ghz_5g = WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11A; esp_wifi_set_protocols(WIFI_IF_AP, &proto); - bws.ghz_5g=WIFI_BW_HT40; + bws.ghz_5g=WIFI_BW40; esp_wifi_set_bandwidths(WIFI_IF_AP, &bws); } else { proto.ghz_2g = 0; proto.ghz_5g = WIFI_PROTOCOL_11AC | WIFI_PROTOCOL_11A | WIFI_PROTOCOL_11AX; esp_wifi_set_protocols(WIFI_IF_AP, &proto); - bws.ghz_5g = WIFI_BW_HT20; + bws.ghz_5g = WIFI_BW20; esp_wifi_set_bandwidths(WIFI_IF_AP, &bws); } #endif diff --git a/examples/wifi/iperf/main/idf_component.yml b/examples/wifi/iperf/main/idf_component.yml index 95a1010aa7..35dc881596 100644 --- a/examples/wifi/iperf/main/idf_component.yml +++ b/examples/wifi/iperf/main/idf_component.yml @@ -4,7 +4,7 @@ dependencies: espressif/iperf-cmd: version: "~0.1.3" esp-qa/wifi-cmd: - version: "~0.2.0" + version: "~0.2.7" esp-qa/ping-cmd: version: "~1.0.0" espressif/esp_wifi_remote: diff --git a/examples/wifi/itwt/main/itwt_main.c b/examples/wifi/itwt/main/itwt_main.c index ec1bdc29e4..ae4914067c 100644 --- a/examples/wifi/itwt/main/itwt_main.c +++ b/examples/wifi/itwt/main/itwt_main.c @@ -277,8 +277,8 @@ static void wifi_itwt(void) ESP_ERROR_CHECK(esp_wifi_sta_twt_config(&wifi_twt_config)); #if CONFIG_SOC_WIFI_SUPPORT_5G wifi_bandwidths_t bw = { - .ghz_2g = WIFI_BW_HT20, - .ghz_5g = WIFI_BW_HT20, + .ghz_2g = WIFI_BW20, + .ghz_5g = WIFI_BW20, }; esp_wifi_set_bandwidths(WIFI_IF_STA, &bw); @@ -288,7 +288,7 @@ static void wifi_itwt(void) }; esp_wifi_set_protocols(WIFI_IF_STA, &protocol); #else - esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20); + esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW20); esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N | WIFI_PROTOCOL_11AX); #endif esp_wifi_set_ps(WIFI_PS_MIN_MODEM); diff --git a/tools/idf_py_actions/hints.yml b/tools/idf_py_actions/hints.yml index 7df23f2ecf..d2cc4fd995 100644 --- a/tools/idf_py_actions/hints.yml +++ b/tools/idf_py_actions/hints.yml @@ -753,3 +753,11 @@ - re: "fatal error: soc/uart_channel.h: No such file or directory" hint: "The header file 'soc/uart_channel.h' has been removed. All equivalent UART GPIO lookup macros can be found in 'soc/uart_pins.h' now." + +- + re: "error: 'WIFI_BW_HT20' undeclared \\(first use in this function\\)" + hint: "The enum value 'WIFI_BW_HT20' has been removed. Use 'WIFI_BW20' instead." + +- + re: "error: 'WIFI_BW_HT40' undeclared \\(first use in this function\\)" + hint: "The enum value 'WIFI_BW_HT40' has been removed. Use 'WIFI_BW40' instead."