I have looked all over the forum, but i didn't really find what i was looking for.
I need to parse a text string recieved on the serial port, and from the contents, decide what to do with it.
I send a text string on the serial port like
Some part of the program sees the "Start" word and jumps to a sub function, where the rest of the string is examined, if it contains 4 digits (e.g. 1135) it sets these numbers into two bytes (byte1 = 11) and (byte2 = 35)
How do i write code that parses this ? It should support various messages, and not be case-sensitive...
Checking for various commands recieved (e.g. Start, Status, On, Off) etc. - do i test the messages as a single string against a list, or a single character at a time ?
Any ideas to get me further ?