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

toholio / ruby-serialport forked from tenderlove/ruby-serialport

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 17
    • 4
  • Source
  • Commits
  • Network (4)
  • Issues (0)
  • Downloads (0)
  • 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.

Ruby Serialport packed neatly into a gem. — Read more

  cancel

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

This URL has Read+Write access

Release version 0.7.2. 
toholio (author)
Tue Sep 02 05:45:08 -0700 2008
commit  611964448b8bec95b29733b355d926a2f24a451b
tree    7ff77217ab1435f5af840df8591223bd666ac591
parent  68ca823c0089d67865a1d2c51d59edc34ee84fa8
ruby-serialport /
name age
history
message
file CHANGELOG Tue Sep 02 05:45:08 -0700 2008 Release version 0.7.2. Updated gemspec and doc... [toholio]
file MANIFEST Sun Aug 31 17:21:22 -0700 2008 Update README and MANIFEST for GitHub hosting a... [toholio]
file README Tue Sep 02 05:45:08 -0700 2008 Release version 0.7.2. Updated gemspec and doc... [toholio]
file extconf.rb Tue Jul 08 09:47:14 -0700 2008 Moved source files to separate src directory. ... [dshipton]
directory lib/ Tue Jul 08 09:02:50 -0700 2008 Split out ruby code from C code. git-svn-id: ... [dshipton]
file serialport.gemspec Tue Sep 02 05:45:08 -0700 2008 Release version 0.7.2. Updated gemspec and doc... [toholio]
directory src/ Tue Sep 02 05:45:08 -0700 2008 Release version 0.7.2. Updated gemspec and doc... [toholio]
directory test/ Sat Mar 15 14:24:44 -0700 2008 Bump version and apply some svn props. git-sv... [dshipton]
README
-----Ruby/SerialPort-----

-- Description --

Ruby/SerialPort is a Ruby library that provides a class for using
RS-232 serial ports.  This class also contains low-level functions to
check and set the current state of the signals on the line.

The native Windows version of this library supports Microsoft's Visual C++
and Borland's C++ compilers.

-- Installation --

This gem is hosted at GitHub. Before you can install this, or any other GitHub gem you must
add it as a gem source:
  gem sources -a http://gems.github.com

Then you can install the gem as normal:
  sudo gem install toholio-serialport

-- Testing --

* test/miniterm.rb

Ruby's copy of miniterm.c !


-- API --

  **** Class SerialPort, Parent IO ****

    ** Class constants **

       VERSION -> aString (this release is "0.6")
       NONE, HARD, SOFT, SPACE, MARK, EVEN, ODD -> anInteger

    ** Class methods **

      * new(port_num [, modem_parameters]) -> aSerialPort
      * open(port_num [, modem_parameters]) -> aSerialPort
      * open(port_num [, modem_parameters]) {|aSerialPort| block} ->
                value of the block

        port_num -> anInteger: port number, 0 for first port which is
                      "/dev/ttyS0" on GNU/Linux and "COM1" on Windows,
                or  aString: file name of the device (example: "/dev/ttyS2")

        Optional modem_parameters:

        baudrate -> anInteger: from 50 to 256000, depends on platform.

        databits -> anInteger: from 5 to 8 (4 is allowed on Windows)

        stopbits -> anInteger: 1 or 2 (1.5 is not supported)

        parity -> anInteger: SerialPort::NONE, SerialPort::EVEN,
                  SerialPort::ODD, SerialPort::MARK, SerialPort::SPACE
                  (MARK and SPACE are not supported on Posix)

        Raise an argError on bad argument.

        SerialPort::new and SerialPort::open without a block return an
        instance of SerialPort.  SerialPort::open with a block passes
        a SerialPort to the block and closes it when the block exits
        (like File::open).


    ** Instance methods **

      * modem_params() -> aHash
      * modem_params=(aHash) -> aHash
      * get_modem_params() -> aHash
      * set_modem_params(aHash) -> aHash
      * set_modem_params(baudrate [, databits [, stopbits [, parity]]])

        Get and set the modem parameters.  Hash keys are "baud", "data_bits",
        "stop_bits", and "parity" (see above).

        Parameters not present in the hash or set to nil remain unchanged.
        Default parameter values for the set_modem_params method are:
        databits = 8, stopbits = 1, parity = (databits == 8 ?
        SerialPort::NONE : SerialPort::EVEN).

      * baud() -> anInteger
      * baud=(anInteger) -> anInteger
      * data_bits() -> 4, 5, 6, 7, or 8
      * data_bits=(anInteger) -> anInteger
      * stop_bits() -> 1 or 2
      * stop_bits=(anInteger) -> anInteger
      * parity() -> anInteger: SerialPort::NONE, SerialPort::EVEN,
          SerialPort::ODD, SerialPort::MARK, or SerialPort::SPACE
      * parity=(anInteger) -> anInteger

        Get and set the corresponding modem parameter.

      * flow_control() -> anInteger
      * flow_control=(anInteger) -> anInteger

        Get and set the flow control: SerialPort::NONE, SerialPort::HARD,
        SerialPort::SOFT, or (SerialPort::HARD | SerialPort::SOFT).

        Note: SerialPort::HARD mode is not supported on all platforms.
        SerialPort::HARD uses RTS/CTS handshaking; DSR/DTR is not
        supported.

      * read_timeout() -> anInteger
      * read_timeout=(anInteger) -> anInteger
      * write_timeout() -> anInteger
      * write_timeout=(anInteger) -> anInteger

        Get and set timeout values (in milliseconds) for reading and writing.
        A negative read timeout will return all the available data without
        waiting, a zero read timeout will not return until at least one
        byte is available, and a positive read timeout returns when the
        requested number of bytes is available or the interval between the
        arrival of two bytes exceeds the timeout value.

        Note: Read timeouts don't mix well with multi-threading.

        Note: Under Posix, write timeouts are not implemented.

      * break(time) -> nil

        Send a break for the given time.  

        time -> anInteger: tenths-of-a-second for the break.
        Note: Under Posix, this value is very approximate.

      * signals() -> aHash

        Return a hash with the state of each line status bit.  Keys are
        "rts", "dtr", "cts", "dsr", "dcd", and "ri".

        Note: Under Windows, the rts and dtr values are not included.

      * rts()
      * dtr()
      * cts()
      * dsr()
      * dcd()
      * ri() -> 0 or 1

      * rts=(0 or 1)
      * dtr=(0 or 1) -> 0 or 1

        Get and set the corresponding line status bit.

        Note: Under Windows, rts() and dtr() are not implemented.

-- License --

GPL

Guillaume Pierronnet <moumar@netcourrier.com>
Alan Stern <stern@rowland.harvard.edu>
Tobin Richard <tobin.richard@gmail.com>
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