linux-embedded-hal icon indicating copy to clipboard operation
linux-embedded-hal copied to clipboard

embedded_hal::serial::Read is not implemented as nonblocking

Open b-zee opened this issue 5 years ago • 0 comments

The embedded_hal::serial::Read trait defines its read method with a nb::Result. This suggests Read::read being nonblocking. But, linux_embedded_hal::Serial implements this trait by calling serial_unix::TTYPort::read which internally uses ppoll.

By default, the timeout passed to ppoll is 100ms, which results in read blocking for that amount of time. (Instead of immediately returning nb::Error::WouldBlock.)

b-zee avatar Nov 06 '20 16:11 b-zee