ChelltonAlmeida:
I need to receive data through the arduino rx / tx serial port with the 9600 bus, which receives this information and stores it in an array or vector so that I can treat the data according to the protocol below, forgetting that it has special characters in it. start and end to inform you that you have started and completed the package:EXAMPLE (HEXADECIMAL LITERALS):
01 08 1F 0D 0B 08 02 10 21 06 30 00 00 86 20 FF 24 BE 2A 3D 10 24 00 00 00 00 00 20 FF FF 10 21 00 34 37 34 4F 10 21 40 040x01H - START FRAME
0x08H - MESSAGE INDICATOR ORIGINATED IN MTC-400
0x1FH - PARAMETER ADJUSTMENT TYPE ALERT
0x0DH - GMT TIME
....
.....
......
0x40H - CHECKSUM UNDERSTANDING SUM IN A VARIABLE BYTE TYPE OF ALL VALUES FROM 0x08H TO THE CHARACTER BEFORE CHECKSUM
0x04H - END OF FRAME
couple of of questions:
-
frame length: it is fixed? if no, is there a byte within the frame that indicates the frame size?
-
Start and End of Frame (0x01, 0x04): are they SOLELY used for just that ie these values are never present within the frame?