List devices = hub.getAttachedUsbDevices(); Iterator iterator = devices.iterator(); while (iterator.hasNext()) { UsbDevice device = (UsbDevice) iterator.next(); listStrings(device); if (device.isUsbHub()) { listDevices((UsbHub) device); } }
for (int i = 0; i <= 255; i++) { try { String s = device.getString((byte) i); System.out.println(" " + i + ":\t" + s); } catch (UsbStallException ex) { // We've reached the end of the table for this device. break; } } System.out.println();
UsbServices services = UsbHostManager.getUsbServices(); UsbHub root = services.getRootUsbHub(); listDevices(root);