Class LinuxUsbDeviceJNA
java.lang.Object
oshi.hardware.common.AbstractUsbDevice
oshi.hardware.common.platform.linux.LinuxUsbDevice
oshi.hardware.platform.linux.LinuxUsbDeviceJNA
- All Implemented Interfaces:
Comparable<UsbDevice>, UsbDevice
Linux USB device helper using JNA/udev. Instantiates
LinuxUsbDevice objects.-
Method Summary
Modifier and TypeMethodDescriptiongetUsbDevices(boolean tree) Instantiates a list ofUsbDeviceobjects, representing devices connected via a usb port (including internal devices).Methods inherited from class LinuxUsbDevice
getDeviceAndChildrenModifier 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, toStringModifier 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()
-
Method Details
-
getUsbDevices
Instantiates a list ofUsbDeviceobjects, representing devices connected via a usb port (including internal devices).If the value of
treeis true, the top level devices returned from this method are the USB Controllers; connected hubs and devices in its device tree share that controller's bandwidth. If the value oftreeis false, USB devices (not controllers) are listed in a single flat list.- Parameters:
tree- If true, returns a list of controllers, which requires recursive iteration of connected devices. If false, returns a flat list of devices excluding controllers.- Returns:
- a list of
UsbDeviceobjects.
-