API operation Sending ZigBee Cluster Library (ZCL) commands with the API
XBee/XBee-PRO ZigBee RF Modules User Guide 143
The ZCL defines a number of profile-wide commands that can be supported on any profile, also known as general
commands. These commands include the following:
The Explicit Transmit API frame (0x11) is used to send ZCL commands to devices in the network. Sending ZCL
commands with the Explicit Transmit API frame requires some formatting of the data payload field.
When sending a ZCL command with the API, all multiple byte values in the ZCL command (API Payload) (for
example u16, u32, 64-bit addresses) must be sent in little endian byte order for the command to be executed
correctly on a remote device.
Note When sending ZCL commands, the AO command should be set to 1 to enable the explicit receive API
frame. This will provide indication of the source 64- and 16-bit addresses, cluster ID, profile ID, and
endpoint information for each received packet. This information is required to properly decode received
data.
The following table shows how the Explicit API frame can be used to read the hardware version attribute from a
device with a 64-bit address of 0x0013A200 40401234 (unknown 16-bit address). This example uses arbitrary
source and destination endpoints. Recall the hardware version attribute (attribute ID 0x0003) is part of the basic
cluster (cluster ID 0x0000). The Read Attribute general command ID is 0x00.
Command (Command ID) Description
Read Attributes (0x00) Used to read one or more attributes on a remote device
Read Attributes Response (0x01) Generated in response to a read attributes command
Write Attributes (0x02) Used to change one or more attributes on a remote device
Write Attributes Response (0x04) Sent in response to a write attributes command
Configure Reporting (0x06) Used to configure a device to automatically report on the values of one or more
of its attributes
Report Attributes (0x0A) Used to report attributes when report conditions have been satisfied
Discover Attributes (0x0C) Used to discover the attribute identifiers on a remote device
Discover Attributes Response (0x0D) Sent in response to a discover attributes command
Frame Fields Offset Example Description
Start Delimiter
00x7E
Length
MSB 1 0x00
Number of bytes between the length and the
checksum
Frame-
specific
Data
LSB 2 0x19
Frame Type 3 0x11
Frame ID 4 0x01
Identifies the UART data frame for the host to
correlate with a subsequent transmit status.
If set to 0, no transmit status frame will be
sent out the UART.