1
0
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:
f4exb
2017-01-08 00:33:11 +01:00
parent 833feef0e4
commit a02b78d24d
6 changed files with 177 additions and 31 deletions
+17
View File
@@ -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();