Calculate And Verify Checksums; Escaped Characters In Api Frames - Digi XTend vB DigiMesh XTP9B-DPM-001 User Manual

Radio frequency (rf) module
Table of Contents

Advertisement

Frame type is the API frame type identifier. It determines the type of API frame and
l
indicates how the Data field organizes the information.
Data contains the data itself. This information and its order depend on the what type of
l
frame that the Frame type field defines.
The Frame Type byte indicates which API messages the data bytes (Identifier-specific data) will contain.
Checksum
The value 0xFF minus the 8-bit sum of bytes from offset 3 to this byte. Checksum is the last byte of the
frame and helps test data integrity.
The device does not process frames sent through the serial interface with incorrect checksums, and
ignores their data.

Calculate and verify checksums

To 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. 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 will equal 0xFF.

Escaped characters in API frames

If operating in API mode with escaped characters (AP parameter = 2), when you send or receive an API
frame, you must escape (flag) specific data values so they do not interfere with data frame sequencing. In
API operating mode with escaped characters, you must escape the following data bytes:
XTend vB DigiMesh RF Module User Guide
API mode overview
62

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents