Digi International Inc XBEEPRO2 Manual Do Utilizador

Página de 155
XBee®/XBee‐PRO® ZB RF Modules 
© 2011 Digi International, Inc.
     69
Transmission Examples
Example 1: Send a unicast API data transmission to the coordinator using 64-bit address 0, with 
payload "TxData".
API Frame:
7E 0014  10 01 00000000 00000000 FFFE  00 00  54 78 44 61 74 61   AB
Field Composition:
0x0014 - length
0x10 - API ID (tx data)
0x01 - frame ID (set greater than 0 to enable the tx-status response)
0x00000000 00000000 - 64-bit address of coordinator (ZB definition)
0xFFFE - Required 16-bit address if sending data to 64-bit address of 0.
0x00 - Broadcast radius (0 = max hops)
0x00 - Tx options
0x54 78 44 61 74 61 - ASCII representation of "TxData" string
0xAB - Checksum (0xFF - SUM (all bytes after length))
Description:
This transmission sends the string "TxData" to the coordinator, without knowing the coordinator device's 64-bit 
address. A 64-bit address of 0 is defined as the coordinator in ZB firmware. If the coordinator's 64-bit address 
was known, the 64-bit address of 0 could be replaced with the coordinator's 64-bit address, and the 16-bit 
address could be set to 0.
Example 2 - Send a broadcast API data transmission that all devices can receive (including sleeping 
end devices), with payload "TxData".
API Frame:
7E 0014  10 01 00000000 0000FFFF FFFE  00 00  54 78 44 61 74 61   AD
Field Composition:
0x0014 - length
0x10 - API ID (tx data)
0x01 - frame ID (set to a non-zero value to enable the tx-status response)
0x00000000 0000FFFF - Broadcast definition (including sleeping end devices
0xFFFE - Required 16-bit address to send broadcast transmission.
0x00 - Broadcast radius (0 = max hops)
0x00 - Tx options
0x54 78 44 61 74 61 - ASCII representation of "TxData" string
0xAD - Checksum (0xFF - SUM (all bytes after length))
Description:
This transmission sends the string "TxData" as a broadcast transmission. Since the destination address is set to 
0xFFFF, all devices, including sleeping end devices can receive this broadcast. 
If receiver application addressing is enabled, the XBee will report all received data frames in the explicit format 
(0x91) to indicate the source and destination endpoints, cluster ID, and profile ID that each packet was received 
on. (Status messages like modem status and route record indicators are not affected.)
To enable receiver application addressing, set the AO command to 1 using the AT command frame (0x08). 
Here's how to do this:
API Frame:
7E 0005 08 01 414F 01 65
Field Composition:
0x0005 - length