#include <FTD2XX.h>
Public Member Functions | |
FTD2XX (FTD2XXDeviceInfo &info) throw (IOException) | |
~FTD2XX () | |
void | close () throw (IOException) |
FTD2XXDeviceInfo | getDeviceInfo () throw (IOException) |
InputStream * | getInputStream () throw (IOException) |
OutputStream * | getOutputStream () throw (IOException) |
int | read (uint8_t *buffer, int length) throw (IOException) |
int | write (uint8_t *buffer, int length) throw (IOException) |
int | available () throw (IOException) |
void | setTimeouts (int rxTimeout, int txTimeout) throw (IOException) |
void | setBaudRate (int rate) throw (IOException) |
void | setDataCharacteristics (FTD2XXDataBits dataBits, FTD2XXStopBits stopBits, FTD2XXParity parity) throw (IOException) |
void | setFlowControl (FTD2XXFlowControl flowControl, char xon, char xoff) throw (IOException) |
Static Public Member Functions | |
static int | getNumberOfDevices () throw (IOException) |
static vector< FTD2XXDeviceInfo > | getDeviceInfoList () throw (IOException) |
Typical use:
FTD2XX device; InputStream* in; OutputStream* out;
cout << "Devices present: " << FTD2XX.getNumberOfDevices(); for (FTD2XXDeviceInfo info : FTD2XX.getDeviceInfoList()) System.out.println(" " + info);
device = new FTD2XX(FTD2XX.getDeviceInfoList()); in = device.getInputStream(); out = device.getOutputStream(); ... // configure device (baud rate, parity, data bits, stop bits, flow control, etc) ... // communicate through the I/O streams device.close();
Definition at line 82 of file FTD2XX.h.
AnnotatorComm::FTD2XX::FTD2XX::FTD2XX | ( | FTD2XXDeviceInfo & | info | ) | throw (IOException) |
AnnotatorComm::FTD2XX::FTD2XX::~FTD2XX | ( | ) |
FTD2XX
destructor
int AnnotatorComm::FTD2XX::FTD2XX::available | ( | ) | throw (IOException) |
Get the number of bytes available to read.
IOException | failure to get number of bytes available |
void AnnotatorComm::FTD2XX::FTD2XX::close | ( | ) | throw (IOException) |
Close the device and its I/O stream. All method calls throw an IOException once close() has been called. Further access to the device requires it to be reopened with a new FTD2XX object.
IOException | failure to close |
FTD2XXDeviceInfo AnnotatorComm::FTD2XX::FTD2XX::getDeviceInfo | ( | ) | throw (IOException) |
Get information about the device.
static vector<FTD2XXDeviceInfo> AnnotatorComm::FTD2XX::FTD2XX::getDeviceInfoList | ( | ) | throw (IOException) [static] |
Get a listing of devices and information about their current state.
IOException | failure to get listing |
InputStream* AnnotatorComm::FTD2XX::FTD2XX::getInputStream | ( | ) | throw (IOException) |
Get an input stream to the device.
IOException | failure to get stream |
static int AnnotatorComm::FTD2XX::FTD2XX::getNumberOfDevices | ( | ) | throw (IOException) [static] |
Get the number of devices connected.
IOException | failure to get number of devices |
OutputStream* AnnotatorComm::FTD2XX::FTD2XX::getOutputStream | ( | ) | throw (IOException) |
Get an output stream to the device.
IOException | failure to get stream |
int AnnotatorComm::FTD2XX::FTD2XX::read | ( | uint8_t * | buffer, | |
int | length | |||
) | throw (IOException) |
Fill a buffer from the device.
buffer | buffer to fill | |
length | buffer length |
IOException | failure to read |
void AnnotatorComm::FTD2XX::FTD2XX::setBaudRate | ( | int | rate | ) | throw (IOException) |
void AnnotatorComm::FTD2XX::FTD2XX::setDataCharacteristics | ( | FTD2XXDataBits | dataBits, | |
FTD2XXStopBits | stopBits, | |||
FTD2XXParity | parity | |||
) | throw (IOException) |
Set data bits, stop bits, and parity.
dataBits | number of data bits | |
stopBits | number of stop bits | |
parity | parity type |
IOException | failure to set data characteristics |
void AnnotatorComm::FTD2XX::FTD2XX::setFlowControl | ( | FTD2XXFlowControl | flowControl, | |
char | xon, | |||
char | xoff | |||
) | throw (IOException) |
Set the flow control mode specifying Xon and Xoff values.
flowControl | flow control mode | |
xon | Xon value | |
xoff | Xoff value |
IOException | failure to set mode |
void AnnotatorComm::FTD2XX::FTD2XX::setTimeouts | ( | int | rxTimeout, | |
int | txTimeout | |||
) | throw (IOException) |
Set the RX and TX timeouts.
rxTimeout | RX timeout in ms | |
txTimeout | TX timeout in ms |
IOException | failure to set timeouts |
int AnnotatorComm::FTD2XX::FTD2XX::write | ( | uint8_t * | buffer, | |
int | length | |||
) | throw (IOException) |
Write a buffer to the device.
buffer | buffer to write | |
length | buffer length |
IOException | failure to write buffer |