How would you modify the message structure and checksum calculation?
hard🚀 Application Q9 of 15
Raspberry Pi - Serial UART Communication
You want to extend a serial protocol to include a command byte after the start byte and before the payload. The start byte is 0x01, command byte is 1 byte, payload is variable length, and end byte is 0x04. How would you modify the message structure and checksum calculation?
AMessage = start + payload + command + checksum + end; checksum covers entire message including start and end
BMessage = start + command + payload + end + checksum; checksum covers command and payload