Remove duplicate stop command in hackrf_close().
by Martin Ling 3 years 3 months
f046ed24
Merge hackrf_stop_tx_cmd and hackrf_start_tx_cmd.
by Martin Ling 3 years 3 months
Merge hackrf_stop_tx_cmd and hackrf_start_tx_cmd.

These both do the same thing: set transceiver mode to OFF.
b109a31f
Remove delays from hackrf_stop_rx_cmd and hackrf_s...
by Martin Ling 3 years 3 months
Remove delays from hackrf_stop_rx_cmd and hackrf_stop_tx_cmd.

These were added in #805, as a workaround to prevent their parent
functions from returning before transfer cancellations had completed.
This has since been fixed properly in #1029.
958c7421
Remove request_exit() function.
by Martin Ling 3 years 3 months
Remove request_exit() function.

This just set the do_exit flag, and was now only called in one place.
503cd331
Set streaming flag in prepare_transfers().
by Martin Ling 3 years 3 months
Set streaming flag in prepare_transfers().

This simplifies prepare_setup_transfers(), which was just setting
the flag if prepare_transfers() returned success, and passing on
its return value.
c4789df4
Set streaming flag in prepare_setup_transfers().
by Martin Ling 3 years 3 months
Set streaming flag in prepare_setup_transfers().

Avoids conditionally duplicating this across three other places.
5afd31e2
Clear streaming flag in cancel_transfers().
by Martin Ling 3 years 3 months
Clear streaming flag in cancel_transfers().

Moving this into cancel_transfers() avoids duplicating it in the two
stop functions.
960d8015
Simplify hackrf_libusb_transfer_callback.
by Martin Ling 3 years 3 months
Simplify hackrf_libusb_transfer_callback.

There are now only two possible outcomes to this function: either we
successfully resubmitted a transfer, or the transfer is finished and we
end up calling transfer_finished().

So we can go ahead and simplify it accordingly.
c74c7423
Clear streaming flag in transfer_finished().
by Martin Ling 3 years 3 months
Clear streaming flag in transfer_finished().

Since we always do these together, move it into the function.
54e00de1
Clear streaming flag if a transfer was cancelled.
by Martin Ling 3 years 3 months
Clear streaming flag if a transfer was cancelled.

If a transfer was cancelled, we are on our way to shutdown.

If hackrf_stop_tx() or hackrf_stop_rx() were called, they will already
have cleared this flag, but it is not cleared in hackrf_close(), and
for consistency with other paths it makes sense to clear it here.
6bd9cb05
Report a bug