|
发表于 2025-5-12 09:39:25
|
显示全部楼层
来自 澳大利亚
本帖最后由 wes58 于 2025-5-12 11:05 编辑
Of course it doesn't. Where do you call your temp sensor binding table?
I don't understand how you bind and control the devices?
Where do you want to check if binding was successfule.
I assume that you want to do everything at the gateway.
Here is what I do:
1 From the Gateway/Coordinator I send a ZBHCI message to bind temp. sensor to the gateway
2 I get a response with the status 0x0 if successful
3. From the Gateway/Coordinator I send a ZBHCI message to bind temp. sensor to another Device - that's what you want.
4. I get a response again with status 0x0 if successful.
If I want to check binding table of the temperature sensor I send ZBHCI message ZBHCI_CMD_MGMT_BIND_REQ. This message has network address of the device that you want to read binding table from - that is your temp sensor.
If you don't want to send ZBHCI messages then you can check zbhciCmdProcess.c file and you will see what message the gateway sends to the temp. sensor to get a table.
- }else if(cmdID == ZBHCI_CMD_MGMT_BIND_REQ){
- u8 sn = 0;
- zdo_mgmt_bind_req_t req;
- u16 dstAddr = (p[0] << 8) | p[1];
- req.start_index = p[2];
- zb_mgmtBindReq(dstAddr, &req, &sn, zbhciMgmtBindRspMsgPush);
复制代码
You can see that it sends zb_mgmtBindReq and sets callback function zbhciMgmtBindRspMsgPush where you get the binding table data.
It is the same when sending ZBHCI messages to bind/unbind onde device with the gateway or one device with any other devices.:
- bool bindOrUnbind = (cmdID == ZBHCI_CMD_BINDING_REQ) ? 1 : 0;
- u8 sn = 0;
- if(bindOrUnbind){
- zb_zdoBindUnbindReq(bindOrUnbind, &req, &sn, zbhciBindRspPush);
- }else{
- zb_zdoBindUnbindReq(bindOrUnbind, &req, &sn, zbhciUnbindRspPush);
- }
复制代码
So for binding the gateway sends zb_zdoBindUnbindReq message to temp. sensor to bind to whatever device you want. And it sets callback function zbhciBindRspPush where you get the status of the binding process.
|
|