From 37e2e7599a1aacb7de44cb521800466732051cca Mon Sep 17 00:00:00 2001 From: shenjun Date: Mon, 1 Nov 2021 11:07:50 +0800 Subject: [PATCH] esp_wifi_mesh: add esp_mesh_send_block_time to set blocking time of esp_mesh_send 1. fix the issue that layer2 node connect to lower-layer node when FIXED-ROOT root disappeared 2. add esp_mesh_send_block_time to set blocking time of esp_mesh_send --- components/esp32/include/esp_mesh.h | 14 +++++++++++++- components/esp32/lib | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/esp32/include/esp_mesh.h b/components/esp32/include/esp_mesh.h index e703ec8280..bfd3e79379 100644 --- a/components/esp32/include/esp_mesh.h +++ b/components/esp32/include/esp_mesh.h @@ -638,7 +638,7 @@ esp_err_t esp_mesh_stop(void); * - If the packet is to the root ("to" parameter isn't NULL) or to external IP network, MESH_DATA_TODS should be set. * - If the packet is from the root to an internal device, MESH_DATA_FROMDS should be set. * - Specify whether this API is block or non-block, block by default - * - If needs non-block, MESH_DATA_NONBLOCK should be set. + * - If needs non-blocking, MESH_DATA_NONBLOCK should be set. Otherwise, may use esp_mesh_send_block_time() to specify a blocking time. * - In the situation of the root change, MESH_DATA_DROP identifies this packet can be dropped by the new root * for upstream data to external IP network, we try our best to avoid data loss caused by the root change, but * there is a risk that the new root is running out of memory because most of memory is occupied by the pending data which @@ -672,6 +672,18 @@ esp_err_t esp_mesh_stop(void); esp_err_t esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data, int flag, const mesh_opt_t opt[], int opt_count); +/** + * @brief Set blocking time of esp_mesh_send() + * + * @attention This API shall be called before mesh is started. + * + * @param[in] time_ms blocking time of esp_mesh_send(), unit:ms + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_send_block_time(uint32_t time_ms); + /** * @brief Receive a packet targeted to self over the mesh network * diff --git a/components/esp32/lib b/components/esp32/lib index f48f237e82..7fc09aa09f 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit f48f237e82cfaefde64500f9695794e1ab00d3bf +Subproject commit 7fc09aa09f7b5d3f69d0c653c87c6f1e4b881bcf