delMar43 / javahidapi

Automatically exported from code.google.com/p/javahidapi
Other
0 stars 0 forks source link

More of a question than issue #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up an Mac 10.7 environment to interface with a HID device.  Put 
libraries in the appropriate places (libhidapi-jni.jnilib in the 
/Library/Java/Extensions/ folder and include the hidapi-1.1.jar in the 
Referenced Libraries in Eclipse.
2. Export a runnable .jar 
3. The .jar runs fine and preforms as expected on the Mac development computer 
with the libraries installed.
4. Move the .jar to a Windows computer with Java install.  The jar runs but the 
HID functions are not working.

Do I need to install something to the standard Java install on any machine I 
expect to deploy the application on?  If so, what files and where?

What is the expected output? What do you see instead?
Expected the .jar to have all that was needed to run enclosed within it.  The 
HID functions don't work.

What version of the product are you using? On what operating system?
Mac 1.1,  PC ?

Please provide any additional information below.
I guess I'm asking if I would need to provide a custom install to put the 
required extension libraries into the appropriate folders for an end user 
deploy.

Original issue reported on code.google.com by gbarna...@gmail.com on 17 Dec 2012 at 5:21

GoogleCodeExporter commented 9 years ago
Solved my issue.  I should have read the instructions better for the hidapi 
API. "The first byte of data[] must contain the Report ID. For devices which 
only support a single report, this must be set to 0x0." Somewhat in my defense 
it worked just fine without that in my OSX 10.7.5 environment. My Arduino 
device got the message fine and I was able to process the byte[] array from the 
first element byte[0]. However when I ran the .jar on my XP computer the HID 
interface was looking for that 0x0 first byte. All I needed to do was change 
the code to pass that as the first byte of the buffer and both the Windows and 
Mac saw the write request fine.

No custom install needed, all necessary files are in the hidapi-1.1.jar.  Just 
add it as a Referenced Library and you are good to go.

Original comment by gbarna...@gmail.com on 18 Dec 2012 at 4:43