diff --git a/components/esp_wifi/include/esp_now.h b/components/esp_wifi/include/esp_now.h index 81341d51db..521dcbb59a 100644 --- a/components/esp_wifi/include/esp_now.h +++ b/components/esp_wifi/include/esp_now.h @@ -51,7 +51,7 @@ extern "C" { #define ESP_NOW_MAX_IE_DATA_LEN 250 /**< Maximum data length in a vendor-specific element */ #define ESP_NOW_MAX_DATA_LEN ESP_NOW_MAX_IE_DATA_LEN /**< Maximum length of data sent in each ESPNOW transmission for v1.0 */ -#define ESP_NOW_MAX_DATA_LEN_V2 1490 /**< Maximum length of data sent in each ESPNOW transmission for v2.0 */ +#define ESP_NOW_MAX_DATA_LEN_V2 1470 /**< Maximum length of data sent in each ESPNOW transmission for v2.0 */ /** * @brief Status of sending ESPNOW data . diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index f6b785ece0..912cbb942f 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit f6b785ece04d4a2c22da31ea5f7761344a2fd367 +Subproject commit 912cbb942f4070ed8918d43866f987b03d0b1fb9 diff --git a/docs/en/api-reference/network/esp_now.rst b/docs/en/api-reference/network/esp_now.rst index 4e5ea51c02..64f0bb81ab 100644 --- a/docs/en/api-reference/network/esp_now.rst +++ b/docs/en/api-reference/network/esp_now.rst @@ -88,7 +88,13 @@ When :cpp:func:`esp_now_deinit()` is called, all of the information of paired de Add Paired Device ----------------- -Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list before you send data to this device. If security is enabled, the LMK must be set. You can send ESP-NOW data via both the Station and the SoftAP interface. Make sure that the interface is enabled before sending ESP-NOW data. +Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list before you send data to this device. If security is enabled, the LMK must be set. A device with a broadcast MAC address must be added before sending broadcast data. + +You can send ESP-NOW data via both the Station and the SoftAP interface. Make sure that the interface is enabled before sending ESP-NOW data. + +The range of the channel of paired devices is from 0 to 14. If the channel is set to 0, data will be sent on the current channel. Otherwise, the channel must be set as the channel that the local device is on. + +For the receiving device, calling :cpp:func:`esp_now_add_peer()` is not required. If no paired device is added, it can only receive broadcast packets and unencrypted unicast packets. To receive encrypted unicast packets, a paired device must be added, and the same LMK must be set. .. only:: esp32c2 @@ -98,8 +104,6 @@ Call :cpp:func:`esp_now_add_peer()` to add the device to the paired device list The maximum number of paired devices is 20, and the paired encryption devices are no more than 17, the default is 7. If you want to change the number of paired encryption devices, set :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM` in the Wi-Fi component configuration menu. -A device with a broadcast MAC address must be added before sending broadcast data. The range of the channel of paired devices is from 0 to 14. If the channel is set to 0, data will be sent on the current channel. Otherwise, the channel must be set as the channel that the local device is on. - Send ESP-NOW Data ----------------- diff --git a/docs/zh_CN/api-reference/network/esp_now.rst b/docs/zh_CN/api-reference/network/esp_now.rst index c3986cf30c..b05c16ecd3 100644 --- a/docs/zh_CN/api-reference/network/esp_now.rst +++ b/docs/zh_CN/api-reference/network/esp_now.rst @@ -88,7 +88,13 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参 添加配对设备 ----------------- -在将数据发送到其他设备之前,请先调用 :cpp:func:`esp_now_add_peer()` 将其添加到配对设备列表中。如果启用了加密,则必须设置 LMK。ESP-NOW 数据可以从 Station 或 SoftAP 接口发送。确保在发送 ESP-NOW 数据之前已启用该接口。 +在将数据发送到其他设备之前,请先调用 :cpp:func:`esp_now_add_peer()` 将其添加到配对设备列表中。如果启用了加密,则必须设置 LMK。 + +ESP-NOW 数据可以从 Station 或 SoftAP 接口发送。确保在发送 ESP-NOW 数据之前已启用该接口。 + +配对设备的信道范围是从 0 ~ 14。如果信道设置为 0,数据将在当前信道上发送。否则,必须使用本地设备所在的通道。 + +对于接收设备,调用 :cpp:func:`esp_now_add_peer()` 不是必需的。如果没有添加配对设备,只能接收广播包和不加密的单播包。如果需要接收加密的单播包,则必须添加配对设备并设置相同的 LMK。 .. only:: esp32c2 @@ -98,8 +104,6 @@ ESP-NOW 采用 CCMP 方法保护供应商特定动作帧的安全,具体可参 配对设备的最大数量是 20,其中加密设备的数量不超过 17,默认值是 7。如果想要修改加密设备的数量,在 Wi-Fi menuconfig 设置 :ref:`CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM`。 -在发送广播数据之前必须添加具有广播 MAC 地址的设备。配对设备的信道范围是从 0 ~ 14。如果信道设置为 0,数据将在当前信道上发送。否则,必须使用本地设备所在的通道。 - 发送 ESP-NOW 数据 ----------------- diff --git a/examples/wifi/espnow/main/Kconfig.projbuild b/examples/wifi/espnow/main/Kconfig.projbuild index 459e567ccd..a2336e5bdd 100644 --- a/examples/wifi/espnow/main/Kconfig.projbuild +++ b/examples/wifi/espnow/main/Kconfig.projbuild @@ -47,7 +47,7 @@ menu "Example Configuration" config ESPNOW_SEND_LEN int "Send len" - range 10 250 + range 10 1470 default 10 help Length of ESPNOW data to be sent, unit: byte.