找回密码
 立即注册

微信扫码登录

楼主: Rory

Temperature Measurement Client如何接收已绑定的server数据呢

[复制链接]

13

主题

61

回帖

363

积分

流光翡翠

积分
363
发表于 2025-5-12 09:39:25 | 显示全部楼层 来自 澳大利亚
本帖最后由 wes58 于 2025-5-12 11:05 编辑
Slacky 发表于 2025-5-10 17:47
But this table does not have records about external sensor, it only has internal ones. And the des ...

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.
  1.         }else if(cmdID == ZBHCI_CMD_MGMT_BIND_REQ){
  2.                 u8 sn = 0;
  3.                 zdo_mgmt_bind_req_t req;
  4.                 u16 dstAddr = (p[0] << 8) | p[1];
  5.                 req.start_index = p[2];
  6.                 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.:
  1.         bool bindOrUnbind = (cmdID == ZBHCI_CMD_BINDING_REQ) ? 1 : 0;
  2.         u8 sn = 0;
  3.         if(bindOrUnbind){
  4.                 zb_zdoBindUnbindReq(bindOrUnbind, &req, &sn, zbhciBindRspPush);
  5.         }else{
  6.                 zb_zdoBindUnbindReq(bindOrUnbind, &req, &sn, zbhciUnbindRspPush);
  7.         }
复制代码

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.

8

主题

19

回帖

210

积分

华贵铂金

积分
210
发表于 2025-5-24 02:19:42 | 显示全部楼层 来自 俄罗斯
wes58 发表于 2025-5-12 09:39
Of course it doesn't. Where do you call your temp sensor binding table?

I don't understand how you ...

Hi.

No. I don't want to do this on the gateway. I want to know this on the device to which the external sensor sends reports via binding.

13

主题

61

回帖

363

积分

流光翡翠

积分
363
发表于 2025-5-26 09:39:36 | 显示全部楼层 来自 澳大利亚
Slacky 发表于 2025-5-24 02:19
Hi.

No. I don't want to do this on the gateway. I want to know this on the device to which the ex ...

OK. I give up.
the Zigbee Coordinator (ZC) is the central, root device that forms and manages the networ
That's the role of the Coordinator to manage devices not one device (router) setting up another one.
It that what was happening the Coordinator (or you if you are controlling all the devices) wouldn't know what is happening on your network.
Good luck with what you are doing!


8

主题

19

回帖

210

积分

华贵铂金

积分
210
发表于 6 天前 | 显示全部楼层 来自 俄罗斯
wes58 发表于 2025-5-26 09:39
OK. I give up.
That's the role of the Coordinator to manage devices not one device (router) setti ...

This is called direct binding, where one device sends commands and reports to another device without going through the coordinator. With this scheme, even if the coordinator goes down for a while, the two devices will continue to work.

13

主题

61

回帖

363

积分

流光翡翠

积分
363
发表于 5 天前 | 显示全部楼层 来自 澳大利亚
本帖最后由 wes58 于 2025-6-1 05:21 编辑
With this scheme, even if the coordinator goes down for a while, the two devices will continue to work.

It is not correct. Because once you bind one device to another through the coordinator, they continue working without the coordinator. Coordinator doesn't know what devices are bound with each other - and it doesn't care. It doesn't keep any information about bound devices. Coordinator is just a device that lets you cotnrol and set up all devices on your network as you wish.
I have one light which can be controlled by 3 routers. They are all bound to the light device and they all receive and display the status of the light device when it changes.

In your case temperature sensor device has the binding table in which there is an information about the device that it is bound with, and keeps sending temperatures  to the bound devices even without coordinator.
And it is up to you to set up which device are bound with each other and you have control over the binding process. You know if the binding was successful and you can unbind the devices if you wish.
If you don't want to use this binding method you can still read the binding table on the device - temperature sensor - using coordinator, to check if the devices are bound and what devices are bound.

8

主题

19

回帖

210

积分

华贵铂金

积分
210
发表于 5 天前 | 显示全部楼层 来自 俄罗斯
wes58 发表于 2025-6-1 05:12
It is not correct. Because once you bind one device to another through the coordinator, they contin ...

Yes, I can make the device request a list of bindings from the coordinator. Which is what I actually do via zb_mgmtBindReq(). But this is not fast. I would like to control this (binding/unbinding) on ​​the device itself, without contacting the coordinator.

13

主题

61

回帖

363

积分

流光翡翠

积分
363
发表于 4 天前 | 显示全部楼层 来自 澳大利亚
Slacky 发表于 2025-6-1 17:43
Yes, I can make the device request a list of bindings from the coordinator. Which is what I actual ...

OK , if that's what you want to do.
For me, it is just one ZHBCI message sent from the coordinator to the the device to bind with anther device and you get response if it successful. And you don't have to worry about reading the binding table.
I bind the device once - one message sent from my phone app to the coordinator - and it has been running for a couple of years without me doing anything. So I don't understand your problem.

I would like to control this (binding/unbinding) on ​​the device itself

I don't know how you can do unbinding? How would the binding device know that you want to unbind the device from?

Anyway, I think that's enough. You know what you want to achieve.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-6-6 07:54 , Processed in 0.144121 second(s), 19 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表