phoipha2004
unread,Jan 14, 2015, 3:10:06 PM1/14/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to usb4...@googlegroups.com
Hi all,
I'm using usb4java to test how it work in windows 7 64bit; using Eclipse and
High-level (javax-usb) API. I can read all descriptor of my connected usb
keyboard device (configuration's descriptor, interface' descriptor,
endpoints descriptor). I also can open its interface and its endpoint's pipe.
But the problem is when i submit the data to the opening pipe, it has the
error: "Exception in thread "main" javax.usb.UsbPlatformException: USB error
1: Transfer error on interrupt endpoint: Input/Output Error"
Here is the code for synSubmit() data to opening pipe:
UsbEndpoint endpoint = iface.getUsbEndpoint((byte) 0x81);
System.out.println(endpoint2.getUsbEndpointDescriptor());
iface.claim();//claimed successful
UsbPipe pipe = endpoint.getUsbPipe();
pipe.open(); //pipe opened and actived as check
/*if (pipe.isActive()){
System.out.println("Pipe is actived!");
}
if (pipe.isOpen()){
System.out.println("Pipe is opened!");
}*/
byte[] data = new byte[]{8,4};
UsbIrp i = pipe.createUsbIrp();
i.setData(data);
pipe.syncSubmit(i); //*** error here ***
I also attempted other way to submit data.
try
{
int sent = pipe.syncSubmit(new byte[] { 1, 2, 3 }); //*** still error here ***
System.out.println(sent + " bytes sent");
}
finally
{
pipe.close();
}
Notice:
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
bMaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 HID
bInterfaceSubClass 1
bInterfaceProtocol 1
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 8
bInterval 10
I hope some other people can help me figure out why this error happened and
how do i fix this?
Thanks in advance.
Phoi Pha