From dd0668c16451c320121d0d57a49f16fabc7e4f04 Mon Sep 17 00:00:00 2001 From: peabody124 Date: Thu, 16 Sep 2010 05:07:30 +0000 Subject: [PATCH] Ground/Logging: Finally add object ID and instance ID to information logged so it _might_ be readable. Still want to move size into the UAVTalk protocol and use that for logging. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1653 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/logging/loggingplugin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ground/src/plugins/logging/loggingplugin.cpp b/ground/src/plugins/logging/loggingplugin.cpp index de8c30588..2cc359123 100644 --- a/ground/src/plugins/logging/loggingplugin.cpp +++ b/ground/src/plugins/logging/loggingplugin.cpp @@ -76,14 +76,19 @@ void LoggingThread::objectUpdated(UAVObject * obj) { quint32 timeStamp = myTime.elapsed(); quint32 objSize = obj->getNumBytes(); - quint8 * buffer = new quint8[objSize+8]; + quint32 objId = obj->getObjID(); + quint32 objInst = obj->getInstID(); + + quint8 * buffer = new quint8[objSize+16]; if(buffer == NULL) return; - obj->pack(&buffer[8]); + obj->pack(&buffer[16]); memcpy(buffer,&timeStamp,4); memcpy(&buffer[4],&objSize,4); + memcpy(&buffer[8],&objId,4); + memcpy(&buffer[12],&objInst,4); QWriteLocker locker(&lock); qint64 written = logFile.write((char *) buffer,objSize+8);