mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2024-11-14 19:05:05 +01:00
Try to show the name of a HID (if possible)
This commit is contained in:
parent
3917dbbb0c
commit
63815a3fdd
@ -119,6 +119,7 @@ public class HidController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
return "USB HID on " + getIdentifier();
|
||||
String name = getHidDevice().getProductString();
|
||||
return ((name != null) ? name : "USB HID") + " on " + getIdentifier();
|
||||
}
|
||||
}
|
@ -76,4 +76,11 @@ public interface HidDevice {
|
||||
* @return path
|
||||
*/
|
||||
String getPath();
|
||||
|
||||
/**
|
||||
* Returns the name of the HID device
|
||||
*
|
||||
* @return product string (name)
|
||||
*/
|
||||
String getProductString();
|
||||
}
|
||||
|
@ -66,6 +66,11 @@ class Hid4JavaHidDevice implements HidDevice {
|
||||
return myDevice.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProductString() {
|
||||
return myDevice.getProduct();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Hid4JavaHidDevice [vid= " + getVendorId() + ", pid= " + getProductId() + ", usage= " + String.format("%04X:%04X", getUsagePage(), getUsageID()) + ", data=" + Arrays.toString(data) + "]";
|
||||
|
@ -95,6 +95,11 @@ class PureJavaHidDevice implements HidDevice, InputReportListener {
|
||||
return myDeviceInfo.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProductString() {
|
||||
return myDeviceInfo.getProductString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PureJavaHidDevice [vid= " + String.format("%04X", getVendorId()) + ", pid= " + String.format("%04X", getProductId()) + ", path= " + getPath().trim()
|
||||
|
Loading…
Reference in New Issue
Block a user