Files
tecamino-driver-artNet/models/dmx.go
2025-07-27 13:07:16 +02:00

30 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
}
func (d *DMX) SetValue(channel uint, value uint8) {
d.mu.Lock()
d.Data[channel] = value
d.mu.Unlock()
}