Checksum - Digi XBee Zigbee Mesh Kit User Manual

Radio frequency (rf) module
Table of Contents

Advertisement

Start
delimiter
Length
1
2
0x7E
MSB
Note
MSB represents the most significant byte, and LSB represents the least significant byte.
Frame type is the API frame type identifier. It determines the type of API frame and indicates how the information is organized in the Data field.
n
Data contains the data itself. The information included here and its order depends on the type of frame defined in the Frame type field.
n

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,
excluding the first three bytes (start delimiter and length).
Note
Frames sent through the serial interface with incorrect checksums will never be processed by the module and the data will be ignored.
Calculate the checksum of an API frame
1. Add all bytes of the packet, excluding the start delimiter 0x7E and the length (the second and third bytes).
2. From the result, keep only the lowest 8 bits.
3. Subtract this quantity from 0xFF.
Example: Checksum calculation
To calculate the checksum for the given frame:
Frame Data
Start Delimiter Length
Frame type Data
7E
00
0F
17
Frame data
Frame
type
Data
3
4
5
API
LSB
Frame-type-specific data
frame
type
01 00 13 A2 00 40 AD 14 2E FF FE 02 44 42 -
6
7
8
9
...
Checksum
Checksum
n
n+1
Single
byte

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the XBee Zigbee Mesh Kit and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents