Ruby library for Windows API serial port communication based on http://grub.ath.cx/win32serial/
jeffrafter/win32-serial
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
== 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 < whitton@atlantic.net >. 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.
About
Ruby library for Windows API serial port communication based on http://grub.ath.cx/win32serial/
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published