1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 07:23:38 -04:00

SDRdaemonFEC plugin: use meta data CRC32 and promote to version 2.1.0 again

This commit is contained in:
f4exb
2016-07-24 19:50:51 +02:00
parent 66e829bbf9
commit 9007d505ee
5 changed files with 21 additions and 5 deletions
@@ -19,6 +19,9 @@
#include <cstring>
#include <cmath>
#include <lz4.h>
#include <boost/crc.hpp>
#include <boost/cstdint.hpp>
#include "sdrdaemonfecbuffer.h"
@@ -282,8 +285,20 @@ void SDRdaemonFECBuffer::writeData(char *array, uint32_t length)
if (blockIndex == 0) // first block with meta
{
printMeta("SDRdaemonFECBuffer::writeData: recovered meta", (MetaDataFEC *) recoveredBlock);
// m_decoderSlots[decoderIndex].m_metaRetrieved = true;
MetaDataFEC *metaData = (MetaDataFEC *) recoveredBlock;
boost::crc_32_type crc32;
crc32.process_bytes(metaData, 20);
if (crc32.checksum() == metaData->m_crc32)
{
m_decoderSlots[decoderIndex].m_metaRetrieved = true;
printMeta("SDRdaemonFECBuffer::writeData: recovered meta", metaData);
}
else
{
qDebug() << "SDRdaemonFECBuffer::writeData: recovered meta: invalid CRC32";
}
}
m_decoderSlots[decoderIndex].m_originalBlocks[blockIndex] = *recoveredBlock;
@@ -42,6 +42,7 @@ public:
uint8_t m_nbFECBlocks; //!< 12 number of blocks carrying FEC
uint32_t m_tv_sec; //!< 16 seconds of timestamp at start time of super-frame processing
uint32_t m_tv_usec; //!< 20 microseconds of timestamp at start time of super-frame processing
uint32_t m_crc32; //!< 24 CRC32 of the above
bool operator==(const MetaDataFEC& rhs)
{
@@ -26,7 +26,7 @@
const PluginDescriptor SDRdaemonFECPlugin::m_pluginDescriptor = {
QString("SDRdaemon with FEC input"),
QString("2.0.2"),
QString("2.1.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,