search for: libusb_get_config_descriptor

Displaying 4 results from an estimated 4 matches for "libusb_get_config_descriptor".

2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
...ivers/libusb1.c b/drivers/libusb1.c index 17f4b8f74..f49cc78aa 100644 --- a/drivers/libusb1.c +++ b/drivers/libusb1.c @@ -420,7 +420,7 @@ static int nut_libusb_open(libusb_device_handle **udevp, upsdebugx(2, "Reading first configuration descriptor"); ret = libusb_get_config_descriptor(device, - (uint8_t)usb_subdriver.hid_rep_index, + 0, //(uint8_t)usb_subdriver.hid_rep_index, &conf_desc); /*ret = libusb_get_active_config_descriptor(device, &conf_desc);*/ When running from commit ab55bc0...
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
...; index 17f4b8f74..f49cc78aa 100644 > --- a/drivers/libusb1.c > +++ b/drivers/libusb1.c > @@ -420,7 +420,7 @@ static int nut_libusb_open(libusb_device_handle > **udevp, > > upsdebugx(2, "Reading first configuration descriptor"); > ret = libusb_get_config_descriptor(device, > - (uint8_t)usb_subdriver.hid_rep_index, > + 0, //(uint8_t)usb_subdriver.hid_rep_index, > &conf_desc); > /*ret = libusb_get_active_config_descriptor(device, > &conf_desc);*/ > >...
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
...r things like a USB device operating in high-speed or low-speed mode, or a debug vs normal mode, or maybe high vs low power mode. Given this, hid_rep_index (which libusb1.h defines as "number of the interface we use in a composite USB device") is absolutely not the right thing to pass to libusb_get_config_descriptor(), because the number of configurations are not related to the index of the interface being used. Passing 0 would be better than the current code, because 0 is what happens with not-composite devices (most UPS devices) and I bet even among the composite ones, there's only one config descriptor...
2023 Nov 05
1
Passing hid_rep_index to libusb_get_config_descriptor is wrong?
...device operating in high-speed or low-speed mode, or a > debug vs normal mode, or maybe high vs low power mode. Given this, > hid_rep_index (which libusb1.h defines as "number of the interface we use > in a composite USB device") is absolutely not the right thing to pass to > libusb_get_config_descriptor(), because the number of configurations are > not related to the index of the interface being used. Passing 0 would be > better than the current code, because 0 is what happens with not-composite > devices (most UPS devices) and I bet even among the composite ones, there's > only on...