From 9007d505eef634635d78a87c061255e1752fe7a8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 24 Jul 2016 19:50:51 +0200 Subject: [PATCH] SDRdaemonFEC plugin: use meta data CRC32 and promote to version 2.1.0 again --- .../sdrdaemonfec/sdrdaemonfecbuffer.cpp | 19 +++++++++++++++++-- .../sdrdaemonfec/sdrdaemonfecbuffer.h | 1 + .../sdrdaemonfec/sdrdaemonfecplugin.cpp | 2 +- sdrbase/gui/aboutdialog.ui | 2 +- sdrbase/mainwindow.cpp | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.cpp b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.cpp index 36a2fe96f..ba7218d22 100644 --- a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.cpp +++ b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.cpp @@ -19,6 +19,9 @@ #include #include #include +#include +#include + #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; diff --git a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.h b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.h index 9353ab34c..af64640f8 100644 --- a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.h +++ b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecbuffer.h @@ -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) { diff --git a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecplugin.cpp b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecplugin.cpp index af0ad0331..74d97ab1d 100644 --- a/plugins/samplesource/sdrdaemonfec/sdrdaemonfecplugin.cpp +++ b/plugins/samplesource/sdrdaemonfec/sdrdaemonfecplugin.cpp @@ -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, diff --git a/sdrbase/gui/aboutdialog.ui b/sdrbase/gui/aboutdialog.ui index 529f0748e..8ba817d2f 100644 --- a/sdrbase/gui/aboutdialog.ui +++ b/sdrbase/gui/aboutdialog.ui @@ -84,7 +84,7 @@ - <html><head/><body><p>Version 2.0.2 - Copyright (C) 2015-2016 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a> This is a complete redesign from RTL-SDRangelove at <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/hexameron/rtl-sdrangelove</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in RTL-SDRangelove</p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> + <html><head/><body><p>Version 2.1.0 - Copyright (C) 2015-2016 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a> This is a complete redesign from RTL-SDRangelove at <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/hexameron/rtl-sdrangelove</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in RTL-SDRangelove</p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> true diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index 67469414c..cb5448ced 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -333,7 +333,7 @@ void MainWindow::savePresetSettings(Preset* preset, int tabIndex) void MainWindow::createStatusBar() { QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); - m_showSystemWidget = new QLabel("SDRangel v2.0.2 " + qtVersionStr + QSysInfo::prettyProductName(), this); + m_showSystemWidget = new QLabel("SDRangel v2.1.0 " + qtVersionStr + QSysInfo::prettyProductName(), this); statusBar()->addPermanentWidget(m_showSystemWidget); m_dateTimeWidget = new QLabel(tr("Date"), this);