sequenceNumber is not set in packet
Trickfilm400 opened this issue · comments
Hi,
first: this library is nice, saved me a lot of work, but I have found an issue:
My application which I use for the incoming sACN data (DMXControl 3) needs to have a working sequence number, otherwise it will not accept any sACN data.
I found a bug in this library, were the sequence number stays "0", even if the internal variable is updated - but the value in the byte array packet doesn't get updated?
Here the sequence number gets incremented:
Line 177 in f9539b2
And here is the function for this - but the internal byte Array doesn't get updated:
Line 140 in f9539b2
I made a quick fix:
void sACNSource::setSequenceNumber(byte seqNum) {
// update sequence number:
_byteArray[111] = seqNum;
_sequenceNumber = seqNum;
}
See PR for the mentioned fix
Something to Note: It may be good to reset the sequence counter to 0 if it has reached 256 or something like this to prevent buffer overflow errors if the sequence is too high
void sACNSource::setSequenceNumber(byte seqNum) {
// update sequence number:
_byteArray[111] = seqNum;
_sequenceNumber = seqNum;
if (_sequenceNumber > 256) _sequenceNumber = 0;
}