AIOUSB::USBDevice Class Reference
#include <USBDevice.hpp>
List of all members.
Detailed Description
Class
USBDevice is the abstract super class of all USB device families.
Constructor & Destructor Documentation
AIOUSB::USBDevice::USBDevice |
( |
int |
productID, |
|
|
int |
deviceIndex | |
|
) |
| | [protected] |
AIOUSB::USBDevice::~USBDevice |
( |
|
) |
[protected, virtual] |
Member Function Documentation
USBDevice & AIOUSB::USBDevice::clearFIFO |
( |
int |
method |
) |
[protected] |
UCharArray AIOUSB::USBDevice::customEEPROMRead |
( |
int |
address, |
|
|
int |
numBytes | |
|
) |
| | |
Reads data from the custom programming area of the device EEPROM.
- Parameters:
-
| address | starting address from 0x000 to 0x1FF within the EEPROM. |
| numBytes | the number of bytes to read from the EEPROM, beginning at the starting address. The starting address plus the number of bytes to read may not exceed the maximum address of 0x1FF. |
- Returns:
- An array of bytes containing the data read from the EEPROM. The length of the array will be equal to numBytes.
- Exceptions:
-
Writes data to the custom programming area of the device EEPROM. Beware that writing to the EEPROM is particularly slow. Writing the entire EEPROM may take several seconds. Before initiating a lengthy EEPROM write procedure, it is recommended that the communication timeout be increased to at least five seconds, if not ten (see setCommTimeout( int timeout )). Otherwise, a timeout error will occur before the write procedure finishes. Once the write procedure is finished, you can restore the timeout to a more reasonable value. If you are writing a smaller amount of data to the EEPROM, you may reduce the timeout proportionately.
- Parameters:
-
| address | starting address from 0x000 to 0x1FF within the EEPROM. |
| data | an array of bytes containing the data to write to the EEPROM, beginning at the starting address. The starting address plus the data size may not exceed the maximum address of 0x1FF. |
- Returns:
- This device, useful for chaining together multiple operations.
- Exceptions:
-
int AIOUSB::USBDevice::getCommTimeout |
( |
|
) |
const |
Gets the current timeout setting for USB communications.
- Returns:
- Current timeout setting (in milliseconds).
- See also:
- setCommTimeout( int timeout )
int AIOUSB::USBDevice::getDeviceIndex |
( |
|
) |
const [inline] |
Gets the device's index on the USB bus. The device index isn't used within this Java class library, but is used in the underlying AIOUSB library. The device index is somewhat useful within this Java class library to differentiate between multiple devices of the same type.
- Returns:
- The index of the device on the USB bus.
double AIOUSB::USBDevice::getMiscClock |
( |
|
) |
[inline, protected] |
const std::string& AIOUSB::USBDevice::getName |
( |
|
) |
const [inline] |
Gets the device's name.
- Returns:
- The device name.
int AIOUSB::USBDevice::getProductID |
( |
|
) |
const [inline] |
Gets the device's product ID.
- Returns:
- The device product ID.
__uint64_t AIOUSB::USBDevice::getSerialNumber |
( |
|
) |
const [inline] |
Gets the device's serial number.
- Returns:
- The device serial number (a 64-bit integer).
- Exceptions:
-
int AIOUSB::USBDevice::getStreamingBlockSize |
( |
|
) |
[protected] |
ostream & AIOUSB::USBDevice::print |
( |
std::ostream & |
out |
) |
[virtual] |
Perform a USB port reset to reinitialize the device.
- Returns:
- This device, useful for chaining together multiple operations.
- Exceptions:
-
USBDevice & AIOUSB::USBDevice::setCommTimeout |
( |
int |
timeout |
) |
|
Sets the timeout for USB communications.
- Parameters:
-
| timeout | the new timeout setting (in milliseconds; default is 5,000). |
- Returns:
- This device, useful for chaining together multiple operations.
- Exceptions:
-
USBDevice & AIOUSB::USBDevice::setMiscClock |
( |
double |
clockHz |
) |
[protected] |
USBDevice & AIOUSB::USBDevice::setStreamingBlockSize |
( |
int |
blockSize |
) |
[protected] |
Friends And Related Function Documentation
Member Data Documentation
Enable auto-clear FIFO every falling edge of DIO port D bit 1 (on digital boards, analog boards treat as 0).
Clear FIFO as soon as command received (and disable auto-clear).
Clear FIFO as soon as command received (and disable auto-clear), and abort stream.
Clear FIFO and wait for it to be emptied.
Size of custom EEPROM area (bytes).