Error Control transfer failed: Input/Output Error

979 views
Skip to first unread message

Armando

unread,
Oct 21, 2014, 10:00:15 AM10/21/14
to usb4...@googlegroups.com
Hello!

I have a problem:

the error happens when I try to send a message to a device



try
{
// Use device handle here

ByteBuffer buffer = ByteBuffer.allocateDirect(8);
buffer.put(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 });
int transfered = LibUsb.controlTransfer(handle,
(byte) (LibUsb.REQUEST_TYPE_CLASS |
LibUsb.RECIPIENT_INTERFACE),
(byte) 0x9F27, (short) 01, (short) 80, buffer,
250);
if (transfered < 0) throw new
LibUsbException("Control transfer failed", transfered);
System.out.println(transfered + " bytes sent");
}



Exception in thread "main" org.usb4java.LibUsbException: USB error 1:
Control transfer failed: Input/Output Error
at com.symetry.devices.ComunicacionPinPad.main



Dennis Sheirer

unread,
Oct 22, 2014, 4:21:40 AM10/22/14
to usb4...@googlegroups.com, arm...@hotmail.com
Try resetting the buffer pointer before you transfer.

buffer.rewind();

Lin Zhihui

unread,
Feb 13, 2015, 10:15:50 AM2/13/15
to usb4...@googlegroups.com, arm...@hotmail.com, lzh...@gmail.com
hey due, I got same problem, Im trying to send message to a usb device. have you figured it out yet ? please help me if you know whats going on with it.



Device Claimed
Disconnected from the target VM, address: '127.0.0.1:49337', transport: 'socket'
Exception in thread "main" org.usb4java.LibUsbException: USB error 1: Control transfer failed: Input/Output Error
at Display.Class_Packege.ConnectDevice.sendData(ConnectDevice.java:116)
at Display.Class_Packege.ConnectDevice.claimDevice(ConnectDevice.java:95)
at Display.Class_Packege.ConnectDevice.getDeviceHandle(ConnectDevice.java:79)
at Display.Class_Packege.ConnectDevice.findDevice(ConnectDevice.java:53)
at Display.MyApplication.main(MyApplication.java:13)

Process finished with exit code 1
 

Jaco van der Westhuizen

unread,
Mar 19, 2015, 2:55:56 AM3/19/15
to usb4...@googlegroups.com, arm...@hotmail.com
As far as I can tell, error #1 is a time-out.  The buffer might be too short, and you should definitely rewind the buffer before sending it LibUsb.controlTransfer(...).
Reply all
Reply to author
Forward
0 new messages