Hello,

I have spent hours now trying to get communication working with a custom
USB device on Windows using libusbx. I have communication working through a
virtual com port so I believe the device is functioning as expected.

My device reports that it has 3 interfaces (0, 1, 2) and a total of 5 open
pipes (see below for the complete output). However my calls to
 libusb_claim_interface return -12 for all interfaces except 2 which is
HID. I am able to get two way communication over HID, but the USB device
i'm using only supports minimal functionality over HID (or atleast thats my
understanding).  I'm not sure if this is due to some driver configuration,
bugs in my code, bugs in windows backend etc.   My code is as follows:

r = libusb_init(&ctx);//Success
libusb_set_debug(ctx, 3);
dev_handle = libusb_open_device_with_vid_pid(ctx, 0x04D8, 0x00DF);//Success
r = libusb_claim_interface(dev_handle, interface_number);//Returns -12 for
interfaces 0 and 1,

usbview output:

Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x01
bInterfaceClass:      0x02
bInterfaceSubClass:   0x02
bInterfaceProtocol:   0x01
iInterface:           0x00

Endpoint Descriptor:
bEndpointAddress:     0x82  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x02


Interface Descriptor:
bInterfaceNumber:     0x01
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x0A
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x00

Endpoint Descriptor:
bEndpointAddress:     0x03  OUT
Transfer Type:        Bulk
wMaxPacketSize:     0x0020 (32)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:     0x83  IN
Transfer Type:        Bulk
wMaxPacketSize:     0x0040 (64)
bInterval:            0x00

Interface Descriptor:
bInterfaceNumber:     0x02
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x03 (HID)
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x00

HID Descriptor:
bcdHID:             0x0111
bCountryCode:         0x00
bNumDescriptors:      0x01
bDescriptorType:      0x22
wDescriptorLength:  0x001D

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0010 (16)
bInterval:            0x01

Endpoint Descriptor:
bEndpointAddress:     0x01  OUT
Transfer Type:   Interrupt
wMaxPacketSize:     0x0010 (16)
bInterval:            0x01
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to