Documentation ¶
Index ¶
Constants ¶
const ( ParityMark = Parity(unix.CMSPAR) ParitySpace = 0 )
Variables ¶
var ( // ErrDeviceNameEmpty happens when opening a device with empty name ErrDeviceNameEmpty = errors.New("device name should not be empty") )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(c *SerialPort) error
Option for serial conn options
func WithBaudRate ¶
WithBaudRate set serial baud rate default is 9600
func WithDataBits ¶
WithDataBits set the data bits for SerialPort available values are {5, 6, 7, 8} default is 8
func WithHardwareFlowControl ¶
WithHardwareFlowControl enable hardware flow control
func WithParity ¶
WithParity set parity mode available values are {ParityNone, ParityOdd, ParityEven} default is ParityNone
func WithReadTimeout ¶
WithReadTimeout set timeout timer for read operations if no read timeout set, use blocking read
func WithSoftwareFlowControl ¶
WithSoftwareFlowControl enable software flow control
func WithStopBits ¶
WithStopBits set stop bits for SerialPort port available values are {StopBitOne, StopBitOneHalf, StopBitTwo} default is StopBitOne
type SerialPort ¶
type SerialPort struct {
// contains filtered or unexported fields
}
SerialPort of serial
func (*SerialPort) File ¶
func (s *SerialPort) File() *os.File
File returns the underlying file handler for this serial port