|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -141,7 +141,7 @@ extern "C" { |
141 | 141 | #define MESH_ASSOC_FLAG_STA_VOTED (0x04) /**< station vote done, set when connect to router */ |
142 | 142 | #define MESH_ASSOC_FLAG_NETWORK_FREE (0x08) /**< no root in current network */ |
143 | 143 | #define MESH_ASSOC_FLAG_STA_VOTE_EXPIRE (0x10) /**< the voted address is expired, means the voted device lose the chance to be root */ |
144 | | -#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< roots conflict is found, means that thre are at least two roots in the mesh network */ |
| 144 | +#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< roots conflict is found, means that there are at least two roots in the mesh network */ |
145 | 145 | #define MESH_ASSOC_FLAG_ROOT_FIXED (0x40) /**< the root is fixed in the mesh network */ |
146 | 146 |
|
147 | 147 | /** |
@@ -216,7 +216,7 @@ typedef enum { |
216 | 216 | MESH_ROOT, /**< the only sink of the mesh network. Has the ability to access external IP network */ |
217 | 217 | MESH_NODE, /**< intermediate device. Has the ability to forward packets over the mesh network */ |
218 | 218 | MESH_LEAF, /**< has no forwarding ability */ |
219 | | - MESH_STA, /**< connect to router with a standlone Wi-Fi station mode, no network expansion capability */ |
| 219 | + MESH_STA, /**< connect to router with a standalone Wi-Fi station mode, no network expansion capability */ |
220 | 220 | } mesh_type_t; |
221 | 221 |
|
222 | 222 | /** |
@@ -642,14 +642,16 @@ esp_err_t esp_mesh_stop(void); |
642 | 642 | * - Field size should not exceed MESH_MPS. Note that the size of one mesh packet should not exceed MESH_MTU. |
643 | 643 | * - Field proto should be set to data protocol in use (default is MESH_PROTO_BIN for binary). |
644 | 644 | * - Field tos should be set to transmission tos (type of service) in use (default is MESH_TOS_P2P for point-to-point reliable). |
| 645 | + * - If the packet is to the root, MESH_TOS_P2P must be set to ensure reliable transmission. |
| 646 | + * - As long as the MESH_TOS_P2P is set, the API is blocking, even if the flag is set with MESH_DATA_NONBLOCK. |
| 647 | + * - As long as the MESH_TOS_DEF is set, the API is non-blocking. |
645 | 648 | * @param[in] flag bitmap for data sent |
| 649 | + * - Flag is at least one of the three MESH_DATA_P2P/MESH_DATA_FROMDS/MESH_DATA_TODS, which represents the direction of packet sending. |
646 | 650 | * - Speed up the route search |
647 | | - * - If the packet is to the root and "to" parameter is NULL, set this parameter to 0. |
648 | 651 | * - If the packet is to an internal device, MESH_DATA_P2P should be set. |
649 | 652 | * - If the packet is to the root ("to" parameter isn't NULL) or to external IP network, MESH_DATA_TODS should be set. |
650 | 653 | * - If the packet is from the root to an internal device, MESH_DATA_FROMDS should be set. |
651 | | - * - Specify whether this API is block or non-block, block by default |
652 | | - * - If needs non-blocking, MESH_DATA_NONBLOCK should be set. Otherwise, may use esp_mesh_send_block_time() to specify a blocking time. |
| 654 | + * - Specify whether this API is blocking or non-blocking, blocking by default. |
653 | 655 | * - In the situation of the root change, MESH_DATA_DROP identifies this packet can be dropped by the new root |
654 | 656 | * for upstream data to external IP network, we try our best to avoid data loss caused by the root change, but |
655 | 657 | * there is a risk that the new root is running out of memory because most of memory is occupied by the pending data which |
@@ -684,6 +686,7 @@ esp_err_t esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data, |
684 | 686 | int flag, const mesh_opt_t opt[], int opt_count); |
685 | 687 | /** |
686 | 688 | * @brief Set blocking time of esp_mesh_send() |
| 689 | + * - Suggest to set the blocking time to at least 5s when the environment is poor. Otherwise, esp_mesh_send() may timeout frequently. |
687 | 690 | * |
688 | 691 | * @attention This API shall be called before mesh is started. |
689 | 692 | * |
@@ -1202,6 +1205,7 @@ int esp_mesh_get_xon_qsize(void); |
1202 | 1205 |
|
1203 | 1206 | /** |
1204 | 1207 | * @brief Set whether allow more than one root existing in one network |
| 1208 | + * - The default value is true, that is, multiple roots are allowed. |
1205 | 1209 | * |
1206 | 1210 | * @param[in] allowed allow or not |
1207 | 1211 | * |
|
0 commit comments