Was wondering why I get two instances of the Teensy as a HID in my Java code. Here is a short snip of the java code, I'm using the hidapi-1.1.jar.
{
HIDManager manager = HIDManager.getInstance();
HIDDeviceInfo[] devs = manager.listDevices();
System.err.println("Devices:\n\n");
for(int i=0;i<devs.length;i++)
{
System.err.println(""+i+".\t"+devs);
System.err.println("---------------------------------------------\n");
}
System.gc();
}
Here is a screen shot that shows both in the array of variables:
My issue is that when I call for the specific devices using:
HIDManager hid_mgr = HIDManager.getInstance();
dev = hid_mgr.openById(VENDOR_ID, PRODUCT_ID, null);
I get the "wrong" one and the data that I can obtain is not correct. The rawhid_test program does show the correct data.
{
HIDManager manager = HIDManager.getInstance();
HIDDeviceInfo[] devs = manager.listDevices();
System.err.println("Devices:\n\n");
for(int i=0;i<devs.length;i++)
{
System.err.println(""+i+".\t"+devs);
System.err.println("---------------------------------------------\n");
}
System.gc();
}
Here is a screen shot that shows both in the array of variables:
My issue is that when I call for the specific devices using:
HIDManager hid_mgr = HIDManager.getInstance();
dev = hid_mgr.openById(VENDOR_ID, PRODUCT_ID, null);
I get the "wrong" one and the data that I can obtain is not correct. The rawhid_test program does show the correct data.
Last edited: