jsimonetti / go-artnet

This package attempts to implement the Art-Net 4 specification from (c) Artistic Licence Holding Ltd.
MIT License
33 stars 20 forks source link

Fix OpCode reading on node packet callback handling #20

Closed aklinkert closed 4 years ago

aklinkert commented 4 years ago

In jsimonetti/go-artnet#18 @h3ndrk introduced node OpCode callbacks, but unfortunatelly this broke the only packet which behaves completely different, which is ArtPollReply. And thus broke the controller logic.

I decided to add a method to the ArtNetPacket interface because we already have the (well tested) logic of decoding the OpCode inside of the packets validate method.

jsimonetti commented 4 years ago

Oooh, oopsie. I missed that one. Could you rename GetOpCode() to OpCode() to be more idiomatic?

aklinkert commented 4 years ago

I wish I could have named the method OpCode, but that's already the name of the field. :(

jsimonetti commented 4 years ago

Ah, too bad. Thanks!