Class FreeBsdUsbDevice

    • Constructor Summary

      Constructors 
      Constructor Description
      FreeBsdUsbDevice​(java.lang.String name, java.lang.String vendor, java.lang.String vendorId, java.lang.String productId, java.lang.String serialNumber, java.lang.String uniqueDeviceId, java.util.List<UsbDevice> connectedDevices)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void addDevicesToList​(java.util.List<UsbDevice> deviceList, java.util.List<UsbDevice> list)  
      private static FreeBsdUsbDevice getDeviceAndChildren​(java.lang.String devPath, java.lang.String vid, java.lang.String pid, java.util.Map<java.lang.String,​java.lang.String> nameMap, java.util.Map<java.lang.String,​java.lang.String> vendorMap, java.util.Map<java.lang.String,​java.lang.String> vendorIdMap, java.util.Map<java.lang.String,​java.lang.String> productIdMap, java.util.Map<java.lang.String,​java.lang.String> serialMap, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> hubMap)
      Recursively creates FreeBsdUsbDevices by fetching information from maps to populate fields
      private static java.util.List<UsbDevice> getUsbDevices()  
      static java.util.List<UsbDevice> getUsbDevices​(boolean tree)
      Instantiates a list of UsbDevice objects, representing devices connected via a usb port (including internal devices).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FreeBsdUsbDevice

        public FreeBsdUsbDevice​(java.lang.String name,
                                java.lang.String vendor,
                                java.lang.String vendorId,
                                java.lang.String productId,
                                java.lang.String serialNumber,
                                java.lang.String uniqueDeviceId,
                                java.util.List<UsbDevice> connectedDevices)
    • Method Detail

      • getUsbDevices

        public static java.util.List<UsbDevice> getUsbDevices​(boolean tree)
        Instantiates a list of UsbDevice objects, representing devices connected via a usb port (including internal devices).

        If the value of tree is 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 of tree is 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 UsbDevice objects.
      • getUsbDevices

        private static java.util.List<UsbDevice> getUsbDevices()
      • addDevicesToList

        private static void addDevicesToList​(java.util.List<UsbDevice> deviceList,
                                             java.util.List<UsbDevice> list)
      • getDeviceAndChildren

        private static FreeBsdUsbDevice getDeviceAndChildren​(java.lang.String devPath,
                                                             java.lang.String vid,
                                                             java.lang.String pid,
                                                             java.util.Map<java.lang.String,​java.lang.String> nameMap,
                                                             java.util.Map<java.lang.String,​java.lang.String> vendorMap,
                                                             java.util.Map<java.lang.String,​java.lang.String> vendorIdMap,
                                                             java.util.Map<java.lang.String,​java.lang.String> productIdMap,
                                                             java.util.Map<java.lang.String,​java.lang.String> serialMap,
                                                             java.util.Map<java.lang.String,​java.util.List<java.lang.String>> hubMap)
        Recursively creates FreeBsdUsbDevices 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 SolarisUsbDevice corresponding to this device