public final class SerialComHIDdevice extends Object
Represents a HID device with information about it.
| Constructor and Description |
|---|
SerialComHIDdevice(String transport,
String deviceNode,
String idVendor,
String idProduct,
String serial,
String product,
String manufacturer,
String location)
Construct and allocates a new SerialComHIDdevice object with given details.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dumpDeviceInfo()
Prints information about this device on console.
|
String |
getDeviceNode()
Returns device node representing this device in system.
|
String |
getLocation()
Retrieves the location of the USB device in system.
|
String |
getManufacturerString()
Retrieves the manufacturer string of the USB device.
|
int |
getProductID()
Retrieves the product id of the USB device.
|
String |
getProductString()
Retrieves the product string of the USB device.
|
String |
getSerialNumber()
Retrieves the serial number string of the USB device.
|
String |
getTransportType()
Returns USB or Bluetooth i.e.
|
int |
getVendorID()
Retrieves the vendor id of the USB device.
|
public SerialComHIDdevice(String transport, String deviceNode, String idVendor, String idProduct, String serial, String product, String manufacturer, String location)
Construct and allocates a new SerialComHIDdevice object with given details.
transport - communication medium USB or Bluetooth this devices uses.deviceNode - identifier that can be used to open this device.idVendor - USB-IF unique vendor id of this device.idProduct - USB product id of this device.serial - serial number of this device.product - product identifier/description of this device.manufacturer - company manufacturing of this device.location - location in device tree created dynamically.com.serialpundit.core.SerialComException - if the object can not be constructed.public String getTransportType()
Returns USB or Bluetooth i.e. transport this device uses.
public String getDeviceNode()
Returns device node representing this device in system.
In MAC os x, there is no device file for HID devices like '/dev/xxx'. Devices are identified by their usage or other properties. Therefore to maintain consistency, we create device node string with various properties separated by underscore : Transport_USB-VID_USB-PID_USB-serialnumber_LocationID
public int getVendorID()
Retrieves the vendor id of the USB device.
NumberFormatException - if the USB vendor id hex string can not be converted into numerical
representation.public int getProductID()
Retrieves the product id of the USB device.
NumberFormatException - if the USB product id hex string can not be converted into numerical
representation.public String getSerialNumber()
Retrieves the serial number string of the USB device.
public String getProductString()
Retrieves the product string of the USB device.
public String getManufacturerString()
Retrieves the manufacturer string of the USB device.
public String getLocation()
Retrieves the location of the USB device in system.
public void dumpDeviceInfo()
Prints information about this device on console.
Copyright © 2017. All rights reserved.