##// END OF EJS Templates
Ready for packaging
Ready for packaging

File last commit:

r51:87980339c225 default
r89:0550de8dad3d socexplorer-plugins-0.7-4 default
Show More
incomingpacketparser.cpp
43 lines | 1.2 KiB | text/x-c | CppLexer
Updated plugin version management....
r51 #include "incomingpacketparser.h"
IncomingPacketParser::IncomingPacketParser(QObject *parent) :
QObject(parent)
{
incompleteData = false;
localDataArray.clear();
}
void IncomingPacketParser::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;
}
}
}