sandervs / javahidapi

Automatically exported from code.google.com/p/javahidapi
Other
0 stars 0 forks source link

NullPointerException for ubuntu 12.04 #55

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
hid_mgr = HIDManager.getInstance();
dev = hid_mgr.openById(VENDOR_ID, PRODUCT_ID,null );
System.out.println("Manufacturer: " + dev.getManufacturerString() + "\n"); 
System.out.println("Product: " + dev.getProductString() + "\n");
System.out.println("Serial Number: " + dev.getSerialNumberString() + "\n");

When i run System.out.println("Manufacturer: " + dev.getManufacturerString() + 
"\n") 
NullPointerException  .But this is No problem for Windows7 and Mac .Why?

Original issue reported on code.google.com by gooow...@gmail.com on 22 Sep 2013 at 3:09

GoogleCodeExporter commented 8 years ago
Hi Gooow,
 to solve this Issue you have to update "linux/hid-usb.c" file. 

1) Download it from https://github.com/signal11/hidapi/blob/master/linux/hid.c 
and copy it as "linux/hid-usb.c"
2) Compile the library with: make -C linux
3) Update the libhidapi-jni-32.so (or libhidapi-jni-64.so) inside hidapi-1.1.jar

Best regards

Original comment by amp21...@gmail.com on 15 Jun 2015 at 11:24