mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
HackRF input: open and close device considering the possible sink buddy
This commit is contained in:
@@ -14,8 +14,25 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdio.h>
|
||||
#include "devicehackrf.h"
|
||||
|
||||
hackrf_device *DeviceHackRF::open_hackrf(int sequence)
|
||||
{
|
||||
hackrf_error rc;
|
||||
|
||||
rc = (hackrf_error) hackrf_init();
|
||||
|
||||
// TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application
|
||||
if (rc != HACKRF_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "DeviceHackRF::open_hackrf: failed to initiate HackRF library %s\n", hackrf_error_name(rc));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return open_hackrf_from_sequence(sequence);
|
||||
}
|
||||
|
||||
hackrf_device *DeviceHackRF::open_hackrf_from_sequence(int sequence)
|
||||
{
|
||||
hackrf_device_list_t *hackrf_devices = hackrf_device_list();
|
||||
|
||||
Reference in New Issue
Block a user