Still at beginning of the Work. Currently not usable TODO: Write a gem description
Add this line to your application's Gemfile:
gem 'hdlcd_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hdlcd_client
The library is written with the goal to provide an easy interface to an already running HDLCd. The following examples show simple code for some common use-cases.
HdlcdClient.open('/dev/ttyUSB0') do |dev|
dev.each_packet do |packet|
puts packet # human friendly output
payload = packet.payload # do something with it
end
end
HdlcdClient.open('/dev/ttyUSB0') do |dev|
dev.lock
sleep 10 # do something different with the port
dev.release
sleep 1
puts dev.port_status.inspect
end
HdlcdClient.open('/dev/ttyUSB0') do |dev|
dev.port_status_changed do |new_port_status|
puts new_port_status.inspect
end
end
See {HdlcdClient} module description and take a look at the classes for tips for more advantage usage.
See http://www.rubydoc.info/github/ahanak/hdlcd_client/master
$ rake spec
- Fork it ( https://github.com/ahanak/hdlcd_client/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