From e109c2f07afc1b92b0c09199f4836591dd292448 Mon Sep 17 00:00:00 2001 From: sdn-ninja Date: Thu, 9 May 2024 22:04:26 +0100 Subject: [PATCH] Update HackRf.cpp - enable CLKOUT (assumption is to plug that into ref device CLKIN) on surv device; otherwise, user has to do this from cmdline every time they plug the device - remove that while loop; not needed. --- src/capture/hackrf/HackRf.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/capture/hackrf/HackRf.cpp b/src/capture/hackrf/HackRf.cpp index 4aefa01..b328a1f 100644 --- a/src/capture/hackrf/HackRf.cpp +++ b/src/capture/hackrf/HackRf.cpp @@ -76,6 +76,9 @@ void HackRf::start() check_status(status, "Failed to set VGA gain."); status = hackrf_set_hw_sync_mode(dev[1], 1); check_status(status, "Failed to enable hardware synchronising."); + status = hackrf_set_clkout_enable(dev[1], 1); + check_status(status, "Failed to set CLKOUT on survillance device"); + // reference config status = hackrf_open_by_serial(serial[0].c_str(), &dev[0]); @@ -104,14 +107,10 @@ void HackRf::stop() void HackRf::process(IqData *buffer1, IqData *buffer2) { int status; - - while (true) - { - status = hackrf_start_rx(dev[1], rx_callback, buffer2); - check_status(status, "Failed to start RX streaming."); - status = hackrf_start_rx(dev[0], rx_callback, buffer1); - check_status(status, "Failed to start RX streaming."); - } + status = hackrf_start_rx(dev[1], rx_callback, buffer2); + check_status(status, "Failed to start RX streaming."); + status = hackrf_start_rx(dev[0], rx_callback, buffer1); + check_status(status, "Failed to start RX streaming."); } int HackRf::rx_callback(hackrf_transfer* transfer)