hid-data example and hid comm from Java host
Posted: Sat Feb 23, 2013 8:58 pm
I have the hid-data example working fine when using the included command line testing tool called hidtool.
However, I am using a Java library for communication with a HID http://code.google.com/p/javahidapi/. I have used this successfully before on a project I created in Arduino using a Teensy 2.0 and it's version of a "RawHID" for data transfer.
Anyway I believe I have figured out my issue. When the java library's write() function sends data to the HID it expects to receive in return the number of bytes written. If it doesn't it throws and exception after a timeout. I can wrap it and when it times out go on my merry way, but the timeout is a bit long. So how do I tweak the example code or the V-USB library to return a number of bytes written after receiving data from the host? I guess a second question is, is this a standard procedure or something that should be in the V-USB library already?
However, I am using a Java library for communication with a HID http://code.google.com/p/javahidapi/. I have used this successfully before on a project I created in Arduino using a Teensy 2.0 and it's version of a "RawHID" for data transfer.
Anyway I believe I have figured out my issue. When the java library's write() function sends data to the HID it expects to receive in return the number of bytes written. If it doesn't it throws and exception after a timeout. I can wrap it and when it times out go on my merry way, but the timeout is a bit long. So how do I tweak the example code or the V-USB library to return a number of bytes written after receiving data from the host? I guess a second question is, is this a standard procedure or something that should be in the V-USB library already?