public
Description: A simple serial port library for Ruby
Homepage: http://github.com/Floppy/rb232
Clone URL: git://github.com/Floppy/rb232.git
rb232 /
name age message
file .gitignore Wed Aug 20 12:50:53 -0700 2008 add gem build task [Floppy]
file COPYING Sun Aug 17 16:23:01 -0700 2008 add license and documentation [Floppy]
file README Thu Oct 29 15:31:37 -0700 2009 Merge branch 'master' of github.com:Floppy/rb232 [Floppy]
file Rakefile Wed Aug 20 12:50:53 -0700 2008 add gem build task [Floppy]
directory examples/ Thu Oct 29 15:31:24 -0700 2009 require rubygems in example [Floppy]
file extconf.rb Thu Aug 21 15:30:21 -0700 2008 Show all C warnings, and fix the ones that appe... [Floppy]
directory lib/ Fri Aug 22 01:37:51 -0700 2008 Change text protocol for non-blocking reads. Re... [Floppy]
file rb232.gemspec Thu Feb 19 14:14:51 -0800 2009 Add support for baud rate of 57600 [Floppy]
directory spec/ Thu Oct 29 15:31:13 -0700 2009 Add support for hardware flow control flag [Floppy]
directory src/ Thu Oct 29 15:31:13 -0700 2009 Add support for hardware flow control flag [Floppy]
README
== RB232

A simple serial port library for Ruby.

Licensed under the MIT license (See COPYING file for details)

Author: James Smith (james@floppy.org.uk / http://www.floppy.org.uk)

Homepage: http://github.com/Floppy/rb232

Documentation: http://docs.github.com/Floppy/rb232

== ABOUT

This library is a simple serial port library for Ruby.

You may ask, why not just use ruby-serialport? Mainly because the GPL license
it is under is too restrictive for my purposes. This code is under the MIT
license, so you can do anything you like with it.

== INSTALLATION

1) Enable gems from github, if you haven't already done so (rubygems >= 1.2):
    > sudo gem sources -a http://gems.github.com

2) Install gem
    > sudo gem install Floppy-rb232

== STATUS

Currently you can read from a serial port, but not write back. The code is only 
tested on Linux - other unixes *may* work, Mac OSX *might* be ok, but Windows
is right out for now. Watch this space for further developments!

== USAGE

The following code will read a 10-character string from the specified port,
using the default port settings (9600/8/n/1/no flow control)

      @port = RB232::Port.new('/dev/ttyUSB0')
      message = @port.read_string(10)

You can provide alternative settings when you create a new port:

      RB232::Port.new('/dev/ttyS0', :baud_rate => 19200, 
                                    :data_bits => 7, 
                                    :parity => true, 
                                    :stop_bits => 2,
                                    :hardware_flow_control => true)

See http://github.com/Floppy/rb232/tree/master/spec/port_spec.rb or RB232::Port
documentation for more details.

If you are using a simple text protocol over RS232, you can use the
RB232::TextProtocol class to help you out. It automatically monitors the port
and splits messages up by detecting separator characters. See 
http://github.com/Floppy/rb232/tree/master/examples/listen.rb for an example of
how to use this class.