1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

HackRF: allow different frequencies for Tx and Rx and synchronize sample rates. Fixes #2513

This commit is contained in:
f4exb
2026-01-04 03:42:25 +01:00
parent 71fc02f0f8
commit 4be9883524
6 changed files with 77 additions and 80 deletions
@@ -72,27 +72,34 @@ void HackRFOutputThread::run()
m_running = true;
m_startWaiter.wakeAll();
if (hackrf_is_streaming(m_dev) == HACKRF_TRUE)
{
qDebug("HackRFInputThread::run: HackRF is streaming already");
}
else
{
qDebug("HackRFInputThread::run: HackRF is not streaming");
rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, this);
qDebug("HackRFOutputThread::run: HackRF is streaming already");
rc = (hackrf_error) hackrf_stop_tx(m_dev);
if (rc == HACKRF_SUCCESS)
{
qDebug("HackRFOutputThread::run: started HackRF Tx");
qDebug("HackRFOutputThread::run: stopped HackRF Tx");
}
else
{
qDebug("HackRFOutputThread::run: failed to start HackRF Tx: %s", hackrf_error_name(rc));
qDebug("HackRFOutputThread::run: failed to stop HackRF Tx: %s", hackrf_error_name(rc));
}
}
usleep(200000);
rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, this);
if (rc == HACKRF_SUCCESS)
{
qDebug("HackRFOutputThread::run: started HackRF Tx");
}
else
{
qDebug("HackRFOutputThread::run: failed to start HackRF Tx: %s", hackrf_error_name(rc));
}
while ((m_running) && (hackrf_is_streaming(m_dev) == HACKRF_TRUE))
{
usleep(200000);