1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 22:14:45 -04:00

SDRdaemon plugin: reactivate address setting in GUI. Put in place a stram locked status.

This commit is contained in:
f4exb
2016-02-21 11:01:43 +01:00
parent 48d858ce5d
commit 2d018f7968
3 changed files with 20 additions and 5 deletions
@@ -27,6 +27,7 @@ const int SDRdaemonBuffer::m_iqSampleSize = 2 * m_sampleSize;
SDRdaemonBuffer::SDRdaemonBuffer(uint32_t rateDivider) :
m_rateDivider(rateDivider),
m_sync(false),
m_syncLock(false),
m_lz4(false),
m_inCount(0),
m_lz4InBuffer(0),
@@ -74,6 +75,18 @@ bool SDRdaemonBuffer::readMeta(char *array, uint32_t length)
if (m_crc64.calculate_crc((uint8_t *)array, sizeof(MetaData) - 8) == metaData->m_crc)
{
// sync condition:
if (m_currentMeta.m_blockSize > 0)
{
uint32_t nbBlocks = m_currentMeta.m_nbBytes / m_currentMeta.m_blockSize;
m_syncLock = nbBlocks + (m_lz4 ? 2 : 1) == m_nbBlocks;
//qDebug("SDRdaemonBuffer::readMeta: m_nbBlocks: %d:%d %s", nbBlocks, m_nbBlocks, (m_syncLock ? "locked" : "unlocked"));
}
else
{
m_syncLock = false;
}
memcpy((void *) &m_dataCRC, (const void *) &array[sizeof(MetaData)], 8);
m_nbBlocks = 0;
m_inCount = 0;