FullDuplexSerialPlus methods
ke4pjw
Posts: 1,173
Is there a method in FullDuplexSerialPlus for receiving a single byte at a time? I need to capture binary serial data that may not have a CR in the packet. Is FullDuplexSerialPlus the best object to do this? Should I create my own method to do this?
Thanks in advance,
Terry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
Post Edited (ke4pjw) : 3/6/2010 9:54:30 PM GMT
Thanks in advance,
Terry
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry
Post Edited (ke4pjw) : 3/6/2010 9:54:30 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
If the packet is sent sequentially with little or no delay between bytes and does not always have a specific last byte such as <cr> I would use rxtime with a suitable delay time.
And like it says, if there is no byte available you get -1, and if there is then rxbyte contains the byte.
(as an aside, I needed another routine which would check if any bytes are available but not return the byte at that time. That is quite a simple routine, just a matter of seeing if rx_tail is equal to rx_head)
There are buffers in the serial code so data can be coming in and you can be reading it out asynchronously.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*