Binding

For the purpose of data communication between applications running on different nodes, it may be useful to ‘bind’ the relevant source and destination endpoints. When data is subsequently sent from the source endpoint, it is automatically routed to the bound destination endpoint(s) without the need to specify a destination address. For example, a binding could be created between the temperature sensor endpoint on a thermostat node and the switch endpoint on a heating controller node. Details of a binding are held in a Binding table on the source node. Binding is introduced more fully in Section 3.6.2, where bindings are one-to-one, one-to-many or many-to-one.

This section describes setting up a Bind Request Server and how to bind together two nodes, as well as how to unbind them. Access to the Binding tables is also described.

Note: Where 64-bit IEEE/MAC addresses are used to identify remote nodes, the corresponding 16-bit network addresses must be available in the local Address Map - see Section 5.2.3.

Setting up bind request server

A Bind Request Server must be set up on each device that will be the source node of a bound data transfer. This server manages a bound data transfer so that application processing is not blocked by concurrent requests for transmissions to the multiple destinations of the transfer. It does this by limiting the number of destinations and inserting a time delay between consecutive transmissions of a bound transfer.

Note: The bound server can only handle one bound request at a time. The application must wait for the confirmation from the first bound request before attempting to send a second bound request.

The server is configured in the ZPS Configuration Editor (introduced in Chapter 13). Two parameter values must be set:

Simultaneous requests

This refers to the maximum number of destinations for a bound data transfer. The value set must be less than or equal to the value of the ZigBee network parameter Maximum Number of Simultaneous Data Requestsor Maximum Number of Simultaneous Data Requests with Acks, described in Section 11.7.

Parent topic:Setting up bind request server

Time interval

This refers to the time interval between consecutive transmissions to the different destinations of a bound data transfer and is measured in milliseconds.

In the ZPS Configuration Editor, these parameters are accessed by clicking on Bind Request Server under ZDO Configuration for the device (the parameters appear in the Properties tab of the bottom pane).

Note: The bound server can only handle one bound request at a time. The application must wait for the confirmation from the first bound request before attempting to send a second bound request.

Parent topic:Setting up bind request server

Parent topic:Binding

Binding endpoints

An endpoint on the local node can be bound to one or more endpoints on remote nodes using the following functions:

  • zps_eAplZdoBind() creates a one-to-one binding to a single remote endpoint.

  • zps_eAplZdoBindGroup() creates a one-to-many binding for which the destination endpoints are specified via a group address (refer to Section 5.3).

The function zps_eAplZdpEndDeviceBindRequest() is also provided, which allows an endpoint on one End Device to be bound to an endpoint on another End Device via the Coordinator. This function must be called on both End Devices, where the function call would typically be triggered by a user action such as pressing a button on the node. The function submits an End_Device_Bind_req request to the Coordinator, which replies with an End_Device_Bind_rsp response. The stack will then automatically update the Binding tables on the End Devices (as the result of bind requests from the Coordinator), and these updates will be indicated by a zps_EVENT_ZDO_BIND event on each of the End Devices.

Parent topic:Binding

Unbinding endpoints

Bindings can be removed using the following functions:

  • Two endpoints previously bound using zps_eAplZdoBind() can be unbound using the function zps_eAplZdoUnbind().

  • Endpoints previously bound using zps_eAplZdoBindGroup() can be unbound using the function zps_eAplZdoUnbindGroup().

Parent topic:Binding

Accessing binding tables

Information about established bindings is held in Binding tables on the relevant nodes. Normally, a Binding table is held on a node which contains at least one source endpoint for a binding - thus, the table includes entries for all bindings which involve source endpoints on the local node. Alternatively, the Binding table entries for a particular source node can be held in a primary Binding table cache on the node’s parent or another ascendant node. However, if a primary Binding table cache exists on an ascendant node, a source node can opt out of membership of this table by calling the function zps_eAplZdpBindRegisterRequest() to indicate that the source node will store its own Binding table entries locally.

Functions are provided which allow Binding tables to be remotely accessed and modified. These functions are particularly useful in implementing a commissioning tool application.

A binding can be remotely created or removed by requesting a modification to the relevant Binding table on a remote node. The remote Binding table may be a primary Binding table cache or the source node’s local Binding table, which is relevant for the particular binding.

  • The function zps_eAplZdpBindUnbindRequest() can be used to request that a new binding is added to a remote Binding table. The addition of this binding is signaled by a zps_EVENT_ZDO_BIND event on the remote node.

  • The function zps_eAplZdpBindUnbindRequest() can also be used to request that an existing binding is removed from a remote Binding table. The removal of this binding is signaled by a zps_EVENT_ZDO_UNBIND event on the remote node. A Binding table entry can also be removed locally using the function zps_eAplAibRemoveBindTableEntryForMacAddress(), which requests that the entry containing a particular IEEE/MAC address is deleted.

In addition, binding entries in a remote primary Binding table cache can be modified using the function zps_eAplZdpReplaceDeviceRequest(), to replace an IEEE/MAC address and/or endpoint number. This operation works on a ‘search and replace’ basis in the Binding table, and the address/endpoint number to be replaced could occur in the source or destination of one or more table entries.

The function zps_eAplZdpMgmtBindRequest() is also provided, which can be used to request the Binding table of a remote node.

Parent topic:Binding

Parent topic:Application coding with ZigBee PRO APIs