Documentation ¶
Index ¶
Constants ¶
View Source
const ( ParityModeNone = 0 ParityModeOdd = 1 ParityModeEven = 2 )
View Source
const ( ByteSize5 = 5 ByteSize6 = 6 ByteSize7 = 7 ByteSize8 = 8 )
View Source
const ( StopBits1 = 1 StopBits2 = 2 )
View Source
const PREFIX = "/dev/tty"
Variables ¶
This section is empty.
Functions ¶
func IsName ¶
IsName returns if name mathes the pattern for serial ports. This does not mean, that there is an actual serial port with this name currently active. Use IsPort to get this information.
func ListPortsShort ¶
func ListPortsShort() []string
func ListPortsShortLong ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(port string, baud Baud, byteSize ByteSize, parity ParityMode, stopBits StopBits, readTimeout time.Duration) (*Connection, error)
func OpenDefault ¶
OpenDefault calls Open with ByteSize8, ParityModeNone, StopBits1.
func (*Connection) Close ¶
func (conn *Connection) Close() error
func (*Connection) Drain ¶
func (conn *Connection) Drain() error
type ParityMode ¶
type ParityMode int
Click to show internal directories.
Click to hide internal directories.