diff options
-rw-r--r-- | qdb/server/usb-host/usbconnection.cpp | 7 | ||||
-rw-r--r-- | qdb/server/usb-host/usbdeviceenumerator.cpp | 13 |
2 files changed, 16 insertions, 4 deletions
diff --git a/qdb/server/usb-host/usbconnection.cpp b/qdb/server/usb-host/usbconnection.cpp index 3998aa8..3c8f3e4 100644 --- a/qdb/server/usb-host/usbconnection.cpp +++ b/qdb/server/usb-host/usbconnection.cpp @@ -84,7 +84,12 @@ bool UsbConnection::open(OpenMode mode) ret = libusb_open(m_device.pointer(), &m_handle); if (ret) { - qCDebug(usbC) << "Could not open device:" << libusb_error_name(ret); + if (ret == LIBUSB_ERROR_ACCESS) { + qCWarning(usbC) << "Access to USB device was denied." + << "Check the manual for setting up access to USB devices."; + } else { + qCWarning(usbC) << "Could not open device:" << libusb_error_name(ret); + } return false; } diff --git a/qdb/server/usb-host/usbdeviceenumerator.cpp b/qdb/server/usb-host/usbdeviceenumerator.cpp index 4c2cfa6..3bf8ff9 100644 --- a/qdb/server/usb-host/usbdeviceenumerator.cpp +++ b/qdb/server/usb-host/usbdeviceenumerator.cpp @@ -132,9 +132,16 @@ std::pair<bool, UsbDevice> makeUsbDeviceIfQdbDevice(libusb_device *device) int ret = libusb_open(device, &handle); if (ret) { const auto address = getAddress(device); - qCWarning(usbC) << "Could not open USB device at" << address.busNumber - << ":" << address.deviceAddress << "for checking serial number:" - << libusb_error_name(ret); + if (ret == LIBUSB_ERROR_ACCESS) { + qCWarning(usbC) << "Access to USB device at" << address.busNumber + << ":" << address.deviceAddress << "was denied." + << "Check the manual for setting up access to USB devices."; + } else { + qCWarning(usbC) << "Could not open USB device at" << address.busNumber + << ":" << address.deviceAddress << "for checking serial number:" + << libusb_error_name(ret); + } + return std::make_pair(false, UsbDevice{}); } ScopeGuard deviceGuard = [=]() { |