Rainbow Electronics MG260 User Manual

Page 240

Advertising
background image

FLYFOT-MG260-MODULE

Page: 240 / 246

This document is the sole and exclusive property of FLYFOT. Not to be distributed or divulged without
prior written agreement.

B7 B6 B5 B4 B3 B2 B1 B0
Start pattern → 0xAA
AT command length LSB
AT command pattern → 0x1D

AT

command

length MSB

AT command
Checksum

The 3 bytes of the header are:

Î

the first byte (0xAA) is used to identify the packet,

Î

the second byte represents the 8 LSB (Low Significant Bits) bits of the length of the AT command,

Î

the third byte is made of 2 parts :

- the 3 LSB bits are the 3 MSB (Most Significant Bits) bits of the length of the AT command,
- the 5 MSB bits (0x1D which equals to 0xE8 with the 3 bits offset) are used to identify an AT
command.
The maximum length of an AT command could be 2047 bytes which is greater than all the existing AT
commands.
The checksum is the addition (modulo 256) of all the transmitted bytes (header bytes and AT command
bytes).

Data packets

Like for AT commands, DATA are encapsulated into packets. These packets are composed of a header
(3 bytes), the data bytes and the checksum (1 byte) :

B7 B6 B5 B4 B3 B2 B1 B0
Start pattern → 0xDD
Data packet length LSB
Data packet type

Data packet length
MSB

Data bytes
Checksum

The 3 bytes of the header are:

Î

the first byte (0xDD) used to identify the packet,

Î

the second byte represents the 8 LSB bits of the length of the data field,

Î

the last byte is made of 2 parts :

- the 3 LSB bits represent the 3 MSB bits of the length of the data field,
- the 5 MSB bits represent the packet type.
Data packets can have different values according to the type of packet:

Î

0 . DATA packet : the packet contains the data to transmit on the radio link or received from the radio

link,

Î

1 . STATUS packet: the packet contains the status of SA, SB, X bits

(1)

and the break condition

coding as follow :

SA SB X BRK

RI Spare

Spare

Spare

Advertising