Practice / Hardware & Robotics
Parse framed packets in C
Hard · Coding (typed)
Packets arrive over UART as: 0xAA start byte, a length byte (1–32), that many payload bytes, then a checksum byte = (length + sum of payload) mod 256. Write parse_byte(uint8_t b) that is called for each received byte and returns true when a complete, valid packet is ready. It must recover from noise and dropped bytes.
Create a free account to answer it and get scored on what a strong answer covers.