Data Bytes That Need To Be Escaped; Length; Frame Data - Digi XBee-PRO S3 User Manual

900hp/xsc rf modules
Hide thumbs Also See for XBee-PRO S3:
Table of Contents

Advertisement

Operate in API mode
Escape characters
When you are sending or receiving a UART data frame, specific data values must be escaped (flagged)
so they do not interfere with the data frame sequencing. To escape an interfering data byte, insert
0x7D and follow it with the byte to be escaped XOR'd with 0x20.

Data bytes that need to be escaped:

Byte
0x7E
0x7D
0x11
0x13
Example: Raw serial data before escaping interfering bytes:
0x7E 0x00 0x02 0x23 0x11 0xCB
0x11 needs to be escaped which results in the following frame:
0x7E 0x00 0x02 0x23 0x7D 0x31 0xCB
Note
In the previous example, the length of the raw data (excluding the checksum) is 0x0002 and the
checksum of the non-escaped data (excluding frame delimiter and length) is calculated as:
0xFF - (0x23 + 0x11) = (0xFF - 0x34) = 0xCB.

Length

The length field specifies the total number of bytes included in the frame's data field. Its two-byte
value excludes the start delimiter, the length, and the checksum.

Frame data

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.
The XBee-PRO 900HP RF Module supports the following API frames:
XBee®-PRO 900HP/XSC RF Modules
Description
Frame Delimiter
Escape
XON
XOFF
Length
API identifier
2
3
4
cmdID
LSB
Data bytes that need to be escaped:
Frame data
Identifier-specific Data
5
6
7
8
9
...
cmdData
Checksum
n
n+1
Single
byte
116

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee-pro s3b

Table of Contents