Skip to content

Commit 3d91f82

Browse files
committed
Merge branch 'bugfix/Eliminate_compilation_warnings' into 'master'
fix: esp_mesh_lite_try_sending_raw_msg has been deprecated, use esp_mesh_lite_send_msg See merge request ae_group/esp-mesh-lite!157
2 parents 89d2ed0 + 2d32bf8 commit 3d91f82

File tree

15 files changed

+101
-16
lines changed

15 files changed

+101
-16
lines changed

components/mesh_lite/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# ChangeLog
44

5-
## v1.0.2 - 2025-4-14
5+
## v1.0.2 - 2025-4-17
66

77
### Breaking Change:
88

@@ -13,6 +13,8 @@
1313

1414
#### Mesh
1515

16+
- Optimized: speed up fusion process for specific scenarios​ ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
17+
- Optimized: in Mesh Lite connections, skip disconnection/reconnection if the target device matches the currently connected one ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
1618
- Support longer data length in espnow ([29185cc](https://github.com/espressif/esp-mesh-lite/commit/29185cc323d199e609d1ff75fe21e5dab95c4e34))
1719
- Support getting mesh-lite core commit ID through API ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
1820
- Optimize: The device disallowed as root node will not request to be included in the will list ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
@@ -30,6 +32,14 @@
3032

3133
#### Bugfix
3234

35+
- Fixed the issue that the Vendor IE information was accidentally updated when esp_wifi_connect() returned ESP_FAIL ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
36+
- Fixed: The new device may disrupt the old network topology when joining a full capacity network ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
37+
- Fixed the issue where the reconnection mechanism could not be enabled when the fixed root node called `esp_mesh_lite_connect()`, this regression was introduced in commit [0b8918b](https://github.com/espressif/esp-mesh-lite/commit/0b8918b28f9bb6a8ccf2f676c2005e5b0d30cdf6) ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
38+
- Fixed: replace deprecated `esp_mesh_lite_try_sending_msg()` with `esp_mesh_lite_send_msg()` ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
39+
- Fix abnormal fusion behavior in special situations ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
40+
- Devices fixed as root nodes and acting only as leaf nodes mistakenly triggered fusion, causing them to repeatedly disconnect from the router
41+
- Devices fixed as root nodes and acting only as leaf nodes mistakenly triggered fusion in other devices, causing other root nodes to repeatedly disconnect from the router
42+
- Root nodes with the maximum layer set to 1 mistakenly triggered fusion in other devices, causing other root nodes to repeatedly disconnect from the router
3343
- Fixed: It blocked the system when calling esp_mesh_lite_send_msg in the send_fail callback ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
3444
- Fixed: It failed to set the level to 0 when disallowed_level had been set 0 ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
3545
- Fixed: The last connected child node will be de-authenticated though the number of child nodes does not exceed the maximum limit ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))

components/mesh_lite/CHANGELOG_CN.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ChangeLog
22

3-
## v1.0.2 - 2025-4-14
3+
## v1.0.2 - 2025-4-17
44

55
### Breaking Change:
66

@@ -11,6 +11,8 @@
1111

1212
#### Mesh
1313

14+
- 优化部分场景下的融合过程,缩短融合时间 ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
15+
- Mesh Lite 连接中,若待连接设备与当前连接设备相同,无需断开重连 ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
1416
- 支持 espnow 发送更长的数据 ([29185cc](https://github.com/espressif/esp-mesh-lite/commit/29185cc323d199e609d1ff75fe21e5dab95c4e34))
1517
- 新增 API 以获取当前 mesh-lite 库的 commit id ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
1618
- 当设备被禁止成为根节点时将不会被加入到 “遗嘱” 列表中 ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
@@ -28,6 +30,14 @@
2830

2931
#### Bugfix
3032

33+
- 修复调用 `esp_wifi_connect()` 失败时错误地更新 Vendor IE 信息 ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
34+
- 修复新设备加入满载网络时可能会破坏原有拓扑结构的问题 ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
35+
- 修复设备作为固定根节点时,调用 `esp_mesh_lite_connect()` 未触发重连机制的问题,该问题由提交 [0b8918b](https://github.com/espressif/esp-mesh-lite/commit/0b8918b28f9bb6a8ccf2f676c2005e5b0d30cdf6) 引入 ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
36+
- 将废弃的 `esp_mesh_lite_try_sending_msg()` 替换为 `esp_mesh_lite_send_msg()` ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
37+
- 修复特殊情况下的异常融合行为 ([544b925](https://github.com/espressif/esp-mesh-lite/commit/544b925c705b80acf823216f8236bf57339c7b9f))
38+
- 固定为根节点且仅作为叶节点的设备,误触发了融合导致其反复断开路由器
39+
- 固定为根节点且仅作为叶节点的设备,误触发其它设备融合,导致其他根节点反复断开路由器
40+
- 最高层级设置为 1 的根节点,误触发其它设备融合,导致其他根节点反复断开路由器
3141
- 修复在 send_fail cb 中调用 esp_mesh_lite_send_msg 会造成系统卡死问题 ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
3242
- 修复当不禁用设备层级时,无法设置设备 level 为 0 的问题 ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))
3343
- 修复在子节点数量没有超过最大限制的情况下,最后一个接入的子节点被 deauth 的问题 ([6265503](https://github.com/espressif/esp-mesh-lite/commit/62655031e5dc527d35ebb2c51389f100208991cd))

components/mesh_lite/lib/VERSION

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version
2-
libesp_mesh_lite_esp32.a :b24c767
3-
libesp_mesh_lite_esp32c2.a :b24c767
4-
libesp_mesh_lite_esp32c3.a :b24c767
5-
libesp_mesh_lite_esp32c5.a :b24c767
6-
libesp_mesh_lite_esp32c6.a :b24c767
7-
libesp_mesh_lite_esp32s2.a :b24c767
8-
libesp_mesh_lite_esp32s3.a :b24c767
2+
libesp_mesh_lite_esp32.a :55a2810
3+
libesp_mesh_lite_esp32c2.a :55a2810
4+
libesp_mesh_lite_esp32c3.a :55a2810
5+
libesp_mesh_lite_esp32c5.a :55a2810
6+
libesp_mesh_lite_esp32c6.a :55a2810
7+
libesp_mesh_lite_esp32s2.a :55a2810
8+
libesp_mesh_lite_esp32s3.a :55a2810
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

components/mesh_lite/src/esp_mesh_lite.c

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,18 @@ esp_err_t esp_mesh_lite_report_info(void)
6565
uint32_t outlen = mesh_lite__node_data__get_packed_size(&req);
6666
uint8_t *outdata = malloc(outlen);
6767
mesh_lite__node_data__pack(&req, outdata);
68-
esp_mesh_lite_try_sending_raw_msg(MESH_LITE_MSG_ID_REPORT_NODE_INFO, MESH_LITE_MSG_ID_REPORT_NODE_INFO_RESP, 3, outdata, outlen, esp_mesh_lite_send_raw_msg_to_root);
68+
69+
esp_mesh_lite_msg_config_t config = {
70+
.raw_msg = {
71+
.msg_id = MESH_LITE_MSG_ID_REPORT_NODE_INFO,
72+
.expect_resp_msg_id = MESH_LITE_MSG_ID_REPORT_NODE_INFO_RESP,
73+
.max_retry = 3,
74+
.data = outdata,
75+
.size = outlen,
76+
.raw_resend = esp_mesh_lite_send_raw_msg_to_root,
77+
},
78+
};
79+
esp_mesh_lite_send_msg(ESP_MESH_LITE_RAW_MSG, &config);
6980
free(outdata);
7081

7182
return ESP_OK;
@@ -211,7 +222,17 @@ static esp_err_t mesh_lite_update_nodes_list(uint8_t *data, uint32_t len, uint8_
211222
mesh_lite__data__free_unpacked(req, NULL);
212223
}
213224

214-
esp_mesh_lite_try_sending_raw_msg(MESH_LITE_MSG_ID_UPDATE_NODES_LIST, 0, 0, data, len, esp_mesh_lite_send_broadcast_raw_msg_to_child);
225+
esp_mesh_lite_msg_config_t config = {
226+
.raw_msg = {
227+
.msg_id = MESH_LITE_MSG_ID_UPDATE_NODES_LIST,
228+
.expect_resp_msg_id = 0,
229+
.max_retry = 0,
230+
.data = data,
231+
.size = len,
232+
.raw_resend = esp_mesh_lite_send_broadcast_raw_msg_to_child,
233+
},
234+
};
235+
esp_mesh_lite_send_msg(ESP_MESH_LITE_RAW_MSG, &config);
215236
return ret;
216237
}
217238

@@ -297,7 +318,17 @@ static esp_err_t esp_mesh_lite_update_nodes_info_to_children(void)
297318
}
298319
free(req.nodes);
299320

300-
esp_mesh_lite_try_sending_raw_msg(MESH_LITE_MSG_ID_UPDATE_NODES_LIST, 0, 3, outdata, outlen, esp_mesh_lite_send_broadcast_raw_msg_to_child);
321+
esp_mesh_lite_msg_config_t config = {
322+
.raw_msg = {
323+
.msg_id = MESH_LITE_MSG_ID_UPDATE_NODES_LIST,
324+
.expect_resp_msg_id = 0,
325+
.max_retry = 3,
326+
.data = outdata,
327+
.size = outlen,
328+
.raw_resend = esp_mesh_lite_send_broadcast_raw_msg_to_child,
329+
},
330+
};
331+
esp_mesh_lite_send_msg(ESP_MESH_LITE_RAW_MSG, &config);
301332
free(outdata);
302333
}
303334
return ESP_OK;

components/mesh_lite/src/wifi_prov/zero_provisioning.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,18 +583,25 @@ static void zero_prov_event_handle(zero_prov_act_t* pact, zero_prov_event_id_t e
583583
}
584584
}
585585

586+
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 4, 1)
587+
static void zero_prov_send_cb(const esp_now_send_info_t *tx_info, esp_now_send_status_t status)
588+
#else
586589
static void zero_prov_send_cb(const uint8_t *mac_addr, esp_now_send_status_t status)
590+
#endif
587591
{
588592
zero_prov_event_t evt;
589593
zero_prov_send_cb_t *send_cb = &evt.info.send_cb;
590-
bool is_broadcast = IS_BROADCAST_ADDR(mac_addr);
591-
594+
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 4, 1)
595+
const uint8_t *mac_addr = tx_info->des_addr;
596+
if (tx_info == NULL) {
597+
#else
592598
if (mac_addr == NULL) {
599+
#endif
593600
ESP_LOGE(TAG, "Send cb arg error");
594601
return;
595602
}
596603

597-
if (is_broadcast) {
604+
if (IS_BROADCAST_ADDR(mac_addr)) {
598605
evt.id = ZERO_PROV_SEND_BROADCAST;
599606
} else {
600607
evt.id = ZERO_PROV_SEND_UNICAST_DATA;

examples/rainmaker/led_light/components/app_bridge/app_mesh_lite_comm.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ esp_err_t app_rmaker_mesh_lite_report_child_info(void)
4949
cJSON_AddNumberToObject(item, "level", esp_mesh_lite_get_level());
5050
cJSON_AddStringToObject(item, "mac", mac_str);
5151
cJSON_AddStringToObject(item, "ip", ip_str);
52-
esp_mesh_lite_try_sending_msg("report_child_info", "report_child_info_ack", MAX_RETRY, item, &esp_mesh_lite_send_msg_to_parent);
52+
esp_mesh_lite_msg_config_t config = {
53+
.json_msg = {
54+
.send_msg = "report_child_info",
55+
.expect_msg = "report_child_info_ack",
56+
.max_retry = MAX_RETRY,
57+
.req_payload = item,
58+
.resend = esp_mesh_lite_send_msg_to_parent,
59+
}
60+
};
61+
esp_mesh_lite_send_msg(ESP_MESH_LITE_JSON_MSG, &config);
5362
cJSON_Delete(item);
5463
}
5564

examples/rainmaker/led_light/components/group_control/app_espnow.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,18 @@ void esp_now_remove_send_msgs(void)
169169
/* ESPNOW sending or receiving callback function is called in WiFi task.
170170
* Users should not do lengthy operations from this task. Instead, post
171171
* necessary data to a queue and handle it from a lower priority task. */
172+
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 4, 1)
173+
static void espnow_send_cb(const esp_now_send_info_t *tx_info, esp_now_send_status_t status)
174+
#else
172175
static void espnow_send_cb(const uint8_t *mac_addr, esp_now_send_status_t status)
176+
#endif
173177
{
178+
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 4, 1)
179+
const uint8_t *mac_addr = tx_info->des_addr;
180+
if (tx_info == NULL) {
181+
#else
174182
if (mac_addr == NULL) {
183+
#endif
175184
ESP_LOGE(TAG, "Send cb arg error");
176185
return;
177186
}

examples/rainmaker/provisioning_controller/main/app_espnow.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,18 @@ void esp_now_remove_send_msgs(void)
164164
/* ESPNOW sending or receiving callback function is called in WiFi task.
165165
* Users should not do lengthy operations from this task. Instead, post
166166
* necessary data to a queue and handle it from a lower priority task. */
167+
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 4, 1)
168+
static void espnow_send_cb(const esp_now_send_info_t *tx_info, esp_now_send_status_t status)
169+
#else
167170
static void espnow_send_cb(const uint8_t *mac_addr, esp_now_send_status_t status)
171+
#endif
168172
{
173+
#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 4, 1)
174+
const uint8_t *mac_addr = tx_info->des_addr;
175+
if (tx_info == NULL) {
176+
#else
169177
if (mac_addr == NULL) {
178+
#endif
170179
ESP_LOGE(TAG, "Send cb arg error");
171180
return;
172181
}

0 commit comments

Comments
 (0)