javax.usb.examples
Class FindUsbDevice

java.lang.Object
  extended by javax.usb.examples.FindUsbDevice

public class FindUsbDevice
extends Object

Find a specific UsbDevice.

This finds a specific UsbDevice based on some of the device's properties. This class should not be used except by other example code.

Author:
Dan Streetman

Constructor Summary
FindUsbDevice()
           
 
Method Summary
static List getAllUsbDevices(UsbDevice usbDevice)
          This forms an inclusive list of all UsbDevices connected to this UsbDevice.
static byte getDeviceClass()
          Get a device class.
static String getManufacturerString()
          Get a manufacturer string.
static short getProductId()
          Get a product ID.
static List getUsbDevicesWithDeviceClass(UsbDevice usbDevice, byte deviceClass)
          Get a List of all devices that match the specified device class.
static List getUsbDevicesWithId(UsbDevice usbDevice, short vendorId, short productId)
          Get a List of all devices that match the specified vendor and product id.
static List getUsbDevicesWithManufacturerString(UsbDevice usbDevice, String manufacturerString)
          Get a List of all devices that match the specified manufacturer string.
static short getVendorId()
          Get a vendor ID.
static void main(String[] argv)
           
static void parseArgv(String[] argv)
          Parse the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindUsbDevice

public FindUsbDevice()
Method Detail

main

public static void main(String[] argv)

getAllUsbDevices

public static List getAllUsbDevices(UsbDevice usbDevice)
This forms an inclusive list of all UsbDevices connected to this UsbDevice.

The list includes the provided device. If the device is also a hub, the list will include all devices connected to it, recursively.

Parameters:
usbDevice - The UsbDevice to use.
Returns:
An inclusive List of all connected UsbDevices.

getUsbDevicesWithId

public static List getUsbDevicesWithId(UsbDevice usbDevice,
                                       short vendorId,
                                       short productId)
Get a List of all devices that match the specified vendor and product id.

Parameters:
usbDevice - The UsbDevice to check.
vendorId - The vendor id to match.
productId - The product id to match.
A - List of any matching UsbDevice(s).

getUsbDevicesWithDeviceClass

public static List getUsbDevicesWithDeviceClass(UsbDevice usbDevice,
                                                byte deviceClass)
Get a List of all devices that match the specified device class.

Parameters:
usbDevice - The UsbDevice to check.
deviceClass - The device class to match.
Returns:
A List of any matching UsbDevice(s).

getUsbDevicesWithManufacturerString

public static List getUsbDevicesWithManufacturerString(UsbDevice usbDevice,
                                                       String manufacturerString)
Get a List of all devices that match the specified manufacturer string.

Parameters:
usbDevice - The UsbDevice to check.
manufacturerString - The manufacturer string to match.
Returns:
A List of any matching UsbDevice(s).

getVendorId

public static short getVendorId()
Get a vendor ID.

Returns:
A vendor ID.

getProductId

public static short getProductId()
Get a product ID.

Returns:
A product ID.

getDeviceClass

public static byte getDeviceClass()
Get a device class.

Returns:
A device class.

getManufacturerString

public static String getManufacturerString()
Get a manufacturer string.

Returns:
A manufacturer string.

parseArgv

public static void parseArgv(String[] argv)
Parse the parameters.

Parameters:
argv - The command-line parameters.


Copyright © 2013 LSST. All Rights Reserved.