Versions in this module Expand all Collapse all v1 v1.0.1 Oct 19, 2023 Changes in this version + var NoTimeout time.Duration = -1 + func GetPortsList() ([]string, error) + type Mode struct + BaudRate int + DataBits int + InitialStatusBits *ModemOutputBits + Parity Parity + StopBits StopBits + type ModemOutputBits struct + DTR bool + RTS bool + type ModemStatusBits struct + CTS bool + DCD bool + DSR bool + RI bool + type Parity int + const EvenParity + const MarkParity + const NoParity + const OddParity + const SpaceParity + type Port interface + Break func(time.Duration) error + Close func() error + Drain func() error + GetModemStatusBits func() (*ModemStatusBits, error) + Read func(p []byte) (n int, err error) + ResetInputBuffer func() error + ResetOutputBuffer func() error + SetBufferSize func(txSize, rxSize int) error + SetDTR func(dtr bool) error + SetMode func(mode *Mode) error + SetRTS func(rts bool) error + SetReadTimeout func(t time.Duration) error + Write func(p []byte) (n int, err error) + func Open(portName string, mode *Mode) (Port, 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 InvalidBufferSize + const InvalidDataBits + const InvalidParity + const InvalidSerialPort + const InvalidSpeed + const InvalidStopBits + const InvalidTimeoutValue + const PermissionDenied + const PortBusy + const PortClosed + const PortNotFound + type StopBits int + const OnePointFiveStopBits + const OneStopBit + const TwoStopBits