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

Vendor_id and product_id bigger or equals to 0x8000 are converted to 0xFFFFXXXX #65

Closed aortuno closed 4 years ago

aortuno commented 7 years ago

Vendor_id and product_id bigger or equals to 0x8000 are converted to 0xFFFF8000, because unsigned short does not exist in Java

gary-rowe commented 7 years ago

Will add a bit mask to remove the leading 0xFFFF.

gary-rowe commented 4 years ago

I've added some changes to convert from "unsigned short" to int and added HidDeviceTest to verify 0x8001 is correctly matched against 0xffff8001.

If you have time please review the changes and let me know if you're OK with them.

aortuno commented 4 years ago

I tested the new code with 2 devices with "Product Id" bigger than 0x8000, and both works.

gary-rowe commented 4 years ago

Thank you - much appreciated! I'll close this issue now and prepare for the 0.6.0 release.