com.acces.aiousb
Class USBDeviceManager

java.lang.Object
  extended by com.acces.aiousb.USBDeviceManager

public class USBDeviceManager
extends java.lang.Object

Class USBDeviceManager manages all the USB devices on the bus. It scans the bus and builds a list of all the devices found. It also initializes and terminates use of the underlying AIOUSB module.


Field Summary
static int MAX_PRODUCT_ID
           
static int MIN_PRODUCT_ID
           
static int PICO_DIO16RO8
          Supported by USB_DIO_Family.
static int SUCCESS
          Indicates that underlying AIOUSB module operation succeeded.
static int USB_AI12_128
          Supported by USB_AI16_Family.
static int USB_AI12_128A
          Supported by USB_AI16_Family.
static int USB_AI12_128E
          Supported by USB_AI16_Family.
static int USB_AI12_16
          Supported by USB_AI16_Family.
static int USB_AI12_16A
          Supported by USB_AI16_Family.
static int USB_AI12_16E
          Supported by USB_AI16_Family.
static int USB_AI12_32
          Supported by USB_AI16_Family.
static int USB_AI12_32A
          Supported by USB_AI16_Family.
static int USB_AI12_32E
          Supported by USB_AI16_Family.
static int USB_AI12_64
          Supported by USB_AI16_Family.
static int USB_AI12_64A
          Supported by USB_AI16_Family.
static int USB_AI12_64E
          Supported by USB_AI16_Family.
static int USB_AI12_64M
          Supported by USB_AI16_Family.
static int USB_AI12_64MA
          Supported by USB_AI16_Family.
static int USB_AI12_64ME
          Supported by USB_AI16_Family.
static int USB_AI12_96
          Supported by USB_AI16_Family.
static int USB_AI12_96A
          Supported by USB_AI16_Family.
static int USB_AI12_96E
          Supported by USB_AI16_Family.
static int USB_AI16_128A
          Supported by USB_AI16_Family.
static int USB_AI16_128E
          Supported by USB_AI16_Family.
static int USB_AI16_16A
          Supported by USB_AI16_Family.
static int USB_AI16_16E
          Supported by USB_AI16_Family.
static int USB_AI16_32A
          Supported by USB_AI16_Family.
static int USB_AI16_32E
          Supported by USB_AI16_Family.
static int USB_AI16_64A
          Supported by USB_AI16_Family.
static int USB_AI16_64E
          Supported by USB_AI16_Family.
static int USB_AI16_64MA
          Supported by USB_AI16_Family.
static int USB_AI16_64ME
          Supported by USB_AI16_Family.
static int USB_AI16_96A
          Supported by USB_AI16_Family.
static int USB_AI16_96E
          Supported by USB_AI16_Family.
static int USB_AO12_12
          Supported by USB_AO16_Family.
static int USB_AO12_12A
          Supported by USB_AO16_Family.
static int USB_AO12_16
          Supported by USB_AO16_Family.
static int USB_AO12_16A
          Supported by USB_AO16_Family.
static int USB_AO12_4
          Supported by USB_AO16_Family.
static int USB_AO12_4A
          Supported by USB_AO16_Family.
static int USB_AO12_8
          Supported by USB_AO16_Family.
static int USB_AO12_8A
          Supported by USB_AO16_Family.
static int USB_AO16_12
          Supported by USB_AO16_Family.
static int USB_AO16_12A
          Supported by USB_AO16_Family.
static int USB_AO16_16
          Supported by USB_AO16_Family.
static int USB_AO16_16A
          Supported by USB_AO16_Family.
static int USB_AO16_4
          Supported by USB_AO16_Family.
static int USB_AO16_4A
          Supported by USB_AO16_Family.
static int USB_AO16_8
          Supported by USB_AO16_Family.
static int USB_AO16_8A
          Supported by USB_AO16_Family.
static int USB_CTR_15
          Supported by USB_CTR_15_Family.
static int USB_DA12_8A
          Supported by USB_DA12_8A_Family.
static int USB_DA12_8A_REV_A
          Supported by USB_DA12_8A_Family.
static int USB_DA12_8E
          Supported by USB_DA12_8E_Family.
static int USB_DI16A
          Supported by USB_DIO_16_Family.
static int USB_DI16A_REV_A1
          Supported by USB_DIO_16_Family.
static int USB_DI16A_REV_A2
          Supported by USB_DIO_16_Family.
static int USB_DIO_16A
          Supported by USB_DIO_16_Family.
static int USB_DIO_16H
          Supported by USB_DIO_16_Family.
static int USB_DIO_32
          Supported by USB_DIO_32_Family.
static int USB_DIO_48
          Supported by USB_DIO_Family.
static int USB_DIO_96
          Supported by USB_DIO_Family.
static int USB_DIO16RO8
          Supported by USB_DIO_Family.
static int USB_DO16A
          Supported by USB_DIO_16_Family.
static int USB_DO16A_REV_A1
          Supported by USB_DIO_16_Family.
static int USB_IDIO_16
          Supported by USB_DIO_Family.
static int USB_IDIO_4
          Supported by USB_DIO_Family.
static int USB_IDIO_8
          Supported by USB_DIO_Family.
static int USB_IDO_16
          Supported by USB_DIO_Family.
static int USB_II_16
          Supported by USB_DIO_Family.
static int USB_II_16_OLD
          Supported by USB_DIO_Family.
static int USB_II_8
          Supported by USB_DIO_Family.
static int USB_II_8_OLD
          Supported by USB_DIO_Family.
static int USB_IIRO_16
          Supported by USB_DIO_Family.
static int USB_IIRO_4
          Supported by USB_DIO_Family.
static int USB_IIRO_8
          Supported by USB_DIO_Family.
static int USB_IIRO4_2SM
          Supported by USB_DIO_Family.
static int USB_IIRO4_COM
          Supported by USB_DIO_Family.
static int USB_RO_16
          Supported by USB_DIO_Family.
static java.lang.String VERSION_DATE
          The version date of this Java class library.
static java.lang.String VERSION_NUMBER
          The version number of this Java class library.
 
Constructor Summary
USBDeviceManager()
          Constructor for USB device manager.
 
Method Summary
 USBDeviceManager close()
          "Closes" the USB device manager for use.
 java.lang.String getAIOUSBVersion()
          Gets the version number of the underlying AIOUSB module.
 java.lang.String getAIOUSBVersionDate()
          Gets the version date of the underlying AIOUSB module.
 USBDevice[] getDeviceByProductID(int productID)
          Gets a list of all the devices found on the bus matching the specified product ID.
 USBDevice[] getDeviceByProductID(int[] productIDs)
          Gets a list of all the devices found on the bus matching the specified set of product IDs.
 USBDevice[] getDeviceByProductID(int minProductID, int maxProductID)
          Gets a list of all the devices found on the bus matching the specified product ID range.
 USBDevice[] getDeviceBySerialNumber(long serialNumber)
          Gets a list of all the devices found on the bus matching the specified serial number.
static java.lang.String getResultCodeAsString(int result)
          Gets the string representation of an AIOUSB result code, useful mainly for debugging purposes.
 boolean isOpen()
          Tells if the USB device manager has been "opened" for use (see open()).
 void listDevices()
          Prints the properties of all the devices found on the bus to the standard output device.
 USBDeviceManager open()
          "Opens" the USB device manager for use.
 java.io.PrintStream print(java.io.PrintStream stream)
          Prints the properties of this device manager and all of the devices found on the bus to the specified print stream.
 USBDeviceManager printDevices()
          Prints the properties of this device manager and all of the devices found on the bus to the standard output device.
static java.lang.String productIDToName(int productID)
          Gets the product name for a product ID.
static java.lang.String[] productIDToName(int[] productID)
          Gets the product names for an array of product IDs.
static int productNameToID(java.lang.String productName)
          Gets the product ID for a product name.
static int[] productNameToID(java.lang.String[] productName)
          Gets the product IDs for an array of product names.
 USBDeviceManager scanForDevices()
          Re-scans the bus for devices.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_NUMBER

public static final java.lang.String VERSION_NUMBER
The version number of this Java class library.

See Also:
Constant Field Values

VERSION_DATE

public static final java.lang.String VERSION_DATE
The version date of this Java class library.

See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
Indicates that underlying AIOUSB module operation succeeded.

See Also:
Constant Field Values

MIN_PRODUCT_ID

public static final int MIN_PRODUCT_ID
See Also:
Constant Field Values

MAX_PRODUCT_ID

public static final int MAX_PRODUCT_ID
See Also:
Constant Field Values

USB_DA12_8A_REV_A

public static final int USB_DA12_8A_REV_A
Supported by USB_DA12_8A_Family.

See Also:
Constant Field Values

USB_DA12_8A

public static final int USB_DA12_8A
Supported by USB_DA12_8A_Family.

See Also:
Constant Field Values

USB_DA12_8E

public static final int USB_DA12_8E
Supported by USB_DA12_8E_Family.

See Also:
Constant Field Values

USB_DIO_32

public static final int USB_DIO_32
Supported by USB_DIO_32_Family.

See Also:
Constant Field Values

USB_DIO_48

public static final int USB_DIO_48
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_DIO_96

public static final int USB_DIO_96
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_DI16A_REV_A1

public static final int USB_DI16A_REV_A1
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_DO16A_REV_A1

public static final int USB_DO16A_REV_A1
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_DI16A_REV_A2

public static final int USB_DI16A_REV_A2
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_DIO_16H

public static final int USB_DIO_16H
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_DI16A

public static final int USB_DI16A
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_DO16A

public static final int USB_DO16A
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_DIO_16A

public static final int USB_DIO_16A
Supported by USB_DIO_16_Family.

See Also:
Constant Field Values

USB_IIRO_16

public static final int USB_IIRO_16
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_II_16

public static final int USB_II_16
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_RO_16

public static final int USB_RO_16
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IIRO_8

public static final int USB_IIRO_8
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_II_8

public static final int USB_II_8
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IIRO_4

public static final int USB_IIRO_4
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IDIO_16

public static final int USB_IDIO_16
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_II_16_OLD

public static final int USB_II_16_OLD
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IDO_16

public static final int USB_IDO_16
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IDIO_8

public static final int USB_IDIO_8
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_II_8_OLD

public static final int USB_II_8_OLD
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IDIO_4

public static final int USB_IDIO_4
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_CTR_15

public static final int USB_CTR_15
Supported by USB_CTR_15_Family.

See Also:
Constant Field Values

USB_IIRO4_2SM

public static final int USB_IIRO4_2SM
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_IIRO4_COM

public static final int USB_IIRO4_COM
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_DIO16RO8

public static final int USB_DIO16RO8
Supported by USB_DIO_Family.

See Also:
Constant Field Values

PICO_DIO16RO8

public static final int PICO_DIO16RO8
Supported by USB_DIO_Family.

See Also:
Constant Field Values

USB_AI16_16A

public static final int USB_AI16_16A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_16E

public static final int USB_AI16_16E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_16A

public static final int USB_AI12_16A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_16

public static final int USB_AI12_16
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_16E

public static final int USB_AI12_16E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_64MA

public static final int USB_AI16_64MA
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_64ME

public static final int USB_AI16_64ME
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_64MA

public static final int USB_AI12_64MA
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_64M

public static final int USB_AI12_64M
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_64ME

public static final int USB_AI12_64ME
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_32A

public static final int USB_AI16_32A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_32E

public static final int USB_AI16_32E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_32A

public static final int USB_AI12_32A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_32

public static final int USB_AI12_32
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_32E

public static final int USB_AI12_32E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_64A

public static final int USB_AI16_64A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_64E

public static final int USB_AI16_64E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_64A

public static final int USB_AI12_64A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_64

public static final int USB_AI12_64
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_64E

public static final int USB_AI12_64E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_96A

public static final int USB_AI16_96A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_96E

public static final int USB_AI16_96E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_96A

public static final int USB_AI12_96A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_96

public static final int USB_AI12_96
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_96E

public static final int USB_AI12_96E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_128A

public static final int USB_AI16_128A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI16_128E

public static final int USB_AI16_128E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_128A

public static final int USB_AI12_128A
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_128

public static final int USB_AI12_128
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AI12_128E

public static final int USB_AI12_128E
Supported by USB_AI16_Family.

See Also:
Constant Field Values

USB_AO16_16A

public static final int USB_AO16_16A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_16

public static final int USB_AO16_16
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_12A

public static final int USB_AO16_12A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_12

public static final int USB_AO16_12
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_8A

public static final int USB_AO16_8A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_8

public static final int USB_AO16_8
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_4A

public static final int USB_AO16_4A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO16_4

public static final int USB_AO16_4
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_16A

public static final int USB_AO12_16A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_16

public static final int USB_AO12_16
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_12A

public static final int USB_AO12_12A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_12

public static final int USB_AO12_12
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_8A

public static final int USB_AO12_8A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_8

public static final int USB_AO12_8
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_4A

public static final int USB_AO12_4A
Supported by USB_AO16_Family.

See Also:
Constant Field Values

USB_AO12_4

public static final int USB_AO12_4
Supported by USB_AO16_Family.

See Also:
Constant Field Values
Constructor Detail

USBDeviceManager

public USBDeviceManager()
Constructor for USB device manager. You must call open() before using the device manager.

Method Detail

print

public java.io.PrintStream print(java.io.PrintStream stream)
Prints the properties of this device manager and all of the devices found on the bus to the specified print stream. Mainly useful for diagnostic purposes.

Parameters:
stream - the print stream where properties will be printed.
Returns:
The print stream.

printDevices

public USBDeviceManager printDevices()
Prints the properties of this device manager and all of the devices found on the bus to the standard output device. Mainly useful for diagnostic purposes.

Returns:
This device manager, useful for chaining together multiple operations.
Throws:
OperationFailedException

getAIOUSBVersion

public java.lang.String getAIOUSBVersion()
Gets the version number of the underlying AIOUSB module.

Returns:
The AIOUSB module version number as a string with the form, "1.78".

getAIOUSBVersionDate

public java.lang.String getAIOUSBVersionDate()
Gets the version date of the underlying AIOUSB module.

Returns:
The AIOUSB module version date as a string with the form, "15 November 2009".

productIDToName

public static java.lang.String productIDToName(int productID)
Gets the product name for a product ID. This name is only "approximate," as an actual device reports its own name. Generally the names reported by the device are the same as those obtained from this method, but that is not guaranteed. This method provides a name that constitutes a user-friendly alternative to a product ID number. The complement of this method is productNameToID().

Although this method is static, an instance of USBDeviceManager must be created and be "open" for use before this method can be used. This stipulation is imposed because the underlying library must be initialized in order for product name/ID lookups to succeed, and that initialization occurs only when an instance of USBDeviceManager is created and its open() method is called.

Parameters:
productID - the product ID to translate to a product name.
Returns:
A string containing the product name, or "UNKNOWN" if the product ID was not found.
Throws:
java.lang.IllegalArgumentException

productIDToName

public static java.lang.String[] productIDToName(int[] productID)
Gets the product names for an array of product IDs. Functionally identical to productIDToName() except that it operates on an array of product IDs rather than an individual product ID.

Although this method is static, an instance of USBDeviceManager must be created and be "open" for use before this method can be used. This stipulation is imposed because the underlying library must be initialized in order for product name/ID lookups to succeed, and that initialization occurs only when an instance of USBDeviceManager is created and its open() method is called.

Parameters:
productID - an array of product IDs to translate to product names.
Returns:
An array of strings containing the product names, or "UNKNOWN" for any product ID that was not found. The product names are returned in the same order as the product IDs passed in productID[].
Throws:
java.lang.IllegalArgumentException

productNameToID

public static int productNameToID(java.lang.String productName)
Gets the product ID for a product name. This method is the complement of productIDToName() and one should read the notes for that method. It is not guaranteed that productNameToID() will successfully ascertain the product ID for a name obtained from a device, although it usually will. ProductNameToID() will always successfully ascertain the product ID for a name obtained from productIDToName(). If one has access to a device and its name, then they should obtain the product ID from the device itself rather than from this method. This method is mainly for easily converting between product names and IDs, primarily to serve the needs of user interfaces.

Although this method is static, an instance of USBDeviceManager must be created and be "open" for use before this method can be used. This stipulation is imposed because the underlying library must be initialized in order for product name/ID lookups to succeed, and that initialization occurs only when an instance of USBDeviceManager is created and its open() method is called.

Parameters:
productName - the product name to translate to a product ID.
Returns:
The product ID for the specified product name, or 0 (zero) if the name was not found.
Throws:
java.lang.IllegalArgumentException

productNameToID

public static int[] productNameToID(java.lang.String[] productName)
Gets the product IDs for an array of product names. Functionally identical to productNameToID() except that it operates on an array of product names rather than an individual product name.

Although this method is static, an instance of USBDeviceManager must be created and be "open" for use before this method can be used. This stipulation is imposed because the underlying library must be initialized in order for product name/ID lookups to succeed, and that initialization occurs only when an instance of USBDeviceManager is created and its open() method is called.

Parameters:
productName - an array of product names to translate to product IDs.
Returns:
An array of integers containing the product IDs, or 0 (zero) for any product name that was not found. The product IDs are returned in the same order as the product names passed in name[].
Throws:
java.lang.IllegalArgumentException

listDevices

public void listDevices()
Prints the properties of all the devices found on the bus to the standard output device. This function is similar to printDevices() but is implemented by the underlying AIOUSB module and produces different output than printDevices(). Mainly useful for diagnostic purposes.


getResultCodeAsString

public static java.lang.String getResultCodeAsString(int result)
Gets the string representation of an AIOUSB result code, useful mainly for debugging purposes. This method is also used to convert an AIOUSB result code to a string when a OperationFailedException is thrown in response to an AIOUSB failure.

Although this method is static, an instance of USBDeviceManager must be created and be "open" for use before this method can be used. This stipulation is imposed because the underlying library must be initialized in order for result code lookups to succeed, and that initialization occurs only when an instance of USBDeviceManager is created and its open() method is called.

Parameters:
result - an AIOUSB result code.
Returns:
The string representation of result.

isOpen

public boolean isOpen()
Tells if the USB device manager has been "opened" for use (see open()).

Returns:
True indicates that the device manager is open and ready to be used; false indicates that it is not open.

open

public USBDeviceManager open()
"Opens" the USB device manager for use. Before the USB device manager may be used, open() must be called. Open() initializes the underlying AIOUSB module and scans the bus for devices, building a list of the devices found. When finished using the USB device manager, close() must be called. It is possible to call close() and then call open() again, which effectively reinitializes everything.

Returns:
This device manager, useful for chaining together multiple operations.
Throws:
OperationFailedException

close

public USBDeviceManager close()
"Closes" the USB device manager for use. When finished using the USB device manager, and assuming open() was properly called, close() must be called. Close() terminates use of the underlying AIOUSB module and discards the list of devices found. You must terminate use of all USB devices before calling close()! You can call open() again to reinitialize things and reestablish connections to USB devices.

Returns:
This device manager, useful for chaining together multiple operations.
Throws:
OperationFailedException

scanForDevices

public USBDeviceManager scanForDevices()
Re-scans the bus for devices. ScanForDevices() is called automatically by open(). You must terminate use of all USB devices before calling scanForDevices()! After calling scanForDevices() you can reestablish connections to USB devices.

Returns:
This device manager, useful for chaining together multiple operations.
Throws:
OperationFailedException

getDeviceByProductID

public USBDevice[] getDeviceByProductID(int productID)
Gets a list of all the devices found on the bus matching the specified product ID. Only devices exactly matching the specified product ID will be returned. You can search for devices by product name using productNameToID(), like so:
USBDevice[] devices = deviceManager.getDeviceByProductID( deviceManager.productNameToID( "USB-CTR-15" ) );

Parameters:
productID - the product ID to search for.
Returns:
An array of all the devices found. If no devices were found matching the specified product ID, the array will be empty (i.e. contain zero items).

getDeviceByProductID

public USBDevice[] getDeviceByProductID(int minProductID,
                                        int maxProductID)
Gets a list of all the devices found on the bus matching the specified product ID range. Any device with a product ID greater than or equal to minProductID and less than or equal to maxProductID will be returned. You can obtain the entire list of devices detected by passing a value of 0 for minProductID and a value of 0xffff for maxProductID. Then you can search the list obtained using your own search criteria.

Parameters:
minProductID - the minimum product ID to search for.
maxProductID - the maximum product ID to search for.
Returns:
An array of all the devices found. If no devices were found matching the specified product ID range, the array will be empty (i.e. contain zero items).
Throws:
java.lang.IllegalArgumentException

getDeviceByProductID

public USBDevice[] getDeviceByProductID(int[] productIDs)
Gets a list of all the devices found on the bus matching the specified set of product IDs. Any device with a product ID equal to one of the products listed in productIDs[] will be returned. You can search for devices by product name using productNameToID(), like so:
USBDevice[] devices = deviceManager.getDeviceByProductID(
  deviceManager.productNameToID( new String[] { "USB-AO16-16A", "USB-AO16-16" } ) );

Parameters:
productIDs - an array containing one or more product IDs to search for.
Returns:
An array of all the devices found. If no devices were found matching the specified set of product IDs, the array will be empty (i.e. contain zero items).
Throws:
java.lang.IllegalArgumentException

getDeviceBySerialNumber

public USBDevice[] getDeviceBySerialNumber(long serialNumber)
Gets a list of all the devices found on the bus matching the specified serial number. Only devices exactly matching the specified serial number will be returned. In theory, there ought to be only one device matching a given serial number, but this method returns a vector in order to be consistent with the other search methods, and in unlikely event that multiple devices do share the same serial number.

Parameters:
serialNumber - the serial number to search for.
Returns:
An array of all the devices found. If no devices were found matching the specified serial number, the array will be empty (i.e. contain zero items).