Api Serial Exchanges; At Command Frames - Digi XBee SX 868 User Manual

Radio frequency (rf) module
Hide thumbs Also See for XBee SX 868:
Table of Contents

Advertisement

Operate in API mode
To verify the checksum of an API frame:
1. Add all bytes including the checksum; do not include the delimiter and length.
2. If the checksum is correct, the last two digits on the far right of the sum equal 0xFF.
Example
Consider the following sample data packet: 7E 00 0A 01 01 50 01 00 48 65 6C 6C 6F B8+
Byte(s)
7E
00 0A
01
01
50 01
00
48 65 6C 6C 6F
B8
To calculate the check sum you add all bytes of the packet, excluding the frame delimiter 7E and the
length (the second and third bytes):
7E 00 0A 01 01 50 01 00 48 65 6C 6C 6F B8
Add these hex bytes:
01 + 01 + 50 + 01 + 00 + 48 + 65 + 6C + 6C + 6F = 247
Now take the result of 0x247 and keep only the lowest 8 bits which in this example is 0x47 (the two far
right digits). Subtract 0x47 from 0xFF and you get 0xB8 (0xFF - 0x47 = 0xB8). 0xB8 is the checksum for
this data packet.
If an API data packet is composed with an incorrect checksum, the XBee SX 868 RF Module will
consider the packet invalid and will ignore the data.
To verify the check sum of an API packet add all bytes including the checksum (do not include the
delimiter and length) and if correct, the last two far right digits of the sum will equal FF.
01 + 01 + 50 + 01 + 00 + 48 + 65 + 6C + 6C + 6F + B8 = 2FF

API serial exchanges

You can use the Frame ID field to assign an identifier to each outgoing API frame. This Frame ID, if
non-zero, can correlate between the outgoing frames and the associated responses.

AT command frames

The following image shows the API frame exchange that takes place at the interface when sending an
AT command request to read or set an XBee parameter. To disable the response, set the frame ID to 0
in the request.
XBee® SX 868 RF Module User Guide
Description
Start delimiter
Length bytes
API identifier
API frame ID
Destination address low
Option byte
Data packet
Checksum
API serial exchanges
164

Advertisement

Table of Contents
loading

Table of Contents