Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotOpenDevice = errors.New("unable to open device tty")
View Source
var ErrCannotSetBaudRate = errors.New("unable to set baud rate")
View Source
var ErrCannotSetDiskImage = errors.New("unable to set disk image")
View Source
var ErrDeviceInUse = errors.New("device is in use")
basic errors
View Source
var ErrDeviceNotResponding = errors.New("device not responding")
View Source
var ErrNotImplemented = errors.New("not implemented")
Functions ¶
func RegisterDriver ¶
func RegisterDriver(driver HarnessDriver)
Types ¶
type ConsoleInterface ¶
type ConsoleInterface interface { io.ReadWriteCloser SetReadTimeout(t time.Duration) error }
type Device ¶
type Device interface { Driver() HarnessDriver Power(action string) error Console() (ConsoleInterface, error) SetConsoleSpeed(bps int) error Version() (string, error) Name() string // name of the device, can be assigned by the user Tags() []string // tags assigned to the device, can be assigned by the user SetName(name string) error // set the name of the device, should be stored in config or flashed to device SetUsbConsole(name string) error // set the substring of an out of band console name for this device SetTags(tags []string) error SetConfig(k, v string) error GetConfig() (map[string]string, error) Serial() (string, error) SetDiskImage(path string, offset uint64) error AttachStorage(connect bool) error SetControl(key string, value string) error Device() (string, error) IsBusy() (bool, error) Lock() error // open/lock the device so other instances cannot use it Unlock() error // close the locked device so other instances can use it }
func FindDevice ¶
FindDevice iterates over the available drivers and return a specific Device. If a driver is specified, only devices for that driver are returned.
type HarnessDriver ¶
func GetDrivers ¶
func GetDrivers() []HarnessDriver
Click to show internal directories.
Click to hide internal directories.