bind与command---绑定之命令理解-1

       前一篇文章中主要讲了对于绑定的理解。现在来讲讲对于绑定的实现。

      绑定的实现主要有两种方式:

 

     If the extended address of the destination device is known, the zb_BindDevice() can be to create a binding entry.

      如果知道目的设备的IEEE地址,那么就可以使用这种模式。但是大多数情形下我们是不知道目标设备的IEEE地址的。可能能通过网络层的IEEE地址的请求函数来请求获得目的设备的IEEE地址,至于具体操作,这里没有去详细讨论,这里提出一个思路,大家可以去尝试一下。

       If the extended address is not known, a “push button” strategy may be employed. In this case, the

destination device is first put in a state where it will respond to match requests by issuing the

zb_AllowBindResponse(). Then the zb_ BindDevice() is issued on the source device with a null address. 大多数是使用这种方式来实现,在Zstack中就是用这种策略实现的。

In addition, bindings can be setup by using an external commissioning tool.

       Note that bindings can only be created between “complementary” devices. That is, the binding will only

succeed if both devices have registered the same command_id  in their simple descriptor structures and

one device has the command as an “output” while the other device has it as an “input”.

      这里需要注意两点,绑定是互补的,也就是说必须源设备和目的设备是成对出现的。且一个设备必须作为一个输出,一个设备必须多输入(这里的输入和输出是必须出现的,但是可以多个设备作为输入或者输出)。请注意这里提到命令。绑定是实现端点之间的连接的,那么command_id就是实现绑定的一种方式。也就是说再不同应用中有相同的command_id,那么着两个设备就可以实现绑定。当然他们的属性值要是正确的,比如输入输出属性。

转载于:https://www.cnblogs.com/farbeyond/p/5204598.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值