Idiom for async-reading lines from uart?

classic Classic list List threaded Threaded
1 message Options
Jorge Jorge
Reply | Threaded
Open this post in threaded view
|

Idiom for async-reading lines from uart?

Hi to all,

uart.read has a "*l" parameter, but when reading with a timeout there's no way of distingishing between a returned line and a partial read.
Other apis would return a nil on timeout when the expectad data hasn't arrived yet, but uart.read allways returns a string, and there's no signalling of whether a line is being returned or a timeout has occured.
How do you people deal with the "reading a line with a timeout" use case?

Thanks in advance.

Jorge