Page 1 of 1

libusbjava

Posted: Sun Aug 16, 2009 8:19 pm
by Irwandi
Dear vusb users
I interest to make java based application to control the vusb devices.
I want to connect to custom-class firmware by using java via libusbjava.
Can someone help me how to connect the vusb device by using libusbjava library?

Best regards,
Irwandi

Re: libusbjava ok

Posted: Sat Sep 12, 2009 1:07 pm
by Irwandi
:D , I got it

I hard worked, and tricky I got connection between my java program (modified form ReadWrite.java)
the parts of modified code are:

dev.open(1, 0, -1);
dev.controlMsg(0x40,1,value,0,data,4,5000,false);
// dev.writeInterrupt(0x81, data,data.length , 2000, false); //not yet working


// nBytes = usb_interrupt_read(handle, USB_ENDPOINT_IN | 1 , (char *)buffer, sizeof(buffer), 700000 * 1000);
//readInterrupt(int in_ep_address, byte[] data, int size, int timeout, boolean reopenOnTimeout)
for(int i=1;i<10;i++){
dev.readInterrupt(0x81, readData, readData.length, 700000*1000, false);
System.out.println("keypressed "+readData[0]+" "+readData[1]+" "+readData[2]+" "+readData[3]);

the firmware modified form CustomClass especially from custom-class. From host to device use controlmsg, while from device to host use interrupt.
I have problem to use interrupt for both.

If finish I will attach my projects in V-USB, and thank for this company for my hobby.

Best regards.
wandiufo@gmail.com

Re: libusbjava

Posted: Tue May 11, 2010 7:15 am
by rb20e
Hi,

could you attach your code for this please? Im keen to see how you implemented this.

Im kind of in the same place you were. can read fine but cant write out from the pc.

Thanks