mirror of
https://github.com/30hours/blah2.git
synced 2024-11-08 12:25:42 +00:00
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:
parent
363a81dfaf
commit
e109c2f07a
1 changed files with 7 additions and 8 deletions
|
@ -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,14 +107,10 @@ void HackRf::stop()
|
||||||
void HackRf::process(IqData *buffer1, IqData *buffer2)
|
void HackRf::process(IqData *buffer1, IqData *buffer2)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
status = hackrf_start_rx(dev[1], rx_callback, buffer2);
|
||||||
while (true)
|
check_status(status, "Failed to start RX streaming.");
|
||||||
{
|
status = hackrf_start_rx(dev[0], rx_callback, buffer1);
|
||||||
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);
|
|
||||||
check_status(status, "Failed to start RX streaming.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int HackRf::rx_callback(hackrf_transfer* transfer)
|
int HackRf::rx_callback(hackrf_transfer* transfer)
|
||||||
|
|
Loading…
Reference in a new issue