FileDocCategorySizeDatePackage
PrettyUSBDeviceLister.javaAPI DocExample922Thu Feb 16 08:48:34 GMT 2006None

PrettyUSBDeviceLister

public class PrettyUSBDeviceLister extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidlistDevices(UsbHub hub)

    List devices = hub.getAttachedUsbDevices();
    Iterator iterator = devices.iterator();
    while (iterator.hasNext()) {
      UsbDevice device = (UsbDevice) iterator.next();
      System.out.println(device.getProductString());
      System.out.println(device.getSerialNumberString());
      System.out.println(device.getManufacturerString());
      System.out.println();
      if (device.isUsbHub()) {
        listDevices((UsbHub) device);
      }
    } 
  
public static voidmain(java.lang.String[] args)

    UsbServices services = UsbHostManager.getUsbServices();
    UsbHub root = services.getRootUsbHub();
    listDevices(root);