This Ruby gem can be used to talk to a WiFly RN-XV device at a specified address. The gem has no dependencies other than the socket libraries that ship with any Ruby installation.
Add this line to your application's Gemfile:
gem 'wifly'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wifly
Create a client by passing in the host and port
control = Wifly::Control.new('192.168.1.45', 2000)
Read the high pins:
control.high_pins # [3,7,9,15]
Set a pin to high or low:
control.set_high(5)
control.high_pins # [3,5,7,9,15]
control.set_low(7)
control.high_pins # [3,5,9,15]
Read a single pin:
control.read_pin(7) # 0
control.read_pin(5) # 1
- Fork it
- 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 new Pull Request