github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

Floppy / rb232

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 14
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A simple serial port library for Ruby — Read more

  cancel

http://github.com/Floppy/rb232

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Release 0.3.0, works with Snow Leopard 
James Smith (author)
Sun Nov 15 07:22:11 -0800 2009
commit  8ee30a3f2cfae3fa81e0ebb81c5bab6a63e11922
tree    f1031246a4f0acdeb35061eed46598b1c36e7981
parent  549403605c2d91a7a0fabd3c7b9ea2333387ccf0
rb232 /
name age
history
message
file .gitignore Loading commit data...
file COPYING
file README
file Rakefile
directory examples/
file extconf.rb
directory lib/
file rb232.gemspec
directory spec/
directory src/
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 gemcutter, if you haven't already done so:
    > sudo gem install gemcutter
    > sudo gem tumble

2) Install gem
    > sudo gem install rb232

== STATUS

Currently you can read from a serial port, but not write back. The code is only 
tested on Linux and Snow Leopard - other unixes *may* work, 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)

Note that OSX doesn't currently have hardware flow control support.

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.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server