Files
tecamino-driver-artNet/models/dmx.go
2025-07-26 07:18:26 +02:00

28 lines
367 B
Go

package models
import "sync"
type DMX struct {
Data []byte
mu sync.Mutex
}
func NewDMXUniverse() *DMX {
return &DMX{
Data: make([]byte, 512),
}
}
func (d *DMX) GetDMXData() (data []byte) {
d.mu.Lock()
data = d.Data
d.mu.Unlock()
return data
}
func (d *DMX) SetValue(channel uint, value uint8) {
d.mu.Lock()
d.Data[channel] = value
d.mu.Unlock()
}