austinbv/dino — pull request #20 by vickash (2012-12-31 20:30:29+00:00)
Title: New TxRx class for connecting to an Arduino on a remote machine via Telnet

Using ser2net on a machine with an Arduino connected, you can share the Arduino's serial interface over the network connection. In most cases, combining a small Linux router (openwrt) with an Arduino is cheaper, and more useful, than buying a WiFi shield. This is a nice solution for making the Arduino standalone again while using dino.

I've written a new TxRx class, `Dino::TxRx::Telnet`, that uses the native Ruby telnet library to connect to a remote Arduino instead of a local serial port. It's completely interchangeable with the original TxRx class, so once you're connected everything else works exactly the same.

There's an example at `examples/telnet.rb` with basic instructions on how to set up ser2net with an Arduino at the top.

I've made `TxRx` into a module, and renamed the original TxRx class to `Dino::TxRX::Serial`, since there are quite a few more TxRx classes we could add, so this seems to make more sense to me.

Lastly, I've added a `new` method to the `TxRx` module that basically aliases to `TxRx::Serial.new`, preventing existing code, including the examples, from breaking.