mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 05:11:49 -05:00
LimeSDR input: start and stop stream before and after the read loop. Use actual number of samples for callback
This commit is contained in:
parent
65cccbdd75
commit
d3312c90d4
@ -70,6 +70,12 @@ void LimeSDRInputThread::run()
|
|||||||
m_running = true;
|
m_running = true;
|
||||||
m_startWaiter.wakeAll();
|
m_startWaiter.wakeAll();
|
||||||
|
|
||||||
|
if (LMS_StartStream(m_stream) < 0) {
|
||||||
|
qCritical("LimeSDRInputThread::run: could not start stream");
|
||||||
|
} else {
|
||||||
|
qDebug("LimeSDRInputThread::run: stream started");
|
||||||
|
}
|
||||||
|
|
||||||
while (m_running)
|
while (m_running)
|
||||||
{
|
{
|
||||||
if ((res = LMS_RecvStream(m_stream, (void *) m_buf, LIMESDR_BLOCKSIZE, &metadata, 1000)) < 0)
|
if ((res = LMS_RecvStream(m_stream, (void *) m_buf, LIMESDR_BLOCKSIZE, &metadata, 1000)) < 0)
|
||||||
@ -78,7 +84,14 @@ void LimeSDRInputThread::run()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(m_buf, 2 * LIMESDR_BLOCKSIZE);
|
callback(m_buf, 2 * res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (LMS_StopStream(m_stream) < 0) {
|
||||||
|
qCritical("LimeSDRInputThread::run: could not stop stream");
|
||||||
|
} else {
|
||||||
|
qDebug("LimeSDRInputThread::run: stream stopped");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_running = false;
|
m_running = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user