Class MacUsbDevice

java.lang.Object
oshi.hardware.common.AbstractUsbDevice
oshi.hardware.common.platform.mac.MacUsbDevice
All Implemented Interfaces:
Comparable<UsbDevice>, UsbDevice

@Immutable public class MacUsbDevice extends AbstractUsbDevice
Mac USB device base class.
  • Constructor Details

    • MacUsbDevice

      protected MacUsbDevice(String name, String vendor, String vendorId, String productId, String serialNumber, String uniqueDeviceId, List<UsbDevice> connectedDevices)
      Creates a MacUsbDevice.
      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
    • MacUsbDevice

      protected MacUsbDevice()
      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 MacUsbDevice getDeviceAndChildren(Long registryEntryId, String vid, String pid, Map<Long,String> nameMap, Map<Long,String> vendorMap, Map<Long,String> vendorIdMap, Map<Long,String> productIdMap, Map<Long,String> serialMap, Map<Long, List<Long>> hubMap)
      Recursively creates MacUsbDevices by fetching information from maps to populate fields
      Parameters:
      registryEntryId - The device unique registry id.
      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 MacUsbDevice corresponding to this device