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

Meaning of returning value in the "write" method #90

Closed permiakover closed 4 years ago

permiakover commented 4 years ago

Hello, there is no explaining of the "write" method in the doc. public int write(byte[] message, int packetLength, byte reportId), returns int value, from my experience 5 for success, and -1 for trouble situation. is it correct? is there any more states?

nospam2k commented 4 years ago

I'm not sure of this but it seems to me from my testing that the return is just the length of the message + 1 for the reportId.