|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.codeminders.hidapi.HIDManager
public abstract class HIDManager
HIDManager.java High-level interface to enumerate, find , open HID devices and get connect/disconnect notifications.
Field Summary | |
---|---|
protected long |
peer
|
Constructor Summary | |
---|---|
protected |
HIDManager()
Constructor to create HID object manager. |
Method Summary | |
---|---|
abstract void |
deviceAdded(HIDDeviceInfo dev)
Abstract callback method which will be called when HID device is connected. |
abstract void |
deviceRemoved(HIDDeviceInfo dev)
Abstract callback method which will be called when new HID device is disconnected. |
protected void |
finalize()
Release HID manager. |
static HIDDeviceInfo[] |
listDevices()
Get list of all the HID devices attached to the system. |
static 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. |
static HIDDevice |
openByPath(java.lang.String path)
Convenience method to find and open device by path |
void |
release()
Release underlying HID layer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long peer
Constructor Detail |
---|
protected HIDManager() throws java.io.IOException
java.io.IOException
Method Detail |
---|
public abstract void deviceAdded(HIDDeviceInfo dev)
dev
- Reference to the hid device info object.public abstract void deviceRemoved(HIDDeviceInfo dev)
dev
- Reference to the hid device info object.public static 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 static HIDDevice openByPath(java.lang.String path) throws java.io.IOException, HIDDeviceNotFoundException
path
- USB device path
HIDDevice object
- Throws:
java.io.IOException
- in case of internal error
HIDDeviceNotFoundException
- if devive was not found
public static 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)
- Returns:
- open device
- Throws:
java.io.IOException
- in case of internal error
HIDDeviceNotFoundException
- if devive was not found
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |