Preliminary attempt to implement an interface to the easy-to-use SimpleBLE (Bluetooth Low Energy) library in Ruby using the very nifty rice gem.
I'm reasonably far along now (actually, theoretically, this is fully-functional) and I'm only aware of one bug (which I'm pretty sure is in SimpleBLE). It's definitely not tested though, and I'm not happy yet with the code quality, nor confident in the feature set. I should publish it soon though to get feedback.
- See Known Issues just below
- Make tests (/ figure out how to mock bluetooth devices!)
- Create gem on rubygems, and automate building/packaging for different OSes
- Implement
rake-compiler
-compatible rake tasks for compiling gem - Forward all relevant configuration options to cmake somehow
- Implement
- See lots of tiny todos in the comments throughout my code (
grep -rIn TODO
should flag them all) - Documentation
- RBS file
-
For some reason, if ruby crashes (e.g. segfaults) while a device is connected, the device seems to be invisible to ruby once restarting, until one disconnects the bluetooth adapter from the device through other means
-
This won't package correctly if you try to turn it into a gem. Namely, you'll have to build the extension manually by doing the following (starting in the base directory):
$ bundle install $ cd ext/ruble $ bundle exec ruby extconf.rb $ mkdir build $ cd build $ cmake .. $ make $ make install
Install the gem and add to the application's Gemfile by executing:
$ bundle add RuBLE
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install RuBLE
TODO: Write usage instructions here
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/mvastola/RuBLE. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the RuBLE project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.