Class AbstractUsbDevice
java.lang.Object
oshi.hardware.common.AbstractUsbDevice
- All Implemented Interfaces:
Comparable<UsbDevice>, UsbDevice
- Direct Known Subclasses:
AixUsbDevice, FreeBsdUsbDevice, LinuxUsbDevice, MacUsbDevice, OpenBsdUsbDevice, SolarisUsbDevice, WindowsUsbDeviceJNA
A USB device
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddDevicesToList(List<UsbDevice> deviceList, List<UsbDevice> list) Recursively adds USB devices fromlisttodeviceList, depth-first.intOther devices connected to this hubgetName()Name of the USB deviceProduct ID of the USB deviceSerial number of the USB deviceA Unique Device ID of the USB device, such as the PnPDeviceID (Windows), Device Node Path (Linux), Registry Entry ID (macOS), or Device Node number (Unix)Vendor that manufactured the USB deviceID of the vendor that manufactured the USB devicetoString()
-
Constructor Details
-
AbstractUsbDevice
protected AbstractUsbDevice(String name, String vendor, String vendorId, String productId, String serialNumber, String uniqueDeviceId, List<UsbDevice> connectedDevices) Creates an AbstractUsbDevice with the given parameters.- Parameters:
name- the device namevendor- the vendor namevendorId- the vendor IDproductId- the product IDserialNumber- the serial numberuniqueDeviceId- the unique device IDconnectedDevices- the list of connected child devices
-
-
Method Details
-
getName
-
getVendor
-
getVendorId
Description copied from interface:UsbDeviceID of the vendor that manufactured the USB device- Specified by:
getVendorIdin interfaceUsbDevice- Returns:
- The vendor ID, a 4-digit hex string
-
getProductId
Description copied from interface:UsbDeviceProduct ID of the USB device- Specified by:
getProductIdin interfaceUsbDevice- Returns:
- The product ID, a 4-digit hex string
-
getSerialNumber
Description copied from interface:UsbDeviceSerial number of the USB device- Specified by:
getSerialNumberin interfaceUsbDevice- Returns:
- The serial number, if known
-
getUniqueDeviceId
Description copied from interface:UsbDeviceA Unique Device ID of the USB device, such as the PnPDeviceID (Windows), Device Node Path (Linux), Registry Entry ID (macOS), or Device Node number (Unix)- Specified by:
getUniqueDeviceIdin interfaceUsbDevice- Returns:
- The Unique Device ID
-
getConnectedDevices
Description copied from interface:UsbDeviceOther devices connected to this hub- Specified by:
getConnectedDevicesin interfaceUsbDevice- Returns:
- An
UnmodifiableListof other devices connected to this hub, if any, or an empty list if none
-
compareTo
- Specified by:
compareToin interfaceComparable<UsbDevice>
-
addDevicesToList
-
toString
-