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.
This commit is contained in:
sdn-ninja 2024-05-09 22:04:26 +01:00 committed by GitHub
parent 363a81dfaf
commit e109c2f07a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,6 +76,9 @@ void HackRf::start()
check_status(status, "Failed to set VGA gain."); check_status(status, "Failed to set VGA gain.");
status = hackrf_set_hw_sync_mode(dev[1], 1); status = hackrf_set_hw_sync_mode(dev[1], 1);
check_status(status, "Failed to enable hardware synchronising."); 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 // reference config
status = hackrf_open_by_serial(serial[0].c_str(), &dev[0]); status = hackrf_open_by_serial(serial[0].c_str(), &dev[0]);
@ -104,15 +107,11 @@ void HackRf::stop()
void HackRf::process(IqData *buffer1, IqData *buffer2) void HackRf::process(IqData *buffer1, IqData *buffer2)
{ {
int status; int status;
while (true)
{
status = hackrf_start_rx(dev[1], rx_callback, buffer2); status = hackrf_start_rx(dev[1], rx_callback, buffer2);
check_status(status, "Failed to start RX streaming."); check_status(status, "Failed to start RX streaming.");
status = hackrf_start_rx(dev[0], rx_callback, buffer1); status = hackrf_start_rx(dev[0], rx_callback, buffer1);
check_status(status, "Failed to start RX streaming."); check_status(status, "Failed to start RX streaming.");
} }
}
int HackRf::rx_callback(hackrf_transfer* transfer) int HackRf::rx_callback(hackrf_transfer* transfer)
{ {