1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Fixed setting of timestampLength in UAVTalk parsing when the UAVObject is not initialize in the firmware. This mostly affects the OPLink, which doesn't initialize most of the UAVObjects, but does need to parse them.

This commit is contained in:
Brian Webb 2013-06-04 20:28:21 -07:00
parent 2656b4505e
commit f9706132f7

View File

@ -385,12 +385,12 @@ UAVTalkRxState UAVTalkProcessInputStreamQuiet(UAVTalkConnection connectionHandle
if (iproc->obj) {
iproc->length = UAVObjGetNumBytes(iproc->obj);
iproc->instanceLength = (UAVObjIsSingleInstance(iproc->obj) ? 0 : 2);
iproc->timestampLength = (iproc->type & UAVTALK_TIMESTAMPED) ? 2 : 0;
} else {
// We don't know if it's a multi-instance object, so just assume it's 0.
iproc->instanceLength = 0;
iproc->length = iproc->packet_size - iproc->rxPacketLength;
}
iproc->timestampLength = (iproc->type & UAVTALK_TIMESTAMPED) ? 2 : 0;
}
// Check length and determine next state