User's Manual

Advanced ID Asia Engineering Co., Ltd Page | 6
3 PACKET STRUCTURE
All exchanged packets follow the same structure as shown below:
Start Byte 1 Byte
Command
2 Byte
Length Start Byte 1 Byte
Length 1 Byte
Payload Start Byte 1 Byte
Payload Variable
Checksum Start Byte 1 Byte
Checksum
1 Byte
Start Byte: The start bytes are used to signalize the start of a new packet.
They are always 0x52, 0x46, 0x45 (ASCII: R, F, E).
Command1-2: The two command fields describe which command should be executed. These commands are
described in the chapter 5.
Length & Payload: These two fields contain the payload and the length of this packet. The length indicates the
count of characters in the payload field. If length is zero, the payload start byte and payload can / must be left out.
Checksum: The checksum is just a simple XOR connection of all data before.
All other start bytes are used to synchronize the protocol and to reduce the probability of the misinterpretation of
the byte sequence.
Example: (Save-Settings-Permanent)
52 46 45 01 0302 02 01 03 00 04 cs
Start bytes: appear in every message, except the payload start byte ( 0x03 )
commands: always appear in a row of two bytes
length: one byte, max length is 255
payload: includes data or parameter like modes, IDs, return results etc…
cs: checksum, xor conjunction of all preceding bytes of that messages