Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { SerialPort SerialConfig Network NetworkConfig Server bool }
Config provides the complete configuration
type LineEnding ¶
type LineEnding uint8
LineEnding defines a specific line ending mode
const ( // Raw line ending mode performs no transformation. // Data will NOT be sent or received on a line-by-line basis. Raw LineEnding = 0 // LF denotes that line endings should be LF (\n) only. // Data will be sent or received on a line-by-line basis. LF LineEnding = 1 // CR denotes that line endings should be CR (\r) only. // Data will be sent or received on a line-by-line basis. CR LineEnding = 2 // CRLF denotes taht line endings should be CRLF (\r\n). // Data will be sent or received on a line-by-line basis. CRLF LineEnding = 3 )
func (LineEnding) Bytes ¶
func (le LineEnding) Bytes() []byte
Bytes returns the line ending as a byte slice
func (LineEnding) String ¶
func (le LineEnding) String() string
type NetworkConfig ¶
type NetworkConfig struct {
Address string
}
NetworkConfig provides the network configuration
type ParityMode ¶
type ParityMode int
ParityMode represents the various serial device parity modes.
const ( // ParityNone - No parity bit ParityNone ParityMode = 0 // ParityOdd - Odd parity bit ParityOdd ParityMode = 1 // ParityEven - Even parity bit ParityEven ParityMode = 2 )
func (ParityMode) String ¶
func (p ParityMode) String() string
type SerialConfig ¶
type SerialConfig struct { Device string BaudRate uint Parity ParityMode DataBits uint StopBits uint FlowControl bool LineEndingForReading LineEnding LineEndingForWriting LineEnding }
SerialConfig provides the serial port configuration
Click to show internal directories.
Click to hide internal directories.