Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofxArtnetMessage setData size issue #34

Open
dimitre opened this issue Feb 6, 2021 · 3 comments
Open

ofxArtnetMessage setData size issue #34

dimitre opened this issue Feb 6, 2021 · 3 comments

Comments

@dimitre
Copy link
Contributor

dimitre commented Feb 6, 2021

Correct me if I'm wrong but right now if I allocate a message with a number of bytes, ex: 512, and try to setData with the same number of bytes it actually returns a warning and does nothing, so I have to allocate the message with the size 513 to be able to copy.
maybe the <= in this line should be only a less than

	if (getSize() <= index) {

Cheers
Dimitre

@dimitre dimitre changed the title ofxArtnetMessage complains if I try to send the mes ofxArtnetMessage setData size issue Feb 6, 2021
@KabooHahahein
Copy link

You should never be setting index 512 on an array/vector of size 512 because the array/vector is 0 indexed.

The code is correct.

@dimitre
Copy link
Contributor Author

dimitre commented May 31, 2022

ok I thought ofxArtnet started in channel 1.

@KabooHahahein
Copy link

KabooHahahein commented Jun 1, 2022

"physical is an information packet showing the original physical universe of this data, if required. Then follows up to 512 lighting values in the range 0 to 255."

https://en.wikipedia.org/wiki/Art-Net

I don't see any reason why the data should skip a byte. If that's the case, it would be controller specific, and based on the implementation.

If you're using 1-indexed arrays, your array should be size + 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants