From b2d6c713e1168a06b29ea043e2707a775aafaca5 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sat, 7 May 2022 20:10:55 +0200 Subject: [PATCH] Briefly start in TX mode to ensure correct RX frequency Obviously SoapyHackRF does not set the correct RX frequency on startup. This is a crude but effective workaround. --- impl/src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/impl/src/main.c b/impl/src/main.c index 16fd6e3..69ca695 100644 --- a/impl/src/main.c +++ b/impl/src/main.c @@ -175,7 +175,7 @@ int main(void) SoapySDR_setLogLevel(SOAPY_SDR_DEBUG); - bool on_air = false; + bool on_air = true; debug_fd = open("/tmp/dump.cf32", O_CREAT | O_WRONLY | O_TRUNC); @@ -201,7 +201,8 @@ int main(void) pfd.fd = m_tunfd; pfd.events = POLLIN; - RESULT_CHECK(sdr_start_rx(&sdr)); + // start in TX mode to work around SoapyHackRF not setting the correct frequency. + RESULT_CHECK(sdr_start_tx(&sdr, 1)); unsigned rx_retries = 0;