rust-embedded/linux-embedded-hal

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

b-zee opened this issue · 0 comments

b-zee commented

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.)