Serial receiving with timeout
Hi everybody,
Is possible received a string using Parallax Serial Terminal.spin object, with a timeout?
Regards,
Jaume Nogues
Barcelona
Spain
Is possible received a string using Parallax Serial Terminal.spin object, with a timeout?
Regards,
Jaume Nogues
Barcelona
Spain

Comments
It has 4 serial objects in one cog, but regarding timeouts, it has
The object has a large buffer, so I prefer to poll to see if anything is in the buffer
PUB rxavail(port) : truefalse '' Check if byte(s) available '' returns true (-1) if bytes available if long[noparse][[/noparse]@rx_tail][noparse][[/noparse]port] <> long[noparse][[/noparse]@rx_head][noparse][[/noparse]port] truefalse:=-1 else truefalse:=0and then get a byte and then check again if anything is there.
It is faster than waiting for timeouts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller