mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
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
This commit is contained in:
parent
885c966e53
commit
dd0668c164
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user