SerialDataParser sdp('^', '$', ',');
Not to be nit-picky but why have the delimiter at the end instead of the middle?
I say this because when your sending an encapsulated packet of data, you first see the StartOfData character '^'
, followed but the delimiter(s) ','
, and finally the EndOfData character '$'
. So why not keep it in the same format?
^CMD,val 1,val 2,val 3$
One other thing, does your library know what data its receiving? Can it determine if your sending mixed type data(floats, int char), or does it just split the incoming data into parts and the user must specify what to do with those parts?