From f0d13f7744dba3613b6e1ff76f7fac67b3bd2ce8 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Tue, 30 Dec 2025 11:57:46 -0600 Subject: [PATCH] actually set ID of packet structs --- dmx.go | 4 +++- poll.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dmx.go b/dmx.go index 267ea14..6336edc 100644 --- a/dmx.go +++ b/dmx.go @@ -48,7 +48,9 @@ func (ad *ArtDmx) UnmarshalBinary(data []byte) error { return errors.New("ArtDmx packet must be at least 18 bytes long") } - if !slices.Equal(ArtNetID, data[0:8]) { + ad.ID = data[0:8] + + if !slices.Equal(ArtNetID, ad.ID) { return errors.New("ID does not match Art-Net ID") } diff --git a/poll.go b/poll.go index 9bb64a3..ebfcce5 100644 --- a/poll.go +++ b/poll.go @@ -53,7 +53,9 @@ func (ap *ArtPoll) UnmarshalBinary(data []byte) error { return errors.New("ArtPoll packet must be at least 14 bytes long") } - if !slices.Equal(ArtNetID, data[0:8]) { + ap.ID = data[0:8] + + if !slices.Equal(ArtNetID, ap.ID) { return errors.New("ID does not match Art-Net ID") }