Refactor node storage and use proper types for protocol data
- Rename TypeID to ID throughout - Remove re-derivable data (MACTableSize, SACNInputs now derived) - Use typed ArtNetUniverse and SACNUniverse with methods - Store multicast groups with lastSeen tracking in structs - Remove int indexes in Nodes, use direct node pointers - Parse multicast groups into typed struct instead of strings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
11
dante.go
11
dante.go
@@ -102,10 +102,13 @@ func (n *Nodes) GetDanteTxDeviceInGroup(groupIP net.IP) *Node {
|
||||
n.mu.RLock()
|
||||
defer n.mu.RUnlock()
|
||||
|
||||
groupName := multicastGroupName(groupIP)
|
||||
group := ParseMulticastGroup(groupIP)
|
||||
groupKey := group.String()
|
||||
for _, node := range n.nodes {
|
||||
if node.DanteTxChannels != "" && containsString(node.MulticastGroups, groupName) {
|
||||
return node
|
||||
if node.DanteTxChannels != "" && node.MulticastGroups != nil {
|
||||
if _, exists := node.MulticastGroups[groupKey]; exists {
|
||||
return node
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -883,7 +886,7 @@ func (t *Tendrils) probeDanteDeviceWithPort(ip net.IP, port int) {
|
||||
log.Printf("[dante] %s: multicast group %s -> tx device %q", ip, groupIP, sourceName)
|
||||
}
|
||||
if sourceNode == nil {
|
||||
sourceNode = t.nodes.GetOrCreateByName(multicastGroupName(groupIP))
|
||||
sourceNode = t.nodes.GetOrCreateByName(ParseMulticastGroup(groupIP).String())
|
||||
}
|
||||
subscriberNode := t.nodes.GetOrCreateByName(info.Name)
|
||||
t.nodes.UpdateDanteFlow(sourceNode, subscriberNode, "", DanteFlowActive)
|
||||
|
||||
Reference in New Issue
Block a user