API operation
Byte(s)
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/XBee-PRO S1 802.15.4
(Legacy) 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 types
This field contains the information that a device receives or transmits. The structure of frame data
depends on the purpose of the API frame:
Start
delimiter
1
0x7E
MSB
The cmdID frame (API-identifier) indicates which API messages contains the cmdData frame
(Identifier-specific data). The device sends multi-byte values big endian format.
Modem Status frame - 0x8A
Description
Devices send the status messages in this frame in response to specific conditions.
XBee/XBee-PRO S1 802.15.4 (Legacy) User Guide
Description
API identifier
API frame ID
Destination address low
Option byte
Data packet
Checksum
Length
API identifier
2
3
4
cmdID
LSB
Frame data
Identifier-specific Data
5
6
7
8
9
...
cmdData
API types
Checksum
n
n+1
Single
byte
89