connector

package
v0.0.0-...-df4ccbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Open() error
	Close()
	ReadUntilCR() ([]byte, error)
	Read(terminator byte) ([]byte, error)
	Write(bytes []byte) error
}

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) Read

func (sc *SerialConnector) Read(terminator byte) ([]byte, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL