gary-rowe / hid4java

A cross-platform Java Native Access (JNA) wrapper for the libusb/hidapi library. Works out of the box on Windows/Mac/Linux.
MIT License
229 stars 71 forks source link

Problem with response from device #71

Closed MrHazee closed 6 years ago

MrHazee commented 6 years ago

Hi there!

Im working on a project that involes Hid4java and a HID-device. Its working great in general but I have this little problem regarding the response time from my device. If I call hidDevice.read(data, 100): no respons. If i call hidDevice.read(data, 1500): Response but to slow. If i call just hidDevice.read(data): Extremely fast and nice response but im stuck in the function. Its blocked?! Any suggestions to solve this matter? Probably not a biggie but I have not that much experience so.. would appreaciate any help!

Thanks /Rasmus

MrHazee commented 6 years ago

Solved.

andyrozman commented 6 years ago

Can you share what you did in case, somebody else has the same problem?

MrHazee commented 6 years ago

Actually Im not sure what caused the problem. But Im pretty sure it was not the API. Probably I messed the timing up between my custom tx/rx threads. It now works flawless with hidDevice.read(data,2000); ie very fast respons.