RX / TX Data - ARDUINO + PROTOCOL

Introduction

For serial or GPRS transmission, the characters 01h, 04h, 10h, 11h and 13h contained in the data are converted to the 10h character followed by the forbidden character added to 20h, after which the checksum is calculated;

Conversion of special characters also applies to checksum; the command structure for serial or GPRS sending via tcp / ip protocol always follows the following format:

image;

0x01h - Frame start
0x00h - Reserved
0xyyyyh - Word (16 bits) with key for ack of the command in case of
transmission by GPRS. Each new command sent to the equipment or retenta-
must have a different key than the previous command or attempt. Otherwise, the
The machine will not execute the command and disconnect itself, then initiate a
new GPRS connection. For serially sent commands there is no need to
key variation for confirmation, which should be 0x0000h.
0xyyh - byte (8 bits) identifier of the command type.
0xyyyyyyyyyyh - Equipment ID (ASCII) - unique id of the ascii equipment (5
bytes). For the command to be sent, it needs to be in hexadecimal,
this conversion only the last 5 numbers of the equipment ID are used.
Example:
Equipment ID: 530954
Five last numbers: 30954 the numbers are converted according to the table
ASCII.
30954 in hexadecimal: 3330393534
Command: 0x3330393534h
0xYYH - command parameter, if any, of variable size.
0xyyh - byte-type checksum, comprising the least significant byte of the sum of
all characters from the character after the beginning of the frame, to the character
previous to the checksum.
0x04h - End of frame.