Documentation ¶
Index ¶
- Constants
- func Extract(serialData []byte) (msgs []messages.EnttecDMXUSBProApplicationMessage, unUsedBytes []byte)
- type EnttecDMXUSBProController
- func (d *EnttecDMXUSBProController) ClearStage()
- func (d *EnttecDMXUSBProController) Commit() error
- func (d *EnttecDMXUSBProController) Connect() error
- func (d *EnttecDMXUSBProController) Disconnect() error
- func (d *EnttecDMXUSBProController) GetName() string
- func (d *EnttecDMXUSBProController) GetStage() []byte
- func (d *EnttecDMXUSBProController) OnDMXChange(c chan messages.EnttecDMXUSBProApplicationMessage, readIntervalMS int)
- func (d *EnttecDMXUSBProController) Read(buf []byte) (int, error)
- func (d *EnttecDMXUSBProController) SetLogVerbosity(verbosity uint8)
- func (d *EnttecDMXUSBProController) Stage(channel int16, value byte) error
- func (d *EnttecDMXUSBProController) SwitchReadMode(changesOnly byte) error
- func (d *EnttecDMXUSBProController) Write(buf []byte) (int, error)
Constants ¶
const ENTTEC_DMX_USB_PRO_LOG_PREFIX = "EDUP"
Prefix for any log and error messages
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EnttecDMXUSBProController ¶
type EnttecDMXUSBProController struct {
// contains filtered or unexported fields
}
Controller for Enttec DMX USB Pro device to handle communication
func NewEnttecDMXUSBProController ¶
func NewEnttecDMXUSBProController(conf *serial.Config, dmxChannelCount int, isWriter bool) *EnttecDMXUSBProController
Helper function for creating a new DMX USB PRO controller
func (*EnttecDMXUSBProController) ClearStage ¶
func (d *EnttecDMXUSBProController) ClearStage()
Set all values of the staged channels to '0'
func (*EnttecDMXUSBProController) Commit ¶
func (d *EnttecDMXUSBProController) Commit() error
Apply the 'staged' values to go live.
Note: This does not clear the Stage!
func (*EnttecDMXUSBProController) Connect ¶
func (d *EnttecDMXUSBProController) Connect() error
Open the serial connection to Enttec DMX USB PRO Widget
Succeeded if no error is returned
func (*EnttecDMXUSBProController) Disconnect ¶
func (d *EnttecDMXUSBProController) Disconnect() error
Close the serial connection to Enttec DMX USB PRO Widget
Succeeded if no error is returned
func (*EnttecDMXUSBProController) GetName ¶
func (d *EnttecDMXUSBProController) GetName() string
Returns the name used for opening the connection
e.g. "COM4" or "/dev/tty.usbserial"
func (*EnttecDMXUSBProController) GetStage ¶
func (d *EnttecDMXUSBProController) GetStage() []byte
Gets a copy of all staged channel values
func (*EnttecDMXUSBProController) OnDMXChange ¶
func (d *EnttecDMXUSBProController) OnDMXChange(c chan messages.EnttecDMXUSBProApplicationMessage, readIntervalMS int)
Start routine to read from DMX and get the results back via channel
Example useage:
c := make(chan messages.EnttecDMXUSBProApplicationMessage) // create channel go controller.OnDMXChange(c) // start routine for msg := range c { ... } // handle incoming data
func (*EnttecDMXUSBProController) Read ¶
func (d *EnttecDMXUSBProController) Read(buf []byte) (int, error)
Expose serial read to be used directly
func (*EnttecDMXUSBProController) SetLogVerbosity ¶ added in v0.4.0
func (d *EnttecDMXUSBProController) SetLogVerbosity(verbosity uint8)
Set log verbosity
0 = no logging
1 = message logging
2 = byte logging
func (*EnttecDMXUSBProController) Stage ¶
func (d *EnttecDMXUSBProController) Stage(channel int16, value byte) error
Prepare a channel to be changed to the given value
Note: This does not send out the changes, you must call the 'Commit' method to apply the stage live.
func (*EnttecDMXUSBProController) SwitchReadMode ¶
func (d *EnttecDMXUSBProController) SwitchReadMode(changesOnly byte) error
Change the receive mode of the widget.
Setting it to '0' will allow reading always and reads everything
Setting it to '1' will only read when the data changes and only reads the changeset (label=9)