I've built the hid4java Maven project and successfully managed to put the library into a class library.
This is the code I'm using trying to open the device with which I am working :
public class JR3Controller implements HidServicesListener {
private static JR3Controller Ctor = null;
private JR3Reader Reader = null;
private JR3Writer Writer = null;
private HidDevice dev = null;
private HidServices mgr = null;
/**
* R3 Controller Object.
* @return
*/
public static boolean Initialize() throws HidException{
if (JR3Controller.Ctor != null) return true;
JR3Controller.Ctor = new JR3Controller();
JR3Controller.Ctor.mgr.addHidServicesListener(JR3Controller.Ctor);
return JR3Controller.Ctor.dev != null;
}
private JR3Controller(){
this.mgr = HidManager.getHidServices();
this.dev = this.mgr.getHidDevice(0x0003, 0x1001, null);
if (this.dev != null){
/*Stuff goes here : Doesn't matter because dev is never not null after the preceding line*/
}
This is happening in Windows 10 (A search revealed that Windows 10 could be the issue : https://github.com/signal11/hidapi/issues/231), running a 32 bit JVM on Netbeans...
Am I doing something wrong here? Is there any way to resolve this? Is there an alternative to hid4java that I can use for a simple HID device?