-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat: allow blocking read #185
base: main
Are you sure you want to change the base?
Conversation
cc @sirhcel |
Thank you for the PR! Yes, it does not need extra functions. But on the other hand switching from What about designating
And with the next release switching switching from |
What issue are you addressing with this PR in the first place @ARizzo35? I'm asking because the changes also include changing the default timeout used by I'm not trying to say that a default timeout of 0 ms is that what I would expect here. But that's the current default. Prepared some changes for keeping the current API while allowing to make changing to no timeout more explicitly expressed in https://github.com/sirhcel/serialport-rs/commits/blocking-read/. What's you opinion of timely providing a clean way of expressing no timeout and switching to a |
I am trying to add support for blocking read in |
Thank you for the context! So you are trying to read the available data after being notified? Are you switching the serial port to non-blocking for this task? If yes, using
Yes, the current default timeout is - lets say - somewhat special. I would have expected this to be blocking/no timeout on POSIX systems.
Yes, this is another annoyance with the current default. However, changing the default right now will likely break the somewhat special but expected behavior for other users. Therefor I would like to split things up: Allowing to specify no timeout now more explicitly in the short term. Switching the default behavior with the next major release and provide a cleaned up API for setting timeouts with this release. |
Sounds good to me! |
Fixes #12, similar to #50 but without the extra functions.