1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -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
@@ -83,23 +83,31 @@ void HackRFInputThread::run()
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_rx(m_dev, rx_callback, this);
rc = (hackrf_error) hackrf_stop_rx(m_dev);
if (rc == HACKRF_SUCCESS)
{
qDebug("HackRFInputThread::run: started HackRF Rx");
qDebug("HackRFInputThread::run: stopped HackRF Rx");
}
else
{
qDebug("HackRFInputThread::run: failed to start HackRF Rx: %s", hackrf_error_name(rc));
qDebug("HackRFInputThread::run: failed to stop HackRF Rx: %s", hackrf_error_name(rc));
}
}
usleep(200000);
rc = (hackrf_error) hackrf_start_rx(m_dev, rx_callback, this);
if (rc == HACKRF_SUCCESS)
{
qDebug("HackRFInputThread::run: started HackRF Rx");
}
else
{
qDebug("HackRFInputThread::run: failed to start HackRF Rx: %s", hackrf_error_name(rc));
}
while ((m_running) && (hackrf_is_streaming(m_dev) == HACKRF_TRUE))
{
usleep(200000);