add read write lock to dmx data

This commit is contained in:
Adrian Zuercher
2025-07-26 07:18:26 +02:00
parent 05409c2544
commit a503b71fb6
5 changed files with 49 additions and 23 deletions

View File

@@ -78,10 +78,10 @@ func (d *ArtNetDriver) SetValue(bus string, address uint, value uint8) error {
if _, ok := d.Buses[bus]; !ok {
return fmt.Errorf("no bus '%s' found", bus)
}
if d.Buses[bus].Data == nil {
if d.Buses[bus].DMX.Data == nil {
return fmt.Errorf("no dmx data on bus '%s' found", bus)
}
d.Buses[bus].Data.SetValue(address, value)
d.Buses[bus].SetDMXData(address, value)
return nil
}
@@ -105,7 +105,6 @@ func (d *ArtNetDriver) Connect(ip, id string, port uint) error {
request := json_data.NewResponse()
err = json.Unmarshal(data, &request)
if err != nil {
return
}