LimeSDR input: start and stop stream before and after the read loop. Use actual number of samples for callback

pull/27/head
f4exb 2017-04-18 13:56:05 +02:00
rodzic 65cccbdd75
commit d3312c90d4
1 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -70,6 +70,12 @@ void LimeSDRInputThread::run()
m_running = true;
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)
{
if ((res = LMS_RecvStream(m_stream, (void *) m_buf, LIMESDR_BLOCKSIZE, &metadata, 1000)) < 0)
@ -78,7 +84,14 @@ void LimeSDRInputThread::run()
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;