diff --git a/src/blah2.cpp b/src/blah2.cpp index affa499..9d3231b 100644 --- a/src/blah2.cpp +++ b/src/blah2.cpp @@ -307,7 +307,7 @@ int main(int argc, char **argv) } } }); - + t2.join(); t1.join(); return 0; @@ -418,4 +418,4 @@ void timing_helper(std::vector& timing_name, double delta_ms = (double)(time_us.back()-time_us[time_us.size()-2]) / 1000; timing_name.push_back(name); timing_time.push_back(delta_ms); -} \ No newline at end of file +} diff --git a/src/capture/Capture.cpp b/src/capture/Capture.cpp index ad636d7..73511a8 100644 --- a/src/capture/Capture.cpp +++ b/src/capture/Capture.cpp @@ -61,7 +61,7 @@ void Capture::process(IqData *buffer1, IqData *buffer2, c4::yml::NodeRef config, { device->replay(buffer1, buffer2, file, loop); } - + t1.join(); } std::unique_ptr Capture::factory_source(const std::string& type, c4::yml::NodeRef config) diff --git a/src/capture/Source.cpp b/src/capture/Source.cpp index 5d40395..2f7e96a 100644 --- a/src/capture/Source.cpp +++ b/src/capture/Source.cpp @@ -65,6 +65,9 @@ void Source::close_file() void Source::kill() { if (type == "RspDuo") + { + stop(); + } else if (type == "HackRF") { stop(); } 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)