Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenOptions ¶
type OpenOptions struct { // The name of the port, e.g. "/dev/tty.usbserial-A8008HlV". PortName string // The baud rate for the port. BaudRate uint // The number of data bits per frame. Legal values are 5, 6, 7, and 8. DataBits uint // The number of stop bits per frame. Legal values are 1 and 2. StopBits uint // The type of parity bits to use for the connection. Currently parity errors // are simply ignored; that is, bytes are delivered to the user no matter // whether they were received with a parity error or not. ParityMode ParityMode InterCharacterTimeout uint MinimumReadSize uint // Enable hardware flow control (CTS/RTS). HardwareFlowControl bool // Use to enable RS485 mode -- probably only valid on some Linux platforms Rs485Enable bool // Set to true for logic level high during send Rs485RtsHighDuringSend bool // Set to true for logic level high after send Rs485RtsHighAfterSend bool // set to receive data during sending Rs485RxDuringTx bool // RTS delay before send Rs485DelayRtsBeforeSend int // RTS delay after send Rs485DelayRtsAfterSend int }
OpenOptions is the struct containing all of the options necessary for opening a serial port.
type ParityMode ¶
type ParityMode int
Valid parity values.
const ( PARITY_NONE ParityMode = 0 PARITY_ODD ParityMode = 1 PARITY_EVEN ParityMode = 2 )
type Serial ¶
type Serial interface { io.ReadWriteCloser Flush() error SetBaudRate(baudRate uint) error SetReadTimeout(timeout time.Duration) error SetRTS(active bool) error SetDTR(active bool) error SetRTSDTR(rtsActive, dtrActive bool) error SetBreak(active bool) error }
func Open ¶
func Open(options OpenOptions) (Serial, error)
Open creates an Serial based on the supplied options struct.
Click to show internal directories.
Click to hide internal directories.