Categorygithub.com/bob-thomas/go-serial
modulepackage
0.0.0-20180319113759-0f9c45f81e71
Repository: https://github.com/bob-thomas/go-serial.git
Documentation: pkg.go.dev

# README

Build Status

github.com/bob-thomas/go-serial

A cross-platform serial library for go-lang.

Documentation and examples

See the godoc here: https://godoc.org/github.com/bob-thomas/go-serial

Development

If you want to contribute to the development of this library, you must clone this git repository directly into your src folder under src/github.com/bob-thomas/go-serial and checkout the branch v1.

cd $GOPATH
mkdir -p src/go.bug.st/
git clone https://github.com/bugst/go-serial.git -b v1 src/github.com/bob-thomas/go-serial
go test github.com/bob-thomas/go-serial

What's new in v1

There are some API improvements, in particular object naming is now more idiomatic, class names are less redundant (for example serial.SerialPort is now called serial.Port), some internal class fields, constants or enumerations are now private and some methods have been moved into the proper interface.

If you come from the version v0 and want to see the full list of API changes, please check this pull request:

https://github.com/bugst/go-serial/pull/5/files

License

The software is release under a BSD 3-clause license

https://github.com/bugst/go-serial/blob/v1/LICENSE

# Packages

Package enumerator is a golang cross-platform library for USB serial port discovery.
No description provided by the author

# Functions

GetPortsList retrieve the list of available serial ports.
Open opens the serial port using the specified modes.

# Constants

ErrorEnumeratingPorts an error occurred while listing serial port.
EvenParity enable even-parity check.
FunctionNotImplemented the requested function is not implemented.
InvalidDataBits the number of data bits is not valid or not supported.
InvalidParity the selected parity is not valid or not supported.
InvalidSerialPort the requested port is not a serial port.
InvalidSpeed the requested speed is not valid or not supported.
InvalidStopBits the selected number of stop bits is not valid or not supported.
MarkParity enable mark-parity (always 1) check.
NoParity disable parity control (default).
OddParity enable odd-parity check.
OnePointFiveStopBits sets 1.5 stop bits.
OneStopBit sets 1 stop bit (default).
PermissionDenied the user doesn't have enough priviledges.
PortBusy the serial port is already in used by another process.
PortClosed the port has been closed while the operation is in progress.
PortNotFound the requested port doesn't exist.
SpaceParity enable space-parity (always 0) check.
TwoStopBits sets 2 stop bits.

# Structs

Mode describes a serial port configuration.
ModemStatusBits contains all the modem status bits for a serial port (CTS, DSR, etc...).
PortError is a platform independent error type for serial ports.

# Interfaces

Port is the interface for a serial Port.

# Type aliases

Parity describes a serial port parity setting.
PortErrorCode is a code to easily identify the type of error.
StopBits describe a serial port stop bits setting.