C !
I have the task to listen to serial data and decode them...
I installed an interrupt to get the serial data into an ringbuffer. On Overflow it stops.
The Basic-Routine listens to each new byte and checks, if it "goes the right way" (number, character, CR, Checksum...). After checking the complete command, the string will be interpreted...
And the next characters are coming into the ringbuffer.
After interpreting the string, the next few characters are checked...
I use a parser, which has a status-code (for each element of a command) and a small counter for each character inside this element. So I check every character and count until the next element...
Bookmarks