A Dovado Router API for Ruby.

This project lives on Bitbucket: bitbucket.org/janlindblom/ruby-dovado and is published on RubyGems: rubygems.org/gems/ruby-dovado.

Build Status Gem Documentation License

✨ Development branch documentation: janlindblom.se/docs/ruby-dovado, generated manually whenever I've done something new on the development branch. ✨

This library serves to enable easy access to the built in, Telnet-based, rudimentary API of the routers from Dovado running software version 7 and 8 (applies to the original Tiny, Go and Pro routers). It might work with the Tiny AC too but I have no means to test against that.

Purpose

The original purpose of this library was to enable addition of router information about connection state, mobile data connection quality and data quota usage on a wall-mounted TV or a small touch screen connected to a Raspberry Pi, accessing a dashboard implemented using Dashing.

Usage

Add it to your Gemfile:

gem "ruby-dovado"

They load it in your code:

require "dovado"

router = Dovado::Router.new(address: "192.168.0.1", user: "admin", password: "password")
router.info
router.sms.load_messages
message = router.sms.get_message 12

The main elements available on the Dovado::Router object are:

For the full documentation, head over to rubydoc.info.

Design Considerations

Since the API published by these routers is Telnet-based, it stands to reason to limit simultaneous connections. This is achieved by a single client object implemented as a Celluloid Actor. The reason for this is because Celluloid Actor objects can be supervised, block threads and be accessed from multiple threads simultaneously without the need to implement any special locking or waiting mechanisms.

Additionally, all replies are cached internally to limit the number of calls to the router API. This is done because the API is rather slow which would make any calls using this library wait for several seconds for a reply. These replies are cached inside Celluloid actors so that multiple, seemingly parallel requests will get the same response object. Caching can be overridden by forcing the call through to the router. Otherwise, the reply becomes invalid within a couple of seconds so that the next call will go through to the router and fetch any updates. Think of it as a cheap rate-limiter.

Ruby-Dovado © 2015 by Jan Lindblom. Ruby-Dovado is licensed under the MIT license.

The Dovado, Dovado Tiny, Dovado Go, Dovado Tiny AC et.al brands are © 2004 - 2015 Dovado FZ-LLC.

The library is neither endorsed nor supported by Dovado.