Hardware Reference
In-Depth Information
Digi provides a web-based utility that makes the manual assembly of packets easy; it's available at
http://ftp1.digi.com/support/utilities/digi_apiframes.htm . The utility calculates the errorsum and the
size bytes for any of the frame types, with a convenient layout of the byte field. To use this utility, select the frame ID
to be constructed.
1.
For this example, select the request transmit ( 0x10 ), and use the broadcast address of 0x00
00 00 00 00 00 FF FF for the 64-bit address and 0xFF FE for the 16-bit address.
2.
Leave the other options as they are and add the hexadecimal equivalent of “HELLO” to the
RF packet field ( 0x48 45 4C 4C 4F ).
3.
The button next to the packet field will build the packet that needs to be entered into the
packet assembly window of the X-CTU. The packet should appear as follows:
7E 00 13 10 01 00 00 00 00 00 00 FF FF FF FE 00 00 48 45 4C 4C 4F 7F
On the local module's side, the return packet is of frame type 0x8B and contains the 16-bit destination address,
the number of transmit retries, the delivery status, and the discovery status. If both broadcast addresses are used, the
16-bit network address will be 0xFF FE if the 64-bit address of the module was used in transmitting with the 0xFF FE
network address. The returned packet will have discovered the actual network address of the remote module. The
three bytes after the network address indicate status—if the values come back as zeros, then the transition succeeded
for the example packet.
The Arduino that has the receiving XBee connected should have echoed the packet to the screen. The packet
shows up in the serial program as the printable characters, making most of the packet unreadable, but the data
section should be a clearly readable “HELLO.” The packet received that is echoed is the reply packet with frame type
0x90 . This packet has no frame ID, the bytes after the frame type are the 64-bit and 16-bit addresses. The byte after
the network address and before the data is a status byte ; this byte provides the program with information that can be
valuable when dealing with this packet. The status byte is a sum of four possible options:
0x01 : Packet was acknowledged
0x02 : Packet was acknowledged and is a broadcast
0x20 : Packet is encrypted
0x40 : Packet was sent from an end device
So, for example, if the byte is sent from an end device with a broadcast, the byte will have a value of 0x22 .
The remaining bytes that complete the packet are the data and checksum.
Request Packets
Table 5-1 is a reference for the various packets that can be used to control the XBee modules. The frame name, the
frame type, a general description, and the frame data are provided. Remember that the frame type is the last byte of
the header, and following the frame data is the checksum.
 
Search WWH ::




Custom Search