Class LinuxUsbDevice
java.lang.Object
oshi.hardware.common.AbstractUsbDevice
oshi.hardware.common.platform.linux.LinuxUsbDevice
- All Implemented Interfaces:
Comparable<UsbDevice>, UsbDevice
- Direct Known Subclasses:
LinuxUsbDeviceNF
Linux USB device base class.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNo-arg constructor required so that subclasses, which extend this class solely to inherit its static helper methods, can compile without an explicit constructor.protectedLinuxUsbDevice(String name, String vendor, String vendorId, String productId, String serialNumber, String uniqueDeviceId, List<UsbDevice> connectedDevices) Creates a LinuxUsbDevice. -
Method Summary
Modifier and TypeMethodDescriptionprotected static LinuxUsbDevicegetDeviceAndChildren(String devPath, String vid, String pid, Map<String, String> nameMap, Map<String, String> vendorMap, Map<String, String> vendorIdMap, Map<String, String> productIdMap, Map<String, String> serialMap, Map<String, List<String>> hubMap) Recursively creates LinuxUsbDevices by fetching information from maps to populate fieldsMethods inherited from class AbstractUsbDevice
addDevicesToList, compareTo, getConnectedDevices, getName, getProductId, getSerialNumber, getUniqueDeviceId, getVendor, getVendorId, toString
-
Constructor Details
-
LinuxUsbDevice
protected LinuxUsbDevice(String name, String vendor, String vendorId, String productId, String serialNumber, String uniqueDeviceId, List<UsbDevice> connectedDevices) Creates a LinuxUsbDevice.- Parameters:
name- the device namevendor- the vendorvendorId- the vendor IDproductId- the product IDserialNumber- the serial numberuniqueDeviceId- the unique device IDconnectedDevices- the connected devices
-
LinuxUsbDevice
protected LinuxUsbDevice()No-arg constructor required so that subclasses, which extend this class solely to inherit its static helper methods, can compile without an explicit constructor. No subclass is ever instantiated; only this class is, via the full constructor.
-
-
Method Details
-
getDeviceAndChildren
protected static LinuxUsbDevice getDeviceAndChildren(String devPath, String vid, String pid, Map<String, String> nameMap, Map<String, String> vendorMap, Map<String, String> vendorIdMap, Map<String, String> productIdMap, Map<String, String> serialMap, Map<String, List<String>> hubMap) Recursively creates LinuxUsbDevices by fetching information from maps to populate fields- Parameters:
devPath- The device node path.vid- The default (parent) vendor IDpid- The default (parent) product IDnameMap- the map of namesvendorMap- the map of vendorsvendorIdMap- the map of vendorIdsproductIdMap- the map of productIdsserialMap- the map of serial numbershubMap- the map of hubs- Returns:
- A LinuxUsbDevice corresponding to this device
-