Ruby library for Windows API serial port communication based on http://grub.ath.cx/win32serial/
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin Windows Release 0.5.1 Feb 23, 2009
doc Initial commit for git repository Feb 23, 2009
examples Preparing the release Feb 23, 2009
ext Reorganizing to prepare for gem push Feb 23, 2009
lib Preparing the release Feb 23, 2009
.gitignore Preparing the release Feb 23, 2009
Changelog Initial commit for git repository Feb 23, 2009
GPL Initial commit for git repository Feb 23, 2009
README Preparing the release Feb 23, 2009
Rakefile Preparing the release Feb 23, 2009
VERSION.yml
win32-serial.gemspec Windows Release 0.5.1 Feb 23, 2009
win32-serial.gemspec.windows Windows Release 0.5.1 Feb 23, 2009

README

== Win32Serial Extension Library (win32-serial)

Simple extension library to access Windows serial ports (COM ports) using the
Windows API. Originally written Apr. 10, 2006 by Travis Whitton 
< whitton@atlantic.net >

Gem conversion, organization and binary releases by Jeff Rafter. 

== Example

It is possible to use the library directly:

  require 'Win32Serial'
  port = 'COM1'
  s = Win32Serial.new
  s.open(port)
  s.config(9600, 8, Win32Serial::NOPARITY, Win32Serial::ONESTOPBIT)
  s.timeouts(0, 200, 0, 0, 0)
  bytes = s.write("AT+CGMI\r") || "< no bytes >"
  puts "#{bytes} bytes written to #{port}"
  puts "response " + (s.read(14) || " < no response >")
  s.close

A compatibility layer has been added which allows you to access the library
using a SerialPort class as well:

  require 'serialport'
  sp = SerialPort.new('COM1', 9600, 8, 1, SerialPort::NONE)
  sp.write("AT")
  sp.read(14)
  sp.close
  
In addition to write and read, getc is implemented for single byte reads. putc 
is also implemented for single byte writes.

== Installation

Assuming you have a development environment on the target Windows machine you
can simply install the Gem normally. Alternatively, binary gem releases are 
included in the bin folder and can be downloaded. These binary releases are
compiled using mingw and contain the Win32Serial.so, so no compilation on the
target Windows machine is necessary. These releases may not be compatible with
JRuby, Rubinius and other ruby implementations.

== License

Licensed under GPL. See GPL in the release.

== Copying

Original copying:

  Win32Serial extension library is copyrighted free software by Travis Whitton 
  &lt; whitton@atlantic.net &gt;. You can redistribute it under the terms 
  specified in the COPYING file of the Ruby distribution.

== Warranty 

Original warranty:

  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 
  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
  MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.