Documentation
¶
Index ¶
- type Connector
- type SerialConnector
- func (sc *SerialConnector) Close()
- func (sc *SerialConnector) Config() serial.Config
- func (sc *SerialConnector) Open() error
- func (sc *SerialConnector) Port() serial.Port
- func (sc *SerialConnector) Read(terminator byte) ([]byte, error)
- func (sc *SerialConnector) ReadUntilCR() ([]byte, error)
- func (sc *SerialConnector) Write(bytes []byte) error
- type USBConnector
- func (uc *USBConnector) Close()
- func (uc *USBConnector) DeviceInfo() *hid.DeviceInfo
- func (uc *USBConnector) Open() error
- func (uc *USBConnector) Path() string
- func (uc *USBConnector) Read(terminator byte) ([]byte, error)
- func (uc *USBConnector) ReadUntilCR() ([]byte, error)
- func (uc *USBConnector) Write(bytes []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SerialConnector ¶
type SerialConnector struct {
// contains filtered or unexported fields
}
func NewSerialConnector ¶
func NewSerialConnector(config serial.Config) *SerialConnector
func (*SerialConnector) Close ¶
func (sc *SerialConnector) Close()
func (*SerialConnector) Config ¶
func (sc *SerialConnector) Config() serial.Config
func (*SerialConnector) Open ¶
func (sc *SerialConnector) Open() error
func (*SerialConnector) Port ¶
func (sc *SerialConnector) Port() serial.Port
func (*SerialConnector) ReadUntilCR ¶
func (sc *SerialConnector) ReadUntilCR() ([]byte, error)
func (*SerialConnector) Write ¶
func (sc *SerialConnector) Write(bytes []byte) error
type USBConnector ¶
type USBConnector struct {
// contains filtered or unexported fields
}
func NewUSBConnector ¶
func NewUSBConnector(path string) (uc *USBConnector, err error)
func (*USBConnector) Close ¶
func (uc *USBConnector) Close()
func (*USBConnector) DeviceInfo ¶
func (uc *USBConnector) DeviceInfo() *hid.DeviceInfo
func (*USBConnector) Open ¶
func (uc *USBConnector) Open() error
func (*USBConnector) Path ¶
func (uc *USBConnector) Path() string
func (*USBConnector) Read ¶
func (uc *USBConnector) Read(terminator byte) ([]byte, error)
TODO This should take timout as argument or set by config
func (*USBConnector) ReadUntilCR ¶
func (uc *USBConnector) ReadUntilCR() ([]byte, error)
func (*USBConnector) Write ¶
func (uc *USBConnector) Write(bytes []byte) error
Click to show internal directories.
Click to hide internal directories.