k-yle / sACN

💡 🎭 Send & Receive sACN data (DMX over IP) in node.js
https://npm.im/sacn
Apache License 2.0
28 stars 12 forks source link

Return raw numbers and arrays #24

Closed schw4rzlicht closed 4 years ago

schw4rzlicht commented 4 years ago

Until 2.3.2 the message event returned a Packet that contained slotsData. Although objectify existed, we could build our own logic to extract data from the buffer. Since I need the data in raw values (0-255) and as an array, I did that with a few lines of code.

Since 3.1.0 Packet deserializes the buffer directly to the same object as objectify did. Therefore I'd like to propose a change towards the old behavior, maybe including both worlds.

I would create a PR for that but wanted to discuss the issue with you first.

k-yle commented 4 years ago

Good idea! I'm happy to accept PRs. It probably just involves changing https://github.com/k-yle/sACN/blob/7622ab7/src/packet.ts#L96