|
From: Andrew V. <and...@gm...> - 2007-08-14 20:48:43
|
Hello, I'm new to libusb-win32, libusb and usb but I hope that I'm not asking stupid or already answered questions. Anyway, please excuse me if so. Here is my problem: If I execute next call sequence hControl = usb_open(DeviceName); hData = usb_open(DeviceName); usb_set_configuration(hControl, 1); usb_claim_interface(hControl, 6); usb_set_altinterface(hControl, 0); usb_set_configuration(hData, 1); usb_claim_interface(hData, 7); usb_set_altinterface(hData, 1); usb_bulk_write(hData, 0x8, pBuffer, dwLength, dwTimeout); // write 26 bytes usb_bulk_read(hData, 0x88, pBuffer, dwLength, dwTimeout); // read 3 bytes (for device description please look below) I'm getting random failures - usb_set_configuration(), usb_claim_interface(), usb_set_altinterface() or usb_bulk_read() might fail. My best result was stable failure at usb_bulk_read() - usb_strerror() was saying that attached device is not functioning. Now, after reinstalling couple of things, I've failure at usb_set_altinterface () saying "usb_set_altinterface: could not set alt interface 6/0: win error: Not enough storage is available to process this command." I'm running WinXP SP2. I tried lubusb-win32 as filter and as driver (driver worked more stable). Basically my code is simplified and reworked replica of http://dev.zuckschwerdt.org/openobex/browser/trunk/lib/usbobex.c (I'm prototyping OBEX application). I tried building openobex with libusb-win32 and got exactly the same result as with my code. So, I guess problem is somewhere in libusb-win32. Could anyone help me to make bulk read/write working? DLL version: 0.1.12.1 Driver version: 0.1.12.1 bus-0/\\.\libusb0-0001--0x0421-0x04f0 0421/04F0 - Manufacturer : Nokia - Product : Nokia N95 wTotalLength: 466 bNumInterfaces: 16 bConfigurationValue: 1 iConfiguration: 4 bmAttributes: c0h MaxPower: 50 bInterfaceNumber: 0 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 8 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 1 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 8 bInterfaceProtocol: 1 iInterface: 0 bInterfaceNumber: 2 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 254 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 3 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 3 bAlternateSetting: 1 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bEndpointAddress: 03h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 82h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 4 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 11 bInterfaceProtocol: 0 iInterface: 6 bInterfaceNumber: 5 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 5 bAlternateSetting: 1 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bEndpointAddress: 87h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 06h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 6 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 11 bInterfaceProtocol: 0 iInterface: 7 bInterfaceNumber: 7 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 7 bAlternateSetting: 1 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bEndpointAddress: 88h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 08h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 8 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 11 bInterfaceProtocol: 0 iInterface: 8 bInterfaceNumber: 9 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 9 bAlternateSetting: 1 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bEndpointAddress: 89h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 09h bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 10 bAlternateSetting: 0 bNumEndpoints: 1 bInterfaceClass: 2 bInterfaceSubClass: 2 bInterfaceProtocol: 1 iInterface: 9 bEndpointAddress: 84h bmAttributes: 03h wMaxPacketSize: 64 bInterval: 128 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 11 bAlternateSetting: 0 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 10 bEndpointAddress: 8bh bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 0ch bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 12 bAlternateSetting: 0 bNumEndpoints: 1 bInterfaceClass: 2 bInterfaceSubClass: 2 bInterfaceProtocol: 255 iInterface: 11 bEndpointAddress: 85h bmAttributes: 03h wMaxPacketSize: 64 bInterval: 128 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 13 bAlternateSetting: 0 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 12 bEndpointAddress: 8ch bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 0dh bmAttributes: 02h wMaxPacketSize: 64 bInterval: 0 bRefresh: 0 bSynchAddress: 0 bInterfaceNumber: 14 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 2 bInterfaceSubClass: 253 bInterfaceProtocol: 0 iInterface: 13 bInterfaceNumber: 15 bAlternateSetting: 0 bNumEndpoints: 0 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bInterfaceNumber: 15 bAlternateSetting: 1 bNumEndpoints: 2 bInterfaceClass: 10 bInterfaceSubClass: 0 bInterfaceProtocol: 0 iInterface: 0 bEndpointAddress: 86h bmAttributes: 03h wMaxPacketSize: 64 bInterval: 32 bRefresh: 0 bSynchAddress: 0 bEndpointAddress: 0fh bmAttributes: 02h wMaxPacketSize: 64 bInterval: 32 bRefresh: 0 bSynchAddress: 0 Best regards, Andrew Voznytsa |