From 83916f3a4e863053ae767dca2b1c3010e74942eb Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 6 Jun 2011 10:37:57 -0500 Subject: [PATCH] Fix bug in UAVTalk where the expected packet length check was incorrect for instances of objects --- .../openpilotgcs/src/plugins/uavtalk/uavtalk.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp index 3cfe6dfe7..6a9d22d5f 100644 --- a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp +++ b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp @@ -295,7 +295,7 @@ bool UAVTalk::processInputByte(quint8 rxbyte) } // Check the lengths match - if ((rxPacketLength + rxLength) != packetSize) + if ((rxPacketLength + rxLength + (rxObj->isSingleInstance() ? 0 : 2)) != packetSize) { // packet error - mismatched packet size stats.rxErrors++; rxState = STATE_SYNC; @@ -805,17 +805,3 @@ quint8 UAVTalk::updateCRC(quint8 crc, const quint8* data, qint32 length) crc = crc_table[crc ^ *data++]; return crc; } - - - - - - - - - - - - - -