
Operate in API mode
Calculate and verify checksums
Digi XBee Cellular LTE Cat 1 Embedded Modem User Guide
72
n
Frame type
is the API frame type identifier. It determines the type of API frame and indicates
how the Data field organizes the information.
n
Data
contains the data itself. This information and its order depend on the what type of frame
that the Frame type field defines.
Checksum
Checksum is the last byte of the frame and helps test data integrity. It is calculated by taking the hash
sum of all the API frame bytes that came before it, except the first three bytes (start delimiter and
length).
Calculate and verify checksums
To calculate the checksum of an API frame:
1. Add all bytes of the packet, except the start delimiter 0x7E and the length (the second and
third bytes).
2. Keep only the lowest 8 bits from the result.
3. Subtract this quantity from 0xFF.
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.