mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-01-30 03:44:55 +01:00
more verbose error message if opening the usb device fails
This commit is contained in:
parent
f1ac20c371
commit
5d2d5a4ae4
@ -1330,7 +1330,10 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
|
|||||||
r = libusb_open(device, &dev->devh);
|
r = libusb_open(device, &dev->devh);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
libusb_free_device_list(list, 1);
|
libusb_free_device_list(list, 1);
|
||||||
fprintf(stderr, "usb_open error %d\n", r);
|
fprintf(stderr, "usb_open error %s\n", libusb_error_name(r));
|
||||||
|
if(r == LIBUSB_ERROR_ACCESS)
|
||||||
|
fprintf(stderr, "Please fix the device permissions, e.g. "
|
||||||
|
"by installing the udev rules file rtl-sdr.rules\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1338,7 +1341,8 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
|
|||||||
|
|
||||||
r = libusb_claim_interface(dev->devh, 0);
|
r = libusb_claim_interface(dev->devh, 0);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
fprintf(stderr, "usb_claim_interface error %d\n", r);
|
fprintf(stderr, "usb_claim_interface error %s\n",
|
||||||
|
libusb_error_name(r));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user