Fix ArtPollReply to send to broadcast:6454 with proper MAC detection

This commit is contained in:
Ian Gulliver
2026-01-27 22:00:46 -08:00
parent e48a7de384
commit ae0b896883
5 changed files with 69 additions and 32 deletions

View File

@@ -255,8 +255,8 @@ func BuildPollPacket() []byte {
// BuildPollReplyPacket creates an ArtPollReply packet
// isInput: true = we transmit to network (SwIn), false = we receive from network (SwOut)
func BuildPollReplyPacket(ip [4]byte, shortName, longName string, universes []Universe, isInput bool) []byte {
buf := make([]byte, 239)
func BuildPollReplyPacket(ip [4]byte, mac [6]byte, shortName, longName string, universes []Universe, isInput bool) []byte {
buf := make([]byte, 240)
copy(buf[0:8], ArtNetID[:])
binary.LittleEndian.PutUint16(buf[8:10], OpPollReply)
@@ -280,17 +280,20 @@ func BuildPollReplyPacket(ip [4]byte, shortName, longName string, universes []Un
for i := 0; i < numPorts; i++ {
if isInput {
buf[174+i] = 0x40 // Can input to Art-Net (we transmit)
buf[178+i] = 0x80 // Data received
buf[174+i] = 0x40
buf[178+i] = 0x80
buf[186+i] = universes[i].Universe()
} else {
buf[174+i] = 0x80 // Can output from Art-Net (we receive)
buf[182+i] = 0x80 // Data transmitted
buf[174+i] = 0x80
buf[182+i] = 0x80
buf[190+i] = universes[i].Universe()
}
}
buf[200] = 0x00 // StNode
copy(buf[201:207], mac[:])
copy(buf[207:211], ip[:])
buf[211] = 1
buf[212] = 0x08
return buf
}