Merge branch 'feat/support_longer_data_len_in_espnow' into 'master'

feat(wifi/espnow): Support longer data length in espnow

Closes IDFGH-7935

See merge request espressif/esp-idf!31097
This commit is contained in:
Jiang Jiang Jian
2024-09-29 16:58:33 +08:00
4 changed files with 66 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -49,7 +49,9 @@ extern "C" {
#define ESP_NOW_MAX_TOTAL_PEER_NUM 20 /*!< Maximum number of ESPNOW total peers */
#define ESP_NOW_MAX_ENCRYPT_PEER_NUM 6 /*!< Maximum number of ESPNOW encrypted peers */
#define ESP_NOW_MAX_DATA_LEN 250 /*!< Maximum length of ESPNOW data which is sent very time */
#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 */
/**
* @brief Status of sending ESPNOW data .
@@ -135,7 +137,12 @@ esp_err_t esp_now_init(void);
esp_err_t esp_now_deinit(void);
/**
* @brief Get the version of ESPNOW
* @brief Get the version of ESPNOW. Currently, ESPNOW supports two versions: v1.0 and v2.0.
*
* The v2.0 devices are capable of receiving packets from both v2.0 and v1.0 devices. In contrast, v1.0 devices can only receive packets from other v1.0 devices.
* However, v1.0 devices can receive v2.0 packets if the packet length is less than or equal to ESP_NOW_MAX_IE_DATA_LEN.
* For packets exceeding this length, the v1.0 devices will either truncate the data to the first ESP_NOW_MAX_IE_DATA_LEN bytes or discard the packet entirely.
* For detailed behavior, please refer to the documentation corresponding to the specific IDF version.
*
* @param version ESPNOW version
*