List devices = hub.getAttachedUsbDevices(); Iterator iterator = devices.iterator(); while (iterator.hasNext()) { UsbDevice device = (UsbDevice) iterator.next(); System.out.println(device); if (device.isUsbHub()) { listDevices((UsbHub) device); } }
UsbServices services = UsbHostManager.getUsbServices(); UsbHub root = services.getRootUsbHub(); listDevices(root);