remotebox

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCh

func ErrorCh(ch chan struct{}) func(*Remotebox)

ErrorCh is a functional option allows you to pass a channel to the remotebox. The channel will be closed when an internal error occures.

func EventHandler

func EventHandler(h func(sw.Switcher, sw.Device)) func(*Remotebox)

EventHandler sets a callback function through which the bandswitch will report Events

func Index

func Index(i int) func(*Remotebox)

Index is a functional option to set the order in which it will be displayed on the graphical interface.

func Name

func Name(name string) func(*Remotebox)

Name is a functional option to set the name of this device.

func Portname

func Portname(pn string) func(*Remotebox)

Portname is a functional option to set the portname of the serial port. On Windows this will be "COMx", on Linux & MacOS "/dev/tty/xxx"

Types

type Remotebox

type Remotebox struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(opts ...func(*Remotebox)) *Remotebox

func (*Remotebox) Close

func (r *Remotebox) Close()

func (*Remotebox) GetPort

func (r *Remotebox) GetPort(portname string) (sw.Port, error)

GetPort returns switch.Port struct containing the current state of the requested port.

func (*Remotebox) Init

func (r *Remotebox) Init() error

func (*Remotebox) Name

func (r *Remotebox) Name() string

Name returns the Name of this remotebox

func (*Remotebox) Serialize

func (r *Remotebox) Serialize() sw.Device

Serialize returns a switch.Device struct containing the current state and configuration of this Remotebox.

func (*Remotebox) SetPort

func (r *Remotebox) SetPort(req sw.Port) error

SetPort sets the Terminals of a particular Port. The portRequest can contain n termials.

Jump to

Keyboard shortcuts

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