Documentation ¶
Index ¶
- Variables
- func FindPorts() []string
- type Dummy
- type Sender
- type Serial
- func (s *Serial) Configured() bool
- func (s *Serial) Mode() serial.Mode
- func (s *Serial) SendPositions(c <-chan xplane.Position, feedback chan<- string) error
- func (s *Serial) SetBaud(baud int)
- func (s *Serial) SetDataBits(dataBits int)
- func (s *Serial) SetParity(parity serial.Parity)
- func (s *Serial) SetPort(port string)
- func (s *Serial) SetStopBits(stopBits serial.StopBits)
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = slog.Default()
Logger is the default logger for the serial package
Functions ¶
Types ¶
type Dummy ¶
type Dummy struct {
Outputters []outputters.Outputter
}
Dummy is a dummy serial port This just logs the output to the logger
func (*Dummy) Configured ¶
Configured will return true if the serial port is configured
func (*Dummy) SendPositions ¶
SendPositions will send the positions from the channel to the serial port
type Sender ¶
type Sender interface { // SendPositions will send the positions from the channel wherever the Sender sends them, and send feedback to the feedback channel SendPositions(c <-chan xplane.Position, feedback chan<- string) error // Configured will return true if the serial port is configured Configured() bool // SetPort will set the serial port SetPort(string) // SetBaud will set the baud rate SetBaud(int) }
Sender is the interface for sending positions to a serial port
type Serial ¶
type Serial struct { Outputters []outputters.Outputter // contains filtered or unexported fields }
Serial is an object that will send positions to a serial port
func NewSerial ¶
func NewSerial(outputters []outputters.Outputter) *Serial
NewSerial returns a new Serial
func (*Serial) Configured ¶
Configured will return true if the serial port is configured
func (*Serial) SendPositions ¶
SendPositions will send the positions from the channel to the serial port
func (*Serial) SetDataBits ¶
SetDataBits will set the data bits
func (*Serial) SetStopBits ¶
SetStopBits will set the stop bits
Click to show internal directories.
Click to hide internal directories.