I've downloaded the javahidapi and the source code. Running the sample program to list the connected devices gives me this:
From the information above I was able to extract the following constants into the Java code:
The main method of my Java class load the HID library from the classpath and call the readDevice() method.
The two methods below are ported from the code mentioned in the blog entry above. These are for converting the raw temperature reading to Celsius and another method to convert Celsius to Fahrenheit and Kelvin, depending on the parameters.
The method below does the actual reading of the device values. To read the device, a command is sent to the device first (by writing to the device), then the response is read.
The code above only retrieves the temperature reading. The TEMPer1 can also report humidity readings, this is something I've not looked into yet. Running this code produces the following output:
As described in the blog entry I've referenced at the top, there are two HID devices exposed, these are returned in a non-deterministic order. My code doesn't make any attempt to grab the correct device, so sometimes if the 'keyboard' device is grabbed, the code locks up. To fix this, all that's requires is to enumerate all the devices and get the correct one based on the usage_page, but it's not something I've done.