From 680fd91de8895390f4b50cfbe9d62079151c12f9 Mon Sep 17 00:00:00 2001 From: pancake Date: Sat, 2 Feb 2008 05:17:58 +0100 Subject: * Take proper values for claim_interface and set_altinterface from the device->config->interface->altsetting structure --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 78bc499..ba9f3b5 100644 --- a/src/main.c +++ b/src/main.c @@ -175,7 +175,8 @@ int connect_via_usb() 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"); // Something is broken if closing fails. @@ -190,7 +191,7 @@ int connect_via_usb() continue; } - if (usb_set_altinterface(dev, 1) < 0) { + if (usb_set_altinterface(dev, device->config->interface->altsetting->bAlternateSetting) < 0) { D perror("usb_set_altinterface"); // Something is broken if closing fails. -- cgit v1.2.3