Skip to content

Commit

Permalink
libbladeRF: Added INFO message regarding insufficient permissions
Browse files Browse the repository at this point in the history
This is intended to help folks recognize that they've forgotten
to update their udev rules.
  • Loading branch information
Jon Szymaniak committed Aug 25, 2015
1 parent 2afcc6a commit a8f5f71
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions host/libraries/libbladeRF/src/backend/usb/libusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a8f5f71

Please sign in to comment.