libhackrf: stop_tx() put HackRF in to idle mode before killing transfer thread

This is what we do for RX and appears to prevent HackRF remaining in TX
mode. This mirrors commit 693c262
This commit is contained in:
Dominic Spill
2018-02-17 16:20:08 -07:00
parent 991c5089a9
commit d17f091736

View File

@ -1651,14 +1651,13 @@ int ADDCALL hackrf_start_tx(hackrf_device* device, hackrf_sample_block_cb_fn cal
int ADDCALL hackrf_stop_tx(hackrf_device* device)
{
int result1, result2;
result1 = kill_transfer_thread(device);
result2 = hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
if (result2 != HACKRF_SUCCESS)
int result;
result = hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
if (result != HACKRF_SUCCESS)
{
return result2;
return result;
}
return result1;
return kill_transfer_thread(device);
}
int ADDCALL hackrf_close(hackrf_device* device)