2

I have a UIC 680 contactless card reader which has hid and RS 232 interfaces. Now I want to interact with the device using java and hid interface. I started exploring JAVAHID API and was able to get the device list. But when I try to get the device object it returns null. I know people have faced similar problem and this http://angryelectron.com/javahidapi-nihardwareservice link provides a solution for it which I also used. Now I also have magtek msr reader which gets detected in my computer as a HID compliant device and I get the device object for it absolutely fine but not for my UIC device (detected as USB Keyboard in my windows Computer) as well as USB HID mouse as they throw null pointer exception. Please help me out as in what I am doing wrong? Also, I know I can use java communication API and RS 232 interface but my requirement is to use HID interface.

red devil
  • 113
  • 8
  • hi! Do you want solution in java 1.4 ? – Nirav Alagiya Sep 16 '14 at 07:14
  • You usually cannot access a HID device, while the operating system driver is accessing the same device. Usually you first have to detach the OS driver before you can attach to the device. Additional using the HIDAPI brings some limitations. Usually this is not a problem for custom HID devices (e.g. devices that are not really HID, but use the interface for simplicity). Keyboards and mice are often more problematic. Try libusb to attach to the device from a small C program. When this works, bring in the full JAVAHID, HIDPAI, JAva, Javahid stack. – stefan.schwetschke Sep 16 '14 at 07:46
  • @stefan.schwetschke sorry question may sound very basic, but by detach OS Drivers do you mean uninstall keyboard drivers? If so how to do it? – red devil Sep 16 '14 at 10:08
  • @reddevil Please do not uninstall your keyboard driver! On some systems there is a separate detach-function that has to be called (certainly on Linux, not sure about Windows). This is a special function in libusb. – stefan.schwetschke Sep 16 '14 at 10:46

0 Answers0