-
Notifications
You must be signed in to change notification settings - Fork 72
Description
I'm not sure if this is pyserial-asyncio's issue or asyncio's but there seems to be no way to determine if the read buffer is empty.
If I understand correctly using the StreamReader returned from open_serial_connection(), await StreamReader.read(1) should return empty bytes if the buffer is empty (EOF) but in my case it awaits indefinitely if no bytes are ever received (returns as soon as a byte is received). await StreamReader.read() awaits forever even if bytes are received, so appears to be useless.
StreamReader.at_eof() is always False even after a freshly opened connection or after read() returns.
I'm on Windows and I read in another issue that the Windows implementation is non-optimal so I'm not sure if that's related. I haven't tested on other platforms.