Set streaming flag in prepare_setup_transfers().
Avoids conditionally duplicating this across three other places.
This commit is contained in:
@ -1831,6 +1831,8 @@ static int prepare_setup_transfers(hackrf_device* device,
|
||||
return result;
|
||||
}
|
||||
|
||||
device->streaming = true;
|
||||
|
||||
return HACKRF_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1894,9 +1896,6 @@ int ADDCALL hackrf_start_rx(hackrf_device* device, hackrf_sample_block_cb_fn cal
|
||||
{
|
||||
result = prepare_setup_transfers(device, endpoint_address, callback);
|
||||
}
|
||||
if (result == HACKRF_SUCCESS) {
|
||||
device->streaming = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1944,9 +1943,6 @@ int ADDCALL hackrf_start_tx(hackrf_device* device, hackrf_sample_block_cb_fn cal
|
||||
device->tx_ctx = tx_ctx;
|
||||
result = prepare_setup_transfers(device, endpoint_address, callback);
|
||||
}
|
||||
if (result == HACKRF_SUCCESS) {
|
||||
device->streaming = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2678,9 +2674,6 @@ int ADDCALL hackrf_start_rx_sweep(hackrf_device* device, hackrf_sample_block_cb_
|
||||
device->rx_ctx = rx_ctx;
|
||||
result = prepare_setup_transfers(device, endpoint_address, callback);
|
||||
}
|
||||
if (result == HACKRF_SUCCESS) {
|
||||
device->streaming = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user