DEPRECATED - Em::Rubyserial
Deprecating this project because I have not maintained it in a long time, and do not have the time or need to do so any longer.
EventMachine serial port functionality that should work on all* ruby flavors (including MRI, jruby; and various operating systems including linux, windows, and apple)
(* for some values of all)
Uses the following gem for serial port connectivity: https://github.com/hybridgroup/rubyserial
Essentially copies this gem: https://github.com/railsbob/em-serialport
but replaces the serialport gem with the rubyserial gem, and does some file descriptor handling.
There is currently as of this writing no license on the em-serialport gem, so hopefully this amount of attribution is satisfactory.
Installation
Add this line to your application's Gemfile:
gem 'em-rubyserial'
And then execute:
$ bundle
Or install it yourself as:
$ gem install em-rubyserial
Usage
EM.run do
serial = EventMachine.open_serial('/dev/ttyS2', 9600, 8)
serial.send_data "foo"
serial.on_data do |data|
puts data
end
end
Contributing
- Fork it ( https://github.com/jcantara/em-rubyserial/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request