Skip to content
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
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

byteit101
Copy link

@byteit101 byteit101 commented Jul 22, 2019

(Note this PR is still WIP, and should NOT be merged until this check list is finished)

  • Wait for JRuby 9.2.9.0 to be released
  • Test on Mac OS X
  • Upload Arduino test spec for HUPCL tests
  • Fix API test spec to work on CI

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) or SerialPort#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)

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.
@sh7d
Copy link

sh7d commented Sep 3, 2019

Bump, JRuby 9.2.8.0 is released :)

@byteit101
Copy link
Author

Yea, sorry, 1/3 of the JRuby PRs didn't make it into .8. Will work on the other items now though

@ahorek
Copy link

ahorek commented Nov 6, 2019

JRuby 9.2.9.0 is released :)

@ignisf
Copy link

ignisf commented Jan 14, 2021

Sorry for bumping, but can we check if this can be merged now?

@hunterboerner
Copy link
Contributor

@deadprogram

@byteit101
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flush buffers Add blocking versions of read and write functions Disable DTR control signal on connect
5 participants