Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Detect STX and ETX hex in received stringby jmlynesjr (Deacon) |
on Nov 28, 2012 at 23:08 UTC ( [id://1006125]=note: print w/replies, xml ) | Need Help?? |
Timely post as I am planning to do something similar using Device::Serialport::Arduino. I plan to process the message one character at a time probably using encode/decode. To allow variable length packets, add a data character count in the payload in case your data contains something that looks like an ETX and to help in detecting framing errors sooner rather than later. I am I the only one old enough to remember SYNSYNSYNSTXDATAETXCRC as IBM Bi-Sync protocol from the 70's? In this context STX and ETX are ASCII character codes. James There's never enough time to do it right, but always enough time to do it over...
In Section
Seekers of Perl Wisdom
|
|