ZigBee Device Object (ZDO) Information

Macros

#define ZDO_MESSAGE_OVERHEAD 1
ZDO messages start with a sequence number.

Functions

EmberStatus emberIeeeAddressRequestToTarget ( EmberNodeId discoveryNodeId, bool reportKids, uint8_t childStartIndex, EmberApsOption options, EmberNodeId targetNodeIdOfRequest)

Service Discovery Functions

EmberStatus emberMatchDescriptorsRequest ( EmberNodeId target, uint16_t profile, EmberMessageBuffer inClusters, EmberMessageBuffer outClusters, EmberApsOption options)

Binding Manager Functions

EmberStatus emberEndDeviceBindRequest (uint8_t endpoint, EmberApsOption options)

Function to Decode Address Response Messages

EmberNodeId emberDecodeAddressResponse ( EmberMessageBuffer response, EmberEUI64 eui64Return)

Service Discovery Functions

EmberStatus emberNodeDescriptorRequest ( EmberNodeId target, EmberApsOption options)
Request the specified node to send its node descriptor. The node descriptor contains information about the capabilities of the ZigBee node. It describes logical type, APS flags, frequency band, MAC capabilities flags, manufacturer code and maximum buffer size. It is defined in the ZigBee Application Framework Specification.
EmberStatus emberPowerDescriptorRequest ( EmberNodeId target, EmberApsOption options)
Request the specified node to send its power descriptor. The power descriptor gives a dynamic indication of the power status of the node. It describes current power mode, available power sources, current power source and current power source level. It is defined in the ZigBee Application Framework Specification.
EmberStatus emberSimpleDescriptorRequest ( EmberNodeId target, uint8_t targetEndpoint, EmberApsOption options)
Request the specified node to send the simple descriptor for the specified endpoint. The simple descriptor contains information specific to a single endpoint. It describes the application profile identifier, application device identifier, application device version, application flags, application input clusters and application output clusters. It is defined in the ZigBee Application Framework Specification.
EmberStatus emberActiveEndpointsRequest ( EmberNodeId target, EmberApsOption options)
Request the specified node to send a list of its active endpoints. An active endpoint is one for which a simple descriptor is available.

Binding Manager Functions

EmberStatus emberBindRequest ( EmberNodeId target, EmberEUI64 source, uint8_t sourceEndpoint, uint16_t clusterId, uint8_t type, EmberEUI64 destination, EmberMulticastId groupAddress, uint8_t destinationEndpoint, EmberApsOption options)
Send a request to create a binding entry with the specified contents on the specified node.
EmberStatus emberUnbindRequest ( EmberNodeId target, EmberEUI64 source, uint8_t sourceEndpoint, uint16_t clusterId, uint8_t type, EmberEUI64 destination, EmberMulticastId groupAddress, uint8_t destinationEndpoint, EmberApsOption options)
Send a request to remove a binding entry with the specified contents from the specified node.

Node Manager Functions

EmberStatus emberLqiTableRequest ( EmberNodeId target, uint8_t startIndex, EmberApsOption options)
Request the specified node to send its LQI (neighbor) table. The response gives PAN ID, EUI64, node ID and cost for each neighbor. The EUI64 is only available if security is enabled. The other fields in the response are set to zero. The response format is defined in the ZigBee Device Profile Specification.
EmberStatus emberRoutingTableRequest ( EmberNodeId target, uint8_t startIndex, EmberApsOption options)
Request the specified node to send its routing table. The response gives destination node ID, status and many-to-one flags, and the next hop node ID. The response format is defined in the ZigBee Device Profile Specification.
EmberStatus emberBindingTableRequest ( EmberNodeId target, uint8_t startIndex, EmberApsOption options)
Request the specified node to send its nonvolatile bindings. The response gives source address, source endpoint, cluster ID, destination address and destination endpoint for each binding entry. The response format is defined in the ZigBee Device Profile Specification. Note that bindings that have the Ember-specific UNICAST_MANY_TO_ONE_BINDING type are reported as having the standard UNICAST_BINDING type.
EmberStatus emberLeaveRequest ( EmberNodeId target, EmberEUI64 deviceAddress, uint8_t leaveRequestFlags, EmberApsOption options)
Request the specified node to remove the specified device from the network. The device to be removed must be the node to which the request is sent or one of its children.
EmberStatus emberPermitJoiningRequest ( EmberNodeId target, uint8_t duration, uint8_t authentication, EmberApsOption options)
Request the specified node to allow or disallow association.
void emberSetZigDevRequestRadius (uint8_t radius)
Change the default radius for broadcast ZDO requests.
uint8_t emberGetZigDevRequestRadius (void)
Retrieve the default radius for broadcast ZDO requests.
uint8_t emberGetLastZigDevRequestSequence (void)
Provide access to the application ZDO transaction sequence number for last request. This function has been deprecated and replaced by emberGetLastAppZigDevRequestSequence() .
uint8_t emberGetLastAppZigDevRequestSequence (void)
Provide access to the application ZDO transaction sequence number for last request.

Device Discovery Functions

EmberStatus emberNetworkAddressRequest ( EmberEUI64 target, bool reportKids, uint8_t childStartIndex)
Request the 16 bit network address of a node whose EUI64 is known.
EmberStatus emberIeeeAddressRequest ( EmberNodeId target, bool reportKids, uint8_t childStartIndex, EmberApsOption options)
Request the EUI64 of a node whose 16 bit network address is known.

Service Discovery Functions

EmberStatus ezspMatchDescriptorsRequest ( EmberNodeId target, uint16_t profile, uint8_t inCount, uint8_t outCount, uint16_t *inClusters, uint16_t *outClusters, EmberApsOption options)

Binding Manager Functions

EmberStatus ezspEndDeviceBindRequest ( EmberNodeId localNodeId, EmberEUI64 localEui64, uint8_t endpoint, uint16_t profile, uint8_t inCount, uint8_t outCount, uint16_t *inClusters, uint16_t *outClusters, EmberApsOption options)
An end device bind request to the coordinator. If the coordinator receives a second end device bind request then a binding is created for every matching cluster.

Function to Decode Address Response Messages

EmberNodeId ezspDecodeAddressResponse (uint8_t *response, EmberEUI64 eui64Return)
Extracts the EUI64 and the node ID from an address response message.

Detailed Description

For getting information about nodes of a ZigBee network via a ZigBee Device Object (ZDO). See zigbee-device-library.h and zigbee-device-common.h for source code.

The ZDO library provides functions that construct and send several common ZDO requests. It also provides a function for extracting the two addresses from a ZDO address response. The format of all the ZDO requests and responses that the stack supports is described in stack/include/zigbee-device-stack.h . Since the library doesn't handle all of these requests and responses, the application must construct any other requests it wishes to send and decode any other responses it wishes to receive.

The request sending functions do the following:

  1. Construct a correctly formatted payload buffer.
  2. Fill in the APS frame with the correct values.
  3. Send the message by calling either emberSendBroadcast() or emberSendUnicast() .

The result of the send is reported to the application as normal via emberMessageSentHandler() .

The following code shows an example of an application's use of emberSimpleDescriptorRequest() . The command interpreter would call this function and supply the arguments.

void sendSimpleDescriptorRequest(EmberCommandState *state)
{
uint8_t targetEndpoint = emberUnsignedCommandArgument (state, 1);
targetEndpoint,
emberSerialPrintf(SERIAL_PORT, "emberSimpleDescriptorRequest failed\r\n" );
}
}

The following code shows an example of an application's use of emberDecodeAddressResponse() .

EmberApsFrame *apsFrame,
{
switch (apsFrame-> clusterId ) {
{
// Use nodeId and eui64 here.
break ;
}
default :
// Handle other incoming ZDO responses here.
}
} else {
// Handle incoming application messages here.
}
}

For getting information about nodes of a ZigBee network via a ZigBee Device Object (ZDO). See zigbee-device-host.h and zigbee-device-common.h for source code.

The ZDO library provides functions that construct and send several common ZDO requests. It also provides a function for extracting the two addresses from a ZDO address response. The format of all the ZDO requests and responses that the stack supports is described in stack/include/zigbee-device-stack.h . Since the library doesn't handle all of these requests and responses, the application must construct any other requests it wishes to send and decode any other responses it wishes to receive.

The request sending functions do the following:

  1. Construct a correctly formatted payload buffer.
  2. Fill in the APS frame with the correct values.
  3. Send the message by calling either ::ezspSendBroadcast() or ::ezspSendUnicast().

The result of the send is reported to the application as normal via ::ezspMessageSentHandler().

The following code shows an example of an application's use of emberSimpleDescriptorRequest() . The command interpreter would call this function and supply the arguments.

void sendSimpleDescriptorRequest(EmberCommandState *state)
{
uint8_t targetEndpoint = emberUnsignedCommandArgument (state, 1);
targetEndpoint,
emberSerialPrintf(SERIAL_PORT, "emberSimpleDescriptorRequest failed\r\n" );
}
}

The following code shows an example of an application's use of ezspDecodeAddressResponse() .

void ezspIncomingMessageHandler( EmberIncomingMessageType type,
EmberApsFrame *apsFrame,
uint8_t lastHopLqi,
int8_t lastHopRssi,
uint8_t bindingIndex,
uint8_t addressIndex,
uint8_t messageLength,
uint8_t *messageContents)
{
switch (apsFrame-> clusterId ) {
{
eui64);
// Use nodeId and eui64 here.
break ;
}
default :
// Handle other incoming ZDO responses here.
}
} else {
// Handle incoming application messages here.
}
}

Macro Definition Documentation

#define ZDO_MESSAGE_OVERHEAD   1

ZDO messages start with a sequence number.

Function Documentation

EmberStatus emberActiveEndpointsRequest ( EmberNodeId target,
EmberApsOption options
)

Request the specified node to send a list of its active endpoints. An active endpoint is one for which a simple descriptor is available.

Parameters
target The node whose active endpoints are desired.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberBindingTableRequest ( EmberNodeId target,
uint8_t startIndex,
EmberApsOption options
)

Request the specified node to send its nonvolatile bindings. The response gives source address, source endpoint, cluster ID, destination address and destination endpoint for each binding entry. The response format is defined in the ZigBee Device Profile Specification. Note that bindings that have the Ember-specific UNICAST_MANY_TO_ONE_BINDING type are reported as having the standard UNICAST_BINDING type.

Parameters
target The node whose binding table is desired.
startIndex The index of the first binding entry to include in the response.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberBindRequest ( EmberNodeId target,
EmberEUI64 source,
uint8_t sourceEndpoint,
uint16_t clusterId,
uint8_t type,
EmberEUI64 destination,
EmberMulticastId groupAddress,
uint8_t destinationEndpoint,
EmberApsOption options
)

Send a request to create a binding entry with the specified contents on the specified node.

Parameters
target The node on which the binding will be created.
source The source EUI64 in the binding entry.
sourceEndpoint The source endpoint in the binding entry.
clusterId The cluster ID in the binding entry.
type The type of binding, either UNICAST_BINDING , MULTICAST_BINDING , or UNICAST_MANY_TO_ONE_BINDING . UNICAST_MANY_TO_ONE_BINDING is an Ember-specific extension and should be used only when the target is an Ember device.
destination The destination EUI64 in the binding entry for UNICAST_BINDING or UNICAST_MANY_TO_ONE_BINDING .
groupAddress The group address for the MULTICAST_BINDING .
destinationEndpoint The destination endpoint in the binding entry for the UNICAST_BINDING or UNICAST_MANY_TO_ONE_BINDING .
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberNodeId emberDecodeAddressResponse ( EmberMessageBuffer response,
EmberEUI64 eui64Return
)

Extracts the EUI64 and the node ID from an address response message.

Parameters
response The received ZDO message with cluster ID NETWORK_ADDRESS_RESPONSE or IEEE_ADDRESS_RESPONSE .
eui64Return The EUI64 from the response is copied here.
Returns
Returns the node ID from the response if the response status was EMBER_ZDP_SUCCESS . Otherwise, returns EMBER_NULL_NODE_ID .
EmberStatus emberEndDeviceBindRequest ( uint8_t endpoint,
EmberApsOption options
)

An end device bind request to the coordinator. The simple descriptor of the specified endpoint is used to construct the request. If the coordinator receives a second end device bind request then a binding is created for every matching cluster.

Parameters
endpoint The endpoint on the local device whose simple descriptor will be used to create the request.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
uint8_t emberGetLastAppZigDevRequestSequence ( void )

Provide access to the application ZDO transaction sequence number for last request.

Returns
Last application ZDO transaction sequence number used
uint8_t emberGetLastZigDevRequestSequence ( void )

Provide access to the application ZDO transaction sequence number for last request. This function has been deprecated and replaced by emberGetLastAppZigDevRequestSequence() .

Returns
Last application ZDO transaction sequence number used
uint8_t emberGetZigDevRequestRadius ( void )

Retrieve the default radius for broadcast ZDO requests.

Returns
The radius to be used for future ZDO request broadcasts.
EmberStatus emberIeeeAddressRequest ( EmberNodeId target,
bool reportKids,
uint8_t childStartIndex,
EmberApsOption options
)

Request the EUI64 of a node whose 16 bit network address is known.

Parameters
target The network address of the node.
reportKids true to request that the target list their children in the response.
childStartIndex The index of the first child to list in the response. Ignored if reportKids is false.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value.
EmberStatus emberIeeeAddressRequestToTarget ( EmberNodeId discoveryNodeId,
bool reportKids,
uint8_t childStartIndex,
EmberApsOption options,
EmberNodeId targetNodeIdOfRequest
)
EmberStatus emberLeaveRequest ( EmberNodeId target,
EmberEUI64 deviceAddress,
uint8_t leaveRequestFlags,
EmberApsOption options
)

Request the specified node to remove the specified device from the network. The device to be removed must be the node to which the request is sent or one of its children.

Parameters
target The node which will remove the device.
deviceAddress All zeros if the target is to remove itself from the network or the EUI64 of a child of the target device to remove that child.
leaveRequestFlags A bitmask of leave options. Include LEAVE_REQUEST_REMOVE_CHILDREN_FLAG if the target is to remove their children and/or LEAVE_REQUEST_REJOIN_FLAG if the target is to rejoin the network immediately after leaving.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberLqiTableRequest ( EmberNodeId target,
uint8_t startIndex,
EmberApsOption options
)

Request the specified node to send its LQI (neighbor) table. The response gives PAN ID, EUI64, node ID and cost for each neighbor. The EUI64 is only available if security is enabled. The other fields in the response are set to zero. The response format is defined in the ZigBee Device Profile Specification.

Parameters
target The node whose LQI table is desired.
startIndex The index of the first neighbor to include in the response.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberMatchDescriptorsRequest ( EmberNodeId target,
uint16_t profile,
EmberMessageBuffer inClusters,
EmberMessageBuffer outClusters,
EmberApsOption options
)

Request the specified node to send a list of its endpoints that match the specified application profile and, optionally, lists of input and/or output clusters.

Parameters
target The node whose matching endpoints are desired. The request can be sent unicast or broadcast ONLY to the "RX-on-when-idle-address" (0xFFFD) If sent as a broadcast, any node that has matching endpoints will send a response.
profile The application profile to match.
inClusters The list of input clusters. To not match any input clusters, use EMBER_NULL_MESSAGE_BUFFER .
outClusters The list of output clusters. To not match any output clusters, use EMBER_NULL_MESSAGE_BUFFER .
options The options to use when sending the unicast request. See emberSendUnicast() for a description. This parameter is ignored if the target is a broadcast address.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberNetworkAddressRequest ( EmberEUI64 target,
bool reportKids,
uint8_t childStartIndex
)

Request the 16 bit network address of a node whose EUI64 is known.

Parameters
target The EUI64 of the node.
reportKids true to request that the target list their children in the response.
childStartIndex The index of the first child to list in the response. Ignored if reportKids is false.
Returns
An EmberStatus value.
EmberStatus emberNodeDescriptorRequest ( EmberNodeId target,
EmberApsOption options
)

Request the specified node to send its node descriptor. The node descriptor contains information about the capabilities of the ZigBee node. It describes logical type, APS flags, frequency band, MAC capabilities flags, manufacturer code and maximum buffer size. It is defined in the ZigBee Application Framework Specification.

Parameters
target The node whose node descriptor is desired.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberPermitJoiningRequest ( EmberNodeId target,
uint8_t duration,
uint8_t authentication,
EmberApsOption options
)

Request the specified node to allow or disallow association.

Parameters
target The node which will allow or disallow association. The request can be broadcast by using a broadcast address (0xFFFC/0xFFFD/0xFFFF). No response is sent if the request is broadcast.
duration A value of 0x00 disables joining. A value of 0xFF enables joining. Any other value enables joining for that number of seconds.
authentication Controls Trust Center authentication behavior.
options The options to use when sending the request. See emberSendUnicast() for a description. This parameter is ignored if the target is a broadcast address.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberPowerDescriptorRequest ( EmberNodeId target,
EmberApsOption options
)

Request the specified node to send its power descriptor. The power descriptor gives a dynamic indication of the power status of the node. It describes current power mode, available power sources, current power source and current power source level. It is defined in the ZigBee Application Framework Specification.

Parameters
target The node whose power descriptor is desired.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberRoutingTableRequest ( EmberNodeId target,
uint8_t startIndex,
EmberApsOption options
)

Request the specified node to send its routing table. The response gives destination node ID, status and many-to-one flags, and the next hop node ID. The response format is defined in the ZigBee Device Profile Specification.

Parameters
target The node whose routing table is desired.
startIndex The index of the first route entry to include in the response.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
void emberSetZigDevRequestRadius ( uint8_t radius )

Change the default radius for broadcast ZDO requests.

Parameters
radius The radius to be used for future ZDO request broadcasts.
EmberStatus emberSimpleDescriptorRequest ( EmberNodeId target,
uint8_t targetEndpoint,
EmberApsOption options
)

Request the specified node to send the simple descriptor for the specified endpoint. The simple descriptor contains information specific to a single endpoint. It describes the application profile identifier, application device identifier, application device version, application flags, application input clusters and application output clusters. It is defined in the ZigBee Application Framework Specification.

Parameters
target The node of interest.
targetEndpoint The endpoint on the target node whose simple descriptor is desired.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS , EMBER_NO_BUFFERS , EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY .
EmberStatus emberUnbindRequest ( EmberNodeId target,
EmberEUI64 source,
uint8_t sourceEndpoint,
uint16_t clusterId,
uint8_t type,
EmberEUI64 destination,
EmberMulticastId groupAddress,
uint8_t destinationEndpoint,
EmberApsOption options
)

Send a request to remove a binding entry with the specified contents from the specified node.

Parameters
target The node on which the binding will be removed.
source The source EUI64 in the binding entry.
sourceEndpoint The source endpoint in the binding entry.
clusterId The cluster ID in the binding entry.
type The type of binding, either UNICAST_BINDING , MULTICAST_BINDING , or UNICAST_MANY_TO_ONE_BINDING . UNICAST_MANY_TO_ONE_BINDING is an Ember-specific extension and should be used only when the target is an Ember device.
destination The destination EUI64 in the binding entry for the UNICAST_BINDING or UNICAST_MANY_TO_ONE_BINDING .
groupAddress The group address for the MULTICAST_BINDING .
destinationEndpoint The destination endpoint in the binding entry for the UNICAST_BINDING or UNICAST_MANY_TO_ONE_BINDING .
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value.
EmberNodeId ezspDecodeAddressResponse ( uint8_t * response,
EmberEUI64 eui64Return
)

Extracts the EUI64 and the node ID from an address response message.

Parameters
response The received ZDO message with cluster ID NETWORK_ADDRESS_RESPONSE or IEEE_ADDRESS_RESPONSE.
eui64Return The EUI64 from the response is copied here.
Returns
Returns the node ID from the response if the response status was EMBER_ZDP_SUCCESS. Otherwise, returns EMBER_NULL_NODE_ID.
EmberStatus ezspEndDeviceBindRequest ( EmberNodeId localNodeId,
EmberEUI64 localEui64,
uint8_t endpoint,
uint16_t profile,
uint8_t inCount,
uint8_t outCount,
uint16_t * inClusters,
uint16_t * outClusters,
EmberApsOption options
)

An end device bind request to the coordinator. If the coordinator receives a second end device bind request then a binding is created for every matching cluster.

Parameters
localNodeId The node ID of the local device.
localEui64 The EUI64 of the local device.
endpoint The endpoint to be bound.
profile The application profile of the endpoint.
inCount The number of input clusters.
outCount The number of output clusters.
inClusters The list of input clusters.
outClusters The list of output clusters.
options The options to use when sending the request. See emberSendUnicast() for a description.
Returns
An EmberStatus value. EMBER_SUCCESS, EMBER_NO_BUFFERS, EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY.
EmberStatus ezspMatchDescriptorsRequest ( EmberNodeId target,
uint16_t profile,
uint8_t inCount,
uint8_t outCount,
uint16_t * inClusters,
uint16_t * outClusters,
EmberApsOption options
)

Request the specified node to send a list of its endpoints that match the specified application profile and, optionally, lists of input and/or output clusters.

Parameters
target The node whose matching endpoints are desired. The request can be sent unicast or broadcast ONLY to the "RX-on-when-idle-address" (0xFFFD) If sent as a broadcast, any node that has matching endpoints will send a response.
profile The application profile to match.
inCount The number of input clusters. To not match any input clusters, set this value to 0.
outCount The number of output clusters. To not match any output clusters, set this value to 0.
inClusters The list of input clusters.
outClusters The list of output clusters.
options The options to use when sending the unicast request. See emberSendUnicast() for a description. This parameter is ignored if the target is a broadcast address.
Returns
An EmberStatus value. EMBER_SUCCESS, EMBER_NO_BUFFERS, EMBER_NETWORK_DOWN or EMBER_NETWORK_BUSY.