Versions in this module Expand all Collapse all v1 v1.0.0 Aug 23, 2019 Changes in this version + const EvenParity + const FIONREAD — darwin/amd64, linux/amd64 + const MarkParity + const NoParity + const OddParity + const OnePointFiveStopBits + const OneStopBit + const SpaceParity + const TwoStopBits + func GetPortsList() ([]string, error) — darwin/amd64, linux/amd64, windows/amd64 + type ModemStatusBits struct + CTS bool + DCD bool + DSR bool + RI bool + type Option func(p *Port) + func WithBaudrate(o int) Option + func WithDataBits(o int) Option + func WithHUPCL(o bool) Option + func WithParity(o Parity) Option + func WithReadTimeout(o int) Option + func WithStopBits(o StopBits) Option + func WithWriteTimeout(o int) Option + type Parity int + type Port struct + func Open(name string, opts ...Option) (*Port, error) + func (p *Port) Close() error + func (p *Port) GetModemStatusBits() (*ModemStatusBits, error) + func (p *Port) Read(b []byte) (int, error) + func (p *Port) ReadyToRead() (uint32, error) + func (p *Port) Reconfigure(opts ...Option) error + func (p *Port) ResetInputBuffer() error + func (p *Port) ResetOutputBuffer() error + func (p *Port) SetDTR(dtr bool) error + func (p *Port) SetFirstByteReadTimeout(t uint32) error + func (p *Port) SetRTS(rts bool) error + func (p *Port) SetReadTimeout(t int) error + func (p *Port) SetReadTimeoutEx(t, i uint32) error + func (p *Port) SetWriteTimeout(t int) error + func (p *Port) String() string + func (p *Port) Write(b []byte) (int, error) + type PortError struct + func (e PortError) Code() PortErrorCode + func (e PortError) EncodedErrorString() string + func (e PortError) Error() string + type PortErrorCode int + const ErrorEnumeratingPorts + const FunctionNotImplemented + const InvalidDataBits + const InvalidParity + const InvalidSerialPort + const InvalidSpeed + const InvalidStopBits + const InvalidTimeoutValue + const OsError + const PermissionDenied + const PortBusy + const PortClosed + const PortNotFound + const ReadFailed + const WriteFailed + type StopBits int