Page 1 of 1

ble mesh 通用控制无法及时响应

Posted: Wed Mar 25, 2020 11:51 am
by 137502805@qq.com
04:30:19:600] ff01000055␍␊
[04:30:19:600] <0x1b>[0;32mI (30534) ble_mesh_provisioner: ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_set onoff: 0x00<0x1b>[0m␍␊
[04:30:19:633] <0x1b>[0;32mI (30564) ble_mesh_provisioner: example_ble_mesh_generic_client_cb, error_code = 0x00, event = 0x01, addr: 0x0005, opcode: 0x8202<0x1b>[0m␍␊
[04:30:19:644] <0x1b>[0;32mI (30564) ble_mesh_provisioner: ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET onoff: 0x01<0x1b>[0m␍␊
[04:30:21:850] ff01000055␍␊
[04:30:21:850] <0x1b>[0;32mI (32784) ble_mesh_provisioner: ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_set onoff: 0x00<0x1b>[0m␍␊
[04:30:21:904] <0x1b>[0;32mI (32834) ble_mesh_provisioner: example_ble_mesh_generic_client_cb, error_code = 0x00, event = 0x01, addr: 0x0005, opcode: 0x8202<0x1b>[0m␍␊
[04:30:21:915] <0x1b>[0;32mI (32834) ble_mesh_provisioner: ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET onoff: 0x00<0x1b>[0m␍
我尝试用串口收命令发mesh消息 但是发现set完了很多时候状态并不变化 比如设置onoff=1,回调回来还是0 我不知道是什么原因导致的。从节点观察是根本没收到此命令,那么这个回调时谁回复的呢?
以下是我的set函数
ESP_LOGI(TAG, "ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_set onoff: 0x%02x", node->onoff);
example_ble_mesh_set_msg_common(&common, node, onoff_client.model, ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET);
set_state.onoff_set.op_en = false;
set_state.onoff_set.onoff = node->onoff;
set_state.onoff_set.tid = 0;
set_state.onoff_set.delay = 0;
node->unicast = address;
err = esp_ble_mesh_generic_client_set_state(&common, &set_state);

Re: ble mesh 通用控制无法及时响应

Posted: Fri Mar 27, 2020 1:19 am
by 137502805@qq.com
结帖 :
tid需要递增
set_state.onoff_set.tid = msg_tid++;