Navigation Menu

Skip to content

Commit

Permalink
Use the same logic to get the config descriptor in hid_open() as in h…
Browse files Browse the repository at this point in the history
…id_enumerate()
  • Loading branch information
slouken committed Nov 26, 2019
1 parent f3d9539 commit 5321643
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hidapi/libusb/hid.c
Expand Up @@ -940,7 +940,10 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive)
int i,j,k;
libusb_get_device_descriptor(usb_dev, &desc);

if (libusb_get_active_config_descriptor(usb_dev, &conf_desc) < 0)
res = libusb_get_active_config_descriptor(usb_dev, &conf_desc);
if (res < 0)
libusb_get_config_descriptor(usb_dev, 0, &conf_desc);
if (!conf_desc)
continue;
for (j = 0; j < conf_desc->bNumInterfaces; j++) {
const struct libusb_interface *intf = &conf_desc->interface[j];
Expand Down

0 comments on commit 5321643

Please sign in to comment.