Messenger

 

Messenger
Messenger is a "toolkit" that facilitates the parsing of ASCII messages. Messenger buffers characters until it receives a carriage return (CR). It then considers the message complete and available. The message is split into many elements as defined by a separator. The default separator is the space character, but can be any character other than NULL, LF or CR.

process()
Check if a message has been completed and is available.

attach()
Attaches a callback function that is executed once a message is completed.

available()
Check if there are any element available in the message.

readInt()
Return the current element as an int.

readLong()
Return the current element as an long.

readChar()
Return the current element as an char.

copyString()
Copies the element as a string into the array pointed by the target char array.

checkString()
Compares the element to the string toCheck.