-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SerialPortBuilder.timeout(Duration::MAX) gives "Invalid argument" #207
Comments
Thank you for spotting this issue @wxifze! At a first glance with a new test it looks like Windows is affected as well while macOS is not. On Linux, the error is caused by an actually negative timeout timespan computed from |
It looks conversions which do not work for large timeouts like This test fails on Linux when reading data:
This seems to be caused by the conversion of And it fails on Windows at configuring the timeout when opening the serial port:
Which seems to be caused by casting As we don't document any limits on the duration and recommend using |
Using a timeout of |
When serial port is created through
SerialPortBuilder
and.timeout()
is called with the argument set toDuration::MAX
, any attempt to read from the port returns an errorCustom { kind: Other, error: "Invalid argument" }
.Apparently there is no other way to set blocking read without a timeout.
Code to reproduce:
Environment:
/dev/ttyUSB0
: ID 1a86:7523 QinHeng Electronics CH340 serial converter/dev/tty
The text was updated successfully, but these errors were encountered: