Documentation ¶
Index ¶
- Constants
- type Adaptor
- type DebugAdaptor
- func (a *DebugAdaptor) Connect() (errs []error)
- func (a *DebugAdaptor) Finalize() (errs []error)
- func (a *DebugAdaptor) GetLastOutput() map[int]byte
- func (a *DebugAdaptor) GetLastUniverseSize() int
- func (a *DebugAdaptor) Name() string
- func (a *DebugAdaptor) OutputDMX(output map[int]byte, universeSize int) error
- type Driver
- type InvalidAddressError
- type InvalidUniverseSizeError
- type NotConnectedError
- type USBEnttecProAdaptor
Constants ¶
const MaxUniverseSize = 512
MaxUniverseSize is the most number of DMX addresses the device can output.
const MinUniverseSize = 24
MinUniverseSize is the lowest number of DMX addresses the device can output.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugAdaptor ¶
type DebugAdaptor struct {
// contains filtered or unexported fields
}
DebugAdaptor is a debugging DMX adaptor. It will set the Use the GetLastOuput and GetLastUniverseSize attributes to get the last values set by `OutputDMX` is called, so you can check them for debugging purposes
func NewDebugAdaptor ¶
func NewDebugAdaptor() *DebugAdaptor
NewDebugAdaptor returns a new DebugAdaptor
func (*DebugAdaptor) Finalize ¶
func (a *DebugAdaptor) Finalize() (errs []error)
Finalize is a noop.
func (*DebugAdaptor) GetLastOutput ¶
func (a *DebugAdaptor) GetLastOutput() map[int]byte
GetLastOutput returns the last output set.
func (*DebugAdaptor) GetLastUniverseSize ¶
func (a *DebugAdaptor) GetLastUniverseSize() int
GetLastUniverseSize returns the last univserse size set.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver represents a DMX USB Pro
func NewDriver ¶
func NewDriver(a *USBEnttecProAdaptor, name string) *Driver
NewDriver returns a new Driver given an Adaptor and name.
Adds the following API Commands:
"OutputDMX" - See Driver.OutputDMX "SetUniverseSize" - See Driver.SetUniverseSize
func (*Driver) Connection ¶
func (s *Driver) Connection() gobot.Connection
Connection returns the connection
func (*Driver) OutputDMX ¶
OutputDMX outputs the mapping of DMX addresses and values.
All addresses not provided will be set to the lowest value, up the the maximum address, which is the universe size.
func (*Driver) SetUniverseSize ¶
SetUniverseSize sets the universe size of the output.
It has a minumum size of 12 and max size of 512.
type InvalidAddressError ¶
InvalidAddressError is raised when you call `OutputDMX` with an address that is out of range. Either below 1 or above the universe size.
func (*InvalidAddressError) Error ¶
func (e *InvalidAddressError) Error() string
type InvalidUniverseSizeError ¶
type InvalidUniverseSizeError struct {
UniverseSize int
}
InvalidUniverseSizeError is raised when you call `SetUniverseSize` with a universe size below `MinUniverseSize` or above `MaxUniverseSize`
func (*InvalidUniverseSizeError) Error ¶
func (e *InvalidUniverseSizeError) Error() string
type NotConnectedError ¶
type NotConnectedError struct{}
NotConnectedError is raised when you call `OutputDMX` before calling `Connect`
func (*NotConnectedError) Error ¶
func (*NotConnectedError) Error() string
type USBEnttecProAdaptor ¶
type USBEnttecProAdaptor struct {
// contains filtered or unexported fields
}
USBEnttecProAdaptor represents a Connection to a DMX USB Pro
func NewUSBEnttecProAdaptor ¶
func NewUSBEnttecProAdaptor(name string, port string) *USBEnttecProAdaptor
NewUSBEnttecProAdaptor returns a new Adaptor given a name and port
func (*USBEnttecProAdaptor) Connect ¶
func (a *USBEnttecProAdaptor) Connect() (errs []error)
Connect initiates a connection.
func (*USBEnttecProAdaptor) Finalize ¶
func (a *USBEnttecProAdaptor) Finalize() (errs []error)
Finalize closes the connection.
func (*USBEnttecProAdaptor) Name ¶
func (a *USBEnttecProAdaptor) Name() string
Name returns the name.
func (*USBEnttecProAdaptor) OutputDMX ¶
func (a *USBEnttecProAdaptor) OutputDMX(data map[int]byte, universeSize int) error
OutputDMX outputs the mapping of DMX addresses and values.
All addresses not provided will be set to the lowest value, up the the maximum address, which is the universe size.
func (*USBEnttecProAdaptor) Port ¶
func (a *USBEnttecProAdaptor) Port() string
Port returns the port.