-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use native IO objects & support blocking IO #50
Open
byteit101
wants to merge
8
commits into
hybridgroup:master
Choose a base branch
from
byteit101:ffi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds proper async IO, but breaks API compatibility because I renamed BAUDE_RATE to BAUD_RATE. Adds SerialPort compatibility class. Requires patches to work on JRuby prior to 9.2.8.0 on Windows.
Also kill socat when we are done with it
Bump, JRuby 9.2.8.0 is released :) |
Yea, sorry, 1/3 of the JRuby PRs didn't make it into .8. Will work on the other items now though |
JRuby 9.2.9.0 is released :) |
Sorry for bumping, but can we check if this can be merged now? |
Right, I think the only thing left was the windows jenkins run having issues. Unfortunately, I haven't had easy access to windows machines recently. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Note this PR is still WIP, and should NOT be merged until this check list is finished)
This PR ditches the FFI calls to open & close in favor of using IO::for_fd so that we can use normal IO blocking & nonblocking methods. It still requires a bit of funkyness on windows, but it is working with MRI, and JRuby 9.2.8.0.dev + patches. This will fix #25 for the blocking, and will fix #36 as IO#flush works correctly out of the box now.
As part of this, I did some clean up of the API, and unfortunately this has some breaking changes for exceptions and return types. I went the safe way to minimize harm, but I still bumped the version to be cautious. Not sure if that's a good idea or not? Feedback greatly appreciated on that.
Third, I added lots of yard doc to all methods.
Fourth, I added a SerialPort class that enables compatibility on par with what the readme suggested already existed, but didn't quite.
Fifth, I added support for the HUPCL flag (Windows via
DtrControl
) to fix #15.Serial#reconfigure(hupcl: true|false)
orSerialPort#hupcl= true|false
Sixth, I added a bunch more tests for HUPCL & general API stuff. Unfortunately I couldn't figure out a way to do this without a second program, so 1/3 of the tests now depend on an arduino project, though they are skipped if not detected.
That's all for now. The patches for JRuby are jnr/jnr-enxio:master and jruby/jruby#5774 branch https://github.com/byteit101/jruby/tree/winio)