You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks to me like the calcOverhead function actually finds the LAST occurrence of START_BYTE in the payload, not the first one as stated in the comments (and assumed by the unpackPacket function).
To find the FIRST occurrence, do:
void SerialTransfer::calcOverhead(uint8_t arr[], const uint8_t &len) {
overheadByte = 0xFF;
for (uint8_t i = 0; i < len; i++) {
if (arr[i] == START_BYTE) {
overheadByte = i;
break;
}
}
}
Or, run the existing loop backwards.
The text was updated successfully, but these errors were encountered:
The documentation might be off. I originally tried a different way of doing COBS before settling on the design I have now. Let me do some testing to see if there is truly a bug.
It looks to me like the calcOverhead function actually finds the LAST occurrence of START_BYTE in the payload, not the first one as stated in the comments (and assumed by the unpackPacket function).
To find the FIRST occurrence, do:
Or, run the existing loop backwards.
The text was updated successfully, but these errors were encountered: