1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-03 11:24:10 +01:00

Fix bug in UAVTalk where the expected packet length check was incorrect for

instances of objects
This commit is contained in:
James Cotton 2011-06-06 10:37:57 -05:00
parent 6c6906d61e
commit 83916f3a4e

View File

@ -295,7 +295,7 @@ bool UAVTalk::processInputByte(quint8 rxbyte)
} }
// Check the lengths match // Check the lengths match
if ((rxPacketLength + rxLength) != packetSize) if ((rxPacketLength + rxLength + (rxObj->isSingleInstance() ? 0 : 2)) != packetSize)
{ // packet error - mismatched packet size { // packet error - mismatched packet size
stats.rxErrors++; stats.rxErrors++;
rxState = STATE_SYNC; rxState = STATE_SYNC;
@ -805,17 +805,3 @@ quint8 UAVTalk::updateCRC(quint8 crc, const quint8* data, qint32 length)
crc = crc_table[crc ^ *data++]; crc = crc_table[crc ^ *data++];
return crc; return crc;
} }