1. 概述
从事zigbee设备开发的人对commission这个词应该不陌生,可译为"使服役",大概意思对了,但是不太明朗。在HA的规范文档中将其定义为:
本文将介绍在HA与zigbee3.0中的commissioning规范,HA中的规范较为简单,便于读者理解。zigbee3.0整合兼容了不同application profile(HA、ZLL、SE等)的不同规范,如touchlink、ez-mode。并且支持更加灵活的commissioning搭配,因此zigbee3.0中的commissioning规范更加复杂,但是咯,协议栈中都会实现大部分的,无需完全自己实现。
2. HA中的commissioning
HA中包含两种commissioning方式,ez-mode和Centralized commissioning。
2.1 ez-mode
ez-mode包含network steering和finding and binding两个流程。network steering流程中设备要完成入网和允许其他设备入网的操作,执行流程如图1。
图1 ez-mode的network steering流程
finding and binding流程中完成查找网络中处于ez-mode状态的端点,并与这些端点的确认cluster是否匹配,是则进行绑定。这个过程中主动查找的端点称为initiator,被查找端点称为target,其执行流程分别见图2、图3。通常情况下,控制器属于initiator,对应被控制端点为target,如Doorlock controler属于initiator,Doorlock属于target,详见[1]:ez-mode commissioning章节。
图2 initiator find and binding流程
图3 target find and binding流程
2.2 Centralized commissioning
指通过网关或其他具有对设备进行配置能力的设备对设备进行配置,通常是人为配置。
3 zigbee3.0中的commissioning
Attribute
|
Data type
|
Range
|
Default value
|
Used by
|
bdbCommissioningGroupID
|
Unsigned 16-bit
|
0x0001 – 0xffff
|
0xffff
|
Initiator nodes,
per endpoint
|
bdbCommissioningMode
|
8-bit bitmap
|
0b0000 xxxx
|
0b0000 0000
|
All nodes,
per endpoint
|
bdbCommissioningStatus
|
Enumeration
|
见 表2
|
SUCCESS
|
All nodes,
per endpoint
|
bdbNodeCommissioning-Capability
|
8-bit bitmap
|
0b0000 xxx1
|
0b0000 0001
|
All nodes
|
bdbNodeIsOnANetwork
|
Boolean
|
TRUE or FALSE
|
FALSE
|
All nodes
|
bdbPrimaryChannelSet
|
32-bit
bitmap
|
0x00000800 –
0x07fff800
|
0x02108800
|
All nodes
|
bdbSecondaryChannelSet
|
32-bit
bitmap
|
0x00000800 –
0x07fff800
|
0x07fff800 XOR
bdbPrimary-
ChannelSet
|
All nodes
|
值
|
描述
|
SUCCESS
|
The commissioning sub-procedure was successful.
子流程执行成功
|
IN_PROGRESS
|
One of the commissioning sub-procedures has
started but is not yet complete.
某个子流程在执行中
|
NOT_AA_CAPABLE
|
The initiator is not address assignment capable
during touchlink.
touchlink期间发起者不具备地址分配能力
|
NO_NETWORK
|
A network has not been found during network
steering or touchlink.
network steering or touchlink期间没发现网络
|
TARGET_FAILURE
|
A node has not joined a network when requested
during touchlink.
|
FORMATION_FAILURE
|
A network could not be formed during network
formation.
创建网络失败
|
NO_IDENTIFY_QUERY_-
RESPONSE
|
No response to an identify query command has been
received during finding & binding.
finding & binding期间没有收到identify query command响应
|
BINDING_TABLE_FULL
|
A binding table entry could not be created due to
insufficient space in the binding table during finding
& binding.
finding & binding期间由于绑定表满失败
|
NO_SCAN_RESPONSE
|
No response to a scan request inter-PAN command
has been received during touchlink.
|
NOT_PERMITTED
|
A touchlink (steal) attempt was made when a node
is already connected to a centralized security
network.
|
TCLK_EX_FAILURE
|
The Trust Center link key exchange procedure has
failed attempting to join a centralized security
network.
|
3.1 Top level
图4 top level 流程
3.2 Network steering
该过程分入网络情况下调用与非入网情况下调用,流程分别如图5与图6。
图5 已入网情况下的steering流程
图6 未入网steering流程
3.3 network formation
创建网络的方式,协调器需要支持,流程如图7。
图7 创建网络流程
3.4 finding & binding
该过程分intiator发起者端点与target目标端点,并使用到identify cluster中的属性,非0表示设备正处于finding & binding模式下。
3.4.1 initiator
initiator流程如图8.
图8 finding & binding initiator 流程
3.4.2 target 流程
target 端点流程如图9.
图9 finding & binding target流程
3.5 touchlink
touchlink本来为ZLL专属,特点像其名称一样:接触式连接。支持在initiator端点与target端点靠近时相互连接,并绑定,这个连接是双向的,即双方都可能为对方父节点。
3.5.1 touchlink initiator
图10 touchlink initiator流程
3.5.2 touchlink target
参考文档
[1]. 《ZigBee Home Automation Public Application Profile, v1.2》zigbee alliance
[2]. 《ZigBee Base Device Behavior Specification, v1.0》zigbee alliance
转载请注明出处:https://blog.csdn.net/jason_lm/article/details/80886617