Digi International Inc XBEEPRO2 Manual Do Utilizador

Página de 155
XBee®/XBee‐PRO® ZB RF Modules 
© 2011 Digi International, Inc.
     125
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.
Frame Fields
Offset Example
Description
A
P
I
 
P
a
c
k
e
t
Start Delimiter
0 0x7E
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.
64-bit 
Destination
Address
MSB 5 0x00
64-bit address of the destination device (big endian byte 
order). For unicast transmissions, set to the 64-bit 
address of the destination device, or to 
0x0000000000000000 to send a unicast to the 
coordinator. Set to 0x000000000000FFFF for broadcast.
6 0x13
7 0xA2
8 0x00
9 0x40
10 0x40
11 0x12
12 0x34
16-bit 
Destination
Network 
Address
MSB 13 0xFF
16-bit address of the destination device (big endian byte 
order). Set to 0xFFFE for broadcast, or if the 16-bit 
address is unknown. 
LSB 14 0xFE
Source 
Endpoint
15 0x41
Set to the source endpoint on the sending device. (0x41 
arbitrarily selected).
Destination 
Endpoint
16 0x42
Set to the destination endpoint on the remote device. 
(0x42 arbitrarily selected)
Cluster ID
MSB 17 0x00
Set to the cluster ID that corresponds to the ZCL 
command being sent.
0x0000 = Basic Cluster
LSB 18 0x00
Profile ID
MSB 19 0xD1
Set to the profile ID supported on the device. (0xD123 
arbitrarily selected).
LSB 20 0x23
Broadcast 
Radius
21 0x00
Sets the maximum number of hops a broadcast 
transmission can traverse. If set to 0, the transmission 
radius will be set to the network maximum hops value.
Transmit 
Options
22 0x00
All bits must be set to 0.
Data Payload
ZCL Frame 
Header
Frame Control
23 0x00
Bitfield that defines the command type and other relevant 
information in the ZCL command. See the ZCL 
specification for details.
Transaction 
Sequence 
Number
24 0x01
A sequence number used to correlate a ZCL command 
with a ZCL response. (The hardware version response 
will include this byte as a sequence number in the 
response.) The value 0x01 was arbitrarily selected.
Command ID
25 0x00
Since the frame control "frame type" bits are 00, this byte 
specifies a general command. Command ID 0x00 is a 
Read Attributes command.
ZCL Payload
Attribute ID
26 0x03
The payload for a "Read Attributes" command is a list of 
Attribute Identifiers that are being read. 
Note the 16-bit Attribute ID (0x0003) is sent in little 
endian byte order (0x0300). All multi-byte ZCL header 
and payload values must be sent in little endian byte 
order.
27 0x00
Checksum
28 0xFA
0xFF minus the 8 bit sum of bytes from offset 3 to this 
byte.