Digi International Inc XBEEPRO2 Manual Do Utilizador

Página de 155
XBee®/XBee‐PRO® ZB RF Modules 
© 2011 Digi International, Inc.
     124
Sending ZigBee Cluster Library (ZCL) Commands with the API
The ZigBee Cluster Library defines a set of attributes and commands (clusters) that can be supported in multiple 
ZigBee profiles. The ZCL commands are typically required when developing a ZigBee product that will interoperate in 
a public profile such as home automation or smart energy, or when communicating with ZigBee devices from other 
vendors. Applications that are not designed for a public profile or for interoperability applications can skip this 
section.
The following table shows some prominent clusters with their respective attributes and commands.
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) (e.g. 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.
Cluster (Cluster ID)
Attributes (Attribute ID)
Cluster ID
Basic (0x0000)
Application Version (0x0001)
Hardware Version (0x0003)
Model Identifier (0x0005)
-Reset to defaults 
(0x00)
Identify (0x0003)
Identify Time (0x0000)
Identify (0x00)
Identify Query (0x01)
Time (0x000A)
Time (0x0000)
Time Status (0x0001)
Time Zone (0x0002)
Thermostat (0x0201)
Local Temperature (0x0000)
Occupancy (0x0002)
-Setpoint raise / lower 
(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.