mirror of
https://github.com/jwetzell/artnet-go.git
synced 2026-08-13 02:53:42 +00:00
actually set ID of packet structs
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user