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

@Immutable public class LinuxUsbDevice extends AbstractUsbDevice
Linux USB device base class.
  • 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 name
      vendor - the vendor
      vendorId - the vendor ID
      productId - the product ID
      serialNumber - the serial number
      uniqueDeviceId - the unique device ID
      connectedDevices - 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 ID
      pid - The default (parent) product ID
      nameMap - the map of names
      vendorMap - the map of vendors
      vendorIdMap - the map of vendorIds
      productIdMap - the map of productIds
      serialMap - the map of serial numbers
      hubMap - the map of hubs
      Returns:
      A LinuxUsbDevice corresponding to this device