Finding and Binding
Finding and Binding mode allows a node in the network to pair with another network node - for example, a new lamp may pair with a controller device, to allow control of the lamp. The objective of this commissioning mode is to bind an endpoint on a new node to a compatible endpoint on a remote node in the network (depending on the supported clusters). Alternatively, the new node is added to a group of nodes that are collectively controlled.
If it is required on a node, enable Finding and Binding via the attribute u8bdbCommissioningMode.
In Finding and Binding, a node have one of two roles:
Initiator: This node either creates a (local) binding with a remote endpoint or requests that the remote endpoint is added to a group.
Target: This node identifies itself, and receives and responds to requests from the initiator.
The intended outcome is a pairing between the initiator and the target. Usually, the initiator is a controller device. The path followed by the Finding and Binding process depends on whether the local endpoint is an initiator or a target.
Initiator Node
Finding and Binding is started on an initiator node by calling the function BDB_eFbTriggerAsInitiator(). This function is called as the result of a user action on the node, such as a button-press. The initiator then remains in Finding and Binding mode for a fixed time-interval (in seconds) defined by the constant BDBC_MIN_COMMISSIONING_TIME. If Finding and Binding does not succeed within this time, the event BDB_EVENT_FB_TIMEOUT is generated and passed into the callback function APP_vBdbCallback().
Once Finding and Binding starts, the initiator node searches for target endpoints by broadcasting an Identify Query command periodically with a period (in seconds) defined through the macro BDB_FB_RESEND_IDENTIFY_QUERY_TIME.
Note: Before each broadcast attempt, the event BDB_EVENT_FB_NO_QUERY_RESPONSE is generated and passed into APP_vBdbCallback(). This event allows the application to exit the current Finding and Binding process (see below).
If the initiator receives an Identify Query response from a remote endpoint, the application must pass the ZCL event BDB_E_ZCL_EVENT_IDENTIFY_QUERY to the Base Device using the function BDB_vZclEventHandler(). This event allows the Base Device to gather information about the identifying device by sending a Simple Descriptor request to the relevant endpoint. If the requested Simple Descriptor is successfully received back, the callback function checks this descriptor for clusters that match those on the initiator. The application is notified of via a BDB_EVENT_FB_HANDLE_SIMPLE_DESC_RESP_OF_TARGET event passed into APP_vBdbCallback().
If there is at least one matching cluster, the initiator does one of the following:
If binding is required (indicated by the u16bdbCommissioningGroupID attribute being equal to 0xFFFF), the initiator adds the remote endpoint to the local Binding table (but should first request the IEEE/MAC address of the remote node).
If grouping is required (indicated by the u16bdbCommissioningGroupID attribute being equal to a 16-bit group address), the initiator requests that the target endpoint adds the group address to its Group Address table.
The application is notified of a successful binding or grouping via the following events:
For a binding:
BDB_EVENT_FB_BIND_CREATED_FOR_TARGET for success
BDB_EVENT_FB_ERR_BINDING_FAILED for failure
For a grouping:
BDB_EVENT_FB_GROUP_ADDED_TO_TARGET for success
BDB_EVENT_FB_ERR_GROUPING_FAILED for failure
At this point, the application can remotely stop identification mode (and therefore Finding and Binding) on the target node by calling the Identify cluster function eCLD_IdentifyCommandIdentifyRequestSend() to request that the identification mode period is set to zero.
A Finding and Binding process is stopped on the initiator endpoint using the function BDB_vFbExitAsInitiator(). This function is typically called in the callback function APP_vBdbCallback() as the result of a user action, such as a button-press or button-release.
Parent topic:Finding and Binding
Target Node
Finding and Binding is started on a target node by calling the function BDB_eFbTriggerAsTarget(). This function is called as the result of a user action on the node, such as a button-press.
The target node then uses the Identify cluster to put itself into identification mode for a fixed time period. This period (in seconds) is determined by u16IdentifyTime
, an Identify cluster attribute which is automatically set to the value of the constant BDBC_MIN_COMMISSIONING_TIME. In identification mode, the cluster responds to any received Identify Query commands, as well as other Finding and Binding commands. The node may also visually or audibly indicate that it is in identification mode. On exiting identification mode at the end of the above period, the cluster is no longer able to process Identify Query commands but the node is still able to service other commands from the initiator related to the binding/grouping. The Identify cluster is fully described in the ZigBee Cluster Library User Guide (JNUG3132).
A target node can be brought out of the Finding and Binding process in either of the following ways:
The local application can call the function BDB_vFbExitAsTarget() as the result of a user action, such as a button-press or button-release.
The remote application (on the initiator) can call the Identify cluster function eCLD_IdentifyCommandIdentifyRequestSend() to request that the identification mode period is set to zero. To indicate to the Base Device that the identification process has ended, the application must pass the ZCL event BDB_E_ZCL_EVENT_IDENTIFY to the Base Device using the BDB_vZclEventHandler() function. This allows the Base Device to exit the ‘Finding and Binding’ process on the target endpoint.
Parent topic:Finding and Binding
Parent topic:Network commissioning