* Take proper values for claim_interface and set_altinterface from the device->config->interface->altsetting structure
This commit is contained in:
1 parent
288cad1c2e
commit
680fd91de8
1 file changed
+3
-2
+3
-2
@@ -175,7 +175,8 @@ int connect_via_usb()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( usb_claim_interface(dev, 2) < 0) { // 2 or 0
|
if ( usb_claim_interface(dev,
|
||||||
|
device->config->interface->altsetting->bInterfaceNumber) < 0) { // 2 or 0
|
||||||
D perror("usb_claim_interface");
|
D perror("usb_claim_interface");
|
||||||
|
|
||||||
// Something is broken if closing fails.
|
// Something is broken if closing fails.
|
||||||
@@ -190,7 +191,7 @@ int connect_via_usb()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usb_set_altinterface(dev, 1) < 0) {
|
if (usb_set_altinterface(dev, device->config->interface->altsetting->bAlternateSetting) < 0) {
|
||||||
D perror("usb_set_altinterface");
|
D perror("usb_set_altinterface");
|
||||||
|
|
||||||
// Something is broken if closing fails.
|
// Something is broken if closing fails.
|
||||||
|
|||||||
Reference in new issue
Block a user