hybridgroup / rubyserial

FFI Ruby library for RS-232 serial port communication
https://rubygems.org/gems/rubyserial
Other
154 stars 27 forks source link

Allow reading zero-bytes (0x00) using getbyte. #20

Closed donv closed 9 years ago

donv commented 9 years ago

We experienced getting nil instead of a zero byte when reading using getbyte.

Can this make the 0.2.2 release? :smile:

donv commented 9 years ago

Hi!

I see the tests fail in travis, but they succeed for me locally on Linux and OS X. Do they pass for you?

donv commented 9 years ago

Hi!

OK, travis build is green! Any chance this can be merged and released?

zankich commented 9 years ago

@donv ah yes so your source is sending you a null character, but rubyserial is passing it along as a ruby nil and not the 0x00. A similar change is required for the windows implementation so that we have consistent behavior between both platforms https://github.com/hybridgroup/rubyserial/blob/master/lib/rubyserial/windows.rb#L64

donv commented 9 years ago

@zankich yes. Do we need to fix it for windows before merging this PR?

zankich commented 9 years ago

@donv yes if you wouldn't mind making the change and then we can test to make sure the behavior is correct, thanks!

donv commented 9 years ago

Hi @zankich !

I do not have a Windows development environment, and I don't want to invest in that now. It would be great if you could add the fix for non-windows users, and a contributor on windows could fix it for windows.

Is that doable?

zankich commented 9 years ago

@donv yes I'll merge this now and get the windows fix in place, thanks for the pull request!

coveralls commented 8 years ago

Coverage Status

Changes Unknown when pulling a7b942e0a57a572fd335d92496069513847d0446 on donv:master into \ on hybridgroup:master**.