1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

HackRF: enhance device operations error messages

This commit is contained in:
f4exb 2018-11-13 21:11:17 +01:00
parent b224e42ef0
commit 40deb5dc72

View File

@ -15,6 +15,7 @@
///////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <QtGlobal>
#include "devicehackrf.h"
DeviceHackRF::DeviceHackRF()
@ -22,7 +23,7 @@ DeviceHackRF::DeviceHackRF()
hackrf_error rc = (hackrf_error) hackrf_init();
if (rc != HACKRF_SUCCESS) {
fprintf(stderr, "DeviceHackRF::open_hackrf: failed to initiate HackRF library %s\n", hackrf_error_name(rc));
qCritical("DeviceHackRF::open_hackrf: failed to initiate HackRF library %s", hackrf_error_name(rc));
}
}
@ -59,6 +60,7 @@ hackrf_device *DeviceHackRF::open_hackrf(const char * const serial)
}
else
{
qCritical("DeviceHackRF::open_hackrf: error #%d: %s", (int) rc, hackrf_error_name(rc));
return 0;
}
}
@ -79,6 +81,7 @@ hackrf_device *DeviceHackRF::open_hackrf_from_sequence(int sequence)
}
else
{
qCritical("DeviceHackRF::open_hackrf_from_sequence: error #%d: %s", (int) rc, hackrf_error_name(rc));
return 0;
}
}