##// END OF EJS Templates
A lot of cleaning,...
A lot of cleaning, -removed deadlock on spwplugin -ambaplugin used to read too much data -removed several build warnings

File last commit:

r40:cda6b4e8adc1 Patch 3 from Paul on spwplugin default
r50:9c702d65566a default
Show More
incomingtcparser.cpp
43 lines | 1.2 KiB | text/x-c | CppLexer
#include "incomingtcparser.h"
IncomingTCParser::IncomingTCParser(QObject *parent) :
QObject(parent)
{
incompleteData = false;
localDataArray.clear();
}
void IncomingTCParser::processIncomingQByteArray(QByteArray incomingQByteArray)
{
int ccsdsSize;
bool keepParsing;
QByteArray tcPacket;
keepParsing = true;
localDataArray.append( incomingQByteArray );
if (localDataArray.size() >= 4 )
{
while(keepParsing == true)
{
ccsdsSize = ( (unsigned char) localDataArray[1] ) * 256 * 256
+ ( (unsigned char) localDataArray[2] ) * 256
+ ( (unsigned char) localDataArray[3] );
if (localDataArray.size() < (ccsdsSize+4) ) keepParsing = false;
else
{
tcPacket = QByteArray( localDataArray );
tcPacket.resize( ccsdsSize + 4 );
emit sendPacketUsingSpaceWire( tcPacket );
localDataArray.remove(0, ccsdsSize + 4);
}
if (localDataArray.size() >= 4 ) keepParsing = true;
else keepParsing = false;
}
}
}