User's Guide

16
Communication protocol
A message sent must begin with 0x24 0x24 and end with 0x0D 0x0A. In addition, it must contain a size,
8 bits checksum, the message type used and the type of encryption used."
Table 1: example of a simplified type of message"
In the example on Table 1, byte[1 & 2] are the sync characters which are alway, whether in simplified or
advanced mode, $$."
byte[3] Length: "
This byte is a computation of the size of the payload the msgType and itself."
byte[4] Msg Type & Encryptio: "
This byte is created by mixing the binary values [MSB 1bits Advanced=1 Simplified=0][LSB 7 bits
Encryption Type]"
Exemple:
Encryption_Type = 0x01;"
Msg_Type = 0x01;"
byte[4] = Msg_Type<<7 + Encryption_Type;"
##byte[4] = 0x81"
Please see MsgType and Encryption type section for more infos.
byte[n-3] Checksum:
The checksum is calculated over payload using and 8 bits exclusive or (XOR) sequence. It is done prior
to encryption and include payload type. "
byte[n-2] & byte [n-1] Ender:
Each message must be terminated by \r\n (0x0D, 0x0A). This allowes both packet end but also
correlation of length on which if both values are not equals, message is discarded."
sync
sync
length
msg type +
encryption
Payload
type
Data
Data
Data
Data
0x24
0x24
0x0F
0x00
0x02
0x41
0x41
0x41
0x41
Data
Data
Data
Data
Data
checksum
Byte termination
Byte termination
0x48
0x45
0x4C
0x4C
0x4F
0x40
0x0D
0x0A