mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
HackRF: enhance device operations error messages
This commit is contained in:
parent
b224e42ef0
commit
40deb5dc72
@ -15,6 +15,7 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <QtGlobal>
|
||||||
#include "devicehackrf.h"
|
#include "devicehackrf.h"
|
||||||
|
|
||||||
DeviceHackRF::DeviceHackRF()
|
DeviceHackRF::DeviceHackRF()
|
||||||
@ -22,7 +23,7 @@ DeviceHackRF::DeviceHackRF()
|
|||||||
hackrf_error rc = (hackrf_error) hackrf_init();
|
hackrf_error rc = (hackrf_error) hackrf_init();
|
||||||
|
|
||||||
if (rc != HACKRF_SUCCESS) {
|
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
|
else
|
||||||
{
|
{
|
||||||
|
qCritical("DeviceHackRF::open_hackrf: error #%d: %s", (int) rc, hackrf_error_name(rc));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,6 +81,7 @@ hackrf_device *DeviceHackRF::open_hackrf_from_sequence(int sequence)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
qCritical("DeviceHackRF::open_hackrf_from_sequence: error #%d: %s", (int) rc, hackrf_error_name(rc));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user