RE: Generic HID Host Applications in JAVA
Hi there, firstly I am very grateful for your piece of code.
However I am encountering some problems and your help will be grately appreciated. Your program is able to
- Find HID device
- Get input, output and feature report size
- Read data from the device
- write data from the device (I did not test if it sends correctly or not but I dont care)
My purpose is to send a piece of string to PIC as send data command and to read the data sent by PIC. So I just altered your code for my purpose. However the problem I am facing is also true for your code. The problem is when write command runs, java gives ntdll.dll error and it gets out of JVM. After some tries, it does not gets out of JVM on some occasions (without touching code)
In PIC coding I added a delay of 1 second between (get command and send data to PC) and it improved the chance of successive run.
I have a tool that can monitor the HID port coming data. So when I run write command from the java, it surely sends to PIC and the PIC starts to send data as a response but java gives error after write command is done.
I think I miss a point in PIC programming. I just use functions of find device, read(doread), write(dowrite). As feature report byte it is always null.