From a8f5f71a9747720be82eb0fee35bcc3f3b19bc85 Mon Sep 17 00:00:00 2001 From: Jon Szymaniak Date: Tue, 25 Aug 2015 14:19:39 -0400 Subject: [PATCH] libbladeRF: Added INFO message regarding insufficient permissions This is intended to help folks recognize that they've forgotten to update their udev rules. --- host/libraries/libbladeRF/src/backend/usb/libusb.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/host/libraries/libbladeRF/src/backend/usb/libusb.c b/host/libraries/libbladeRF/src/backend/usb/libusb.c index e22b9bdae..d72859c55 100644 --- a/host/libraries/libbladeRF/src/backend/usb/libusb.c +++ b/host/libraries/libbladeRF/src/backend/usb/libusb.c @@ -411,8 +411,17 @@ static int find_and_open_device(libusb_context *context, /* Open the USB device and get some information */ status = get_devinfo(list[i], &curr_info); if (status < 0) { - log_debug("Could not open bladeRF device: %s\n", - libusb_error_name(status) ); + + /* Give the user a helpful hint in case the have forgotten + * to update their udev rules */ + if (status == LIBUSB_ERROR_ACCESS) { + log_info("Found a bladeRF but could not query its " + "information due to insufficient permissions.\n"); + } else { + log_debug("Could not open bladeRF device: %s\n", + libusb_error_name(status) ); + } + status = BLADERF_ERR_NODEV; continue; /* Continue trying the next devices */ } else {