public class HIDManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected long |
peer |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Release HID manager.
|
static HIDManager |
getInstance() |
HIDDeviceInfo[] |
listDevices()
Get list of all the HID devices attached to the system.
|
HIDDevice |
openById(int vendor_id,
int product_id,
java.lang.String serial_number)
Convenience method to open a HID device using a Vendor ID
(VID), Product ID (PID) and optionally a serial number.
|
HIDDevice |
openByPath(java.lang.String path)
Convenience method to find and open device by path
|
void |
release()
Release underlying HID layer.
|
public HIDDeviceInfo[] listDevices() throws java.io.IOException
java.io.IOException
public void release()
HIDManager object is no longer needed. Failure to
do so could cause memory leaks or unterminated threads. It is
safe to call this method multiple times.
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public HIDDevice openByPath(java.lang.String path) throws java.io.IOException, HIDDeviceNotFoundException
path
- USB device pathHIDDevice object
java.io.IOException
- in case of internal errorHIDDeviceNotFoundException
- if devive was not foundpublic HIDDevice openById(int vendor_id, int product_id, java.lang.String serial_number) throws java.io.IOException, HIDDeviceNotFoundException
vendor_id
- USB vendor IDproduct_id
- USB product IDserial_number
- USB device serial number (could be null)
java.io.IOException
- in case of internal errorHIDDeviceNotFoundException
- if devive was not foundpublic static HIDManager getInstance() throws java.io.IOException
java.io.IOException