I have a hid-data example, from V-USB working fine, using a ATTiny85. When using the included command line testing tool, written is C, called hidtool, I can send and then receive the sent data from this command line test. But being a command line program it's pretty basic and does not really have any error checking. It just sends the data to the HID and then exits. A subsequent call with a "read" parameter displays what was written to the terminal.
However, I am using a Java library for communication with this HID http://code.google.com/p/javahidapi/. I have used this same method, 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. I'm not sure if I should 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? I have posted this question over in their forum but figured I would ask here as well.
However, I am using a Java library for communication with this HID http://code.google.com/p/javahidapi/. I have used this same method, 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. I'm not sure if I should 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? I have posted this question over in their forum but figured I would ask here as well.
Last edited: