major change of server slim it down
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
package models
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Device struct {
|
||||
startAddress uint
|
||||
length uint
|
||||
channels *DMX
|
||||
}
|
||||
|
||||
func NewDevice(startAddress uint, channels uint, dmx *DMX) *Device {
|
||||
return &Device{
|
||||
startAddress: startAddress,
|
||||
length: channels,
|
||||
channels: dmx,
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Device) SetChannelValue(channel uint, value uint8) error {
|
||||
if d.length == channel {
|
||||
return fmt.Errorf("channel out of range %d", channel)
|
||||
}
|
||||
d.channels.SetValue(d.startAddress+channel, value)
|
||||
return nil
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
package models
|
||||
|
||||
type Get struct {
|
||||
Bus uint `json:"bus"`
|
||||
}
|
Reference in New Issue
Block a user