Skip to content

Commit

Permalink
Modified hackrf_stop_tx and hackrf_stop_rx to first join the transfer…
Browse files Browse the repository at this point in the history
… thread

before setting the receiver to OFF mode (cf. issue #650)
  • Loading branch information
Matioupi authored and mossmann committed Jan 6, 2020
1 parent 208fae7 commit 1442014
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions host/libhackrf/src/hackrf.c
Expand Up @@ -1629,12 +1629,12 @@ int ADDCALL hackrf_start_rx(hackrf_device* device, hackrf_sample_block_cb_fn cal
int ADDCALL hackrf_stop_rx(hackrf_device* device)
{
int result;
result = hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
result = kill_transfer_thread(device);
if (result != HACKRF_SUCCESS)
{
return result;
}
return kill_transfer_thread(device);
return hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
}

int ADDCALL hackrf_start_tx(hackrf_device* device, hackrf_sample_block_cb_fn callback, void* tx_ctx)
Expand All @@ -1653,12 +1653,13 @@ int ADDCALL hackrf_start_tx(hackrf_device* device, hackrf_sample_block_cb_fn cal
int ADDCALL hackrf_stop_tx(hackrf_device* device)
{
int result;
result = hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
result = kill_transfer_thread(device);
if (result != HACKRF_SUCCESS)
{
return result;
}
return kill_transfer_thread(device);

return hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
}

int ADDCALL hackrf_close(hackrf_device* device)
Expand Down

0 comments on commit 1442014

Please sign in to comment.