|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.acces.aiousb.USBDeviceManager
public class USBDeviceManager
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 |
---|
public static final java.lang.String VERSION_NUMBER
public static final java.lang.String VERSION_DATE
public static final int SUCCESS
public static final int MIN_PRODUCT_ID
public static final int MAX_PRODUCT_ID
public static final int USB_DA12_8A_REV_A
USB_DA12_8A_Family
.
public static final int USB_DA12_8A
USB_DA12_8A_Family
.
public static final int USB_DA12_8E
USB_DA12_8E_Family
.
public static final int USB_DIO_32
USB_DIO_32_Family
.
public static final int USB_DIO_48
USB_DIO_Family
.
public static final int USB_DIO_96
USB_DIO_Family
.
public static final int USB_DI16A_REV_A1
USB_DIO_16_Family
.
public static final int USB_DO16A_REV_A1
USB_DIO_16_Family
.
public static final int USB_DI16A_REV_A2
USB_DIO_16_Family
.
public static final int USB_DIO_16H
USB_DIO_16_Family
.
public static final int USB_DI16A
USB_DIO_16_Family
.
public static final int USB_DO16A
USB_DIO_16_Family
.
public static final int USB_DIO_16A
USB_DIO_16_Family
.
public static final int USB_IIRO_16
USB_DIO_Family
.
public static final int USB_II_16
USB_DIO_Family
.
public static final int USB_RO_16
USB_DIO_Family
.
public static final int USB_IIRO_8
USB_DIO_Family
.
public static final int USB_II_8
USB_DIO_Family
.
public static final int USB_IIRO_4
USB_DIO_Family
.
public static final int USB_IDIO_16
USB_DIO_Family
.
public static final int USB_II_16_OLD
USB_DIO_Family
.
public static final int USB_IDO_16
USB_DIO_Family
.
public static final int USB_IDIO_8
USB_DIO_Family
.
public static final int USB_II_8_OLD
USB_DIO_Family
.
public static final int USB_IDIO_4
USB_DIO_Family
.
public static final int USB_CTR_15
USB_CTR_15_Family
.
public static final int USB_IIRO4_2SM
USB_DIO_Family
.
public static final int USB_IIRO4_COM
USB_DIO_Family
.
public static final int USB_DIO16RO8
USB_DIO_Family
.
public static final int PICO_DIO16RO8
USB_DIO_Family
.
public static final int USB_AI16_16A
USB_AI16_Family
.
public static final int USB_AI16_16E
USB_AI16_Family
.
public static final int USB_AI12_16A
USB_AI16_Family
.
public static final int USB_AI12_16
USB_AI16_Family
.
public static final int USB_AI12_16E
USB_AI16_Family
.
public static final int USB_AI16_64MA
USB_AI16_Family
.
public static final int USB_AI16_64ME
USB_AI16_Family
.
public static final int USB_AI12_64MA
USB_AI16_Family
.
public static final int USB_AI12_64M
USB_AI16_Family
.
public static final int USB_AI12_64ME
USB_AI16_Family
.
public static final int USB_AI16_32A
USB_AI16_Family
.
public static final int USB_AI16_32E
USB_AI16_Family
.
public static final int USB_AI12_32A
USB_AI16_Family
.
public static final int USB_AI12_32
USB_AI16_Family
.
public static final int USB_AI12_32E
USB_AI16_Family
.
public static final int USB_AI16_64A
USB_AI16_Family
.
public static final int USB_AI16_64E
USB_AI16_Family
.
public static final int USB_AI12_64A
USB_AI16_Family
.
public static final int USB_AI12_64
USB_AI16_Family
.
public static final int USB_AI12_64E
USB_AI16_Family
.
public static final int USB_AI16_96A
USB_AI16_Family
.
public static final int USB_AI16_96E
USB_AI16_Family
.
public static final int USB_AI12_96A
USB_AI16_Family
.
public static final int USB_AI12_96
USB_AI16_Family
.
public static final int USB_AI12_96E
USB_AI16_Family
.
public static final int USB_AI16_128A
USB_AI16_Family
.
public static final int USB_AI16_128E
USB_AI16_Family
.
public static final int USB_AI12_128A
USB_AI16_Family
.
public static final int USB_AI12_128
USB_AI16_Family
.
public static final int USB_AI12_128E
USB_AI16_Family
.
public static final int USB_AO16_16A
USB_AO16_Family
.
public static final int USB_AO16_16
USB_AO16_Family
.
public static final int USB_AO16_12A
USB_AO16_Family
.
public static final int USB_AO16_12
USB_AO16_Family
.
public static final int USB_AO16_8A
USB_AO16_Family
.
public static final int USB_AO16_8
USB_AO16_Family
.
public static final int USB_AO16_4A
USB_AO16_Family
.
public static final int USB_AO16_4
USB_AO16_Family
.
public static final int USB_AO12_16A
USB_AO16_Family
.
public static final int USB_AO12_16
USB_AO16_Family
.
public static final int USB_AO12_12A
USB_AO16_Family
.
public static final int USB_AO12_12
USB_AO16_Family
.
public static final int USB_AO12_8A
USB_AO16_Family
.
public static final int USB_AO12_8
USB_AO16_Family
.
public static final int USB_AO12_4A
USB_AO16_Family
.
public static final int USB_AO12_4
USB_AO16_Family
.
Constructor Detail |
---|
public USBDeviceManager()
open()
before using the device manager.
Method Detail |
---|
public java.io.PrintStream print(java.io.PrintStream stream)
stream
- the print stream where properties will be printed.
public USBDeviceManager printDevices()
OperationFailedException
public java.lang.String getAIOUSBVersion()
public java.lang.String getAIOUSBVersionDate()
public static java.lang.String productIDToName(int productID)
productNameToID()
.
open()
method is called.
productID
- the product ID to translate to a product name.
java.lang.IllegalArgumentException
public static java.lang.String[] productIDToName(int[] productID)
productIDToName()
except that it operates
on an array of product IDs rather than an individual product ID.
open()
method is called.
productID
- an array of product IDs to translate to product names.
java.lang.IllegalArgumentException
public static int productNameToID(java.lang.String productName)
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.
open()
method is called.
productName
- the product name to translate to a product ID.
java.lang.IllegalArgumentException
public static int[] productNameToID(java.lang.String[] productName)
productNameToID()
except that it operates
on an array of product names rather than an individual product name.
open()
method is called.
productName
- an array of product names to translate to product IDs.
java.lang.IllegalArgumentException
public void listDevices()
printDevices()
but is implemented
by the underlying AIOUSB module and produces different output than printDevices(). Mainly
useful for diagnostic purposes.
public static java.lang.String getResultCodeAsString(int result)
OperationFailedException
is thrown in response to an AIOUSB failure.
open()
method is called.
result
- an AIOUSB result code.
public boolean isOpen()
open()
).
public USBDeviceManager open()
close()
must be called. It is possible to call close() and then call open() again, which effectively
reinitializes everything.
OperationFailedException
public USBDeviceManager close()
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.
OperationFailedException
public USBDeviceManager scanForDevices()
open()
. You must terminate use of all USB devices before calling
scanForDevices()! After calling scanForDevices() you can reestablish
connections to USB devices.
OperationFailedException
public USBDevice[] getDeviceByProductID(int productID)
productNameToID()
, like so:
USBDevice[] devices = deviceManager.getDeviceByProductID( deviceManager.productNameToID( "USB-CTR-15" ) );
productID
- the product ID to search for.
public USBDevice[] getDeviceByProductID(int minProductID, int maxProductID)
minProductID
- the minimum product ID to search for.maxProductID
- the maximum product ID to search for.
java.lang.IllegalArgumentException
public USBDevice[] getDeviceByProductID(int[] productIDs)
productNameToID()
, like so:
USBDevice[] devices = deviceManager.getDeviceByProductID( deviceManager.productNameToID( new String[] { "USB-AO16-16A", "USB-AO16-16" } ) );
productIDs
- an array containing one or more product IDs to search for.
java.lang.IllegalArgumentException
public USBDevice[] getDeviceBySerialNumber(long serialNumber)
serialNumber
- the serial number to search for.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |