public class FtdiClient extends Object implements FtdiInterface
| Constructor and Description |
|---|
FtdiClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the device.
|
int |
getModemStatus()
Gets the modem status.
|
int |
getQueueStatus()
Gets the read queue status.
|
void |
open(int index,
String serial)
Opens a local device.
|
void |
open(String node,
int index,
String serial)
Opens a remote device.
|
int |
read(byte[] data)
Reads data.
|
int |
read(byte[] data,
int offset,
int count)
Reads data.
|
void |
setBaudrate(int baudrate)
Sets the baud rate.
|
void |
setDataCharacteristics(int wordLength,
int stopBits,
int parity)
Sets the data characteristics.
|
void |
setTimeouts(int rcveTimeout,
int xmitTimeout)
Sets the timeouts.
|
int |
write(byte[] data)
Writes data.
|
int |
write(byte[] data,
int offset,
int count)
Writes data.
|
public void open(int index,
String serial)
throws FtdiException
open in interface FtdiInterfaceindex - The zero-based index of the FTDI device within the
list selected by the serial argument.serial - A string which, if non-null and non-empty, restricts
the list of available devices to those with a serial
number containing this string.FtdiExceptionpublic void open(String node, int index, String serial) throws FtdiException
open in interface FtdiInterfacenode - The name of the node where the device is located.index - The zero-based index of the FTDI device within the
list selected by the serial argument.serial - A string which, if non-null and non-empty, restricts
the list of available devices to those with a serial
number containing this string.FtdiExceptionpublic void close()
throws FtdiException
close in interface FtdiInterfaceFtdiExceptionpublic void setBaudrate(int baudrate)
throws FtdiException
setBaudrate in interface FtdiInterfacebaudrate - The baud rate ro setFtdiExceptionpublic void setDataCharacteristics(int wordLength,
int stopBits,
int parity)
throws FtdiException
setDataCharacteristics in interface FtdiInterfacewordLength - The encoded word length to setstopBits - The encoded number of stop bits to setparity - The encoded parity value to setFtdiExceptionpublic void setTimeouts(int rcveTimeout,
int xmitTimeout)
throws FtdiException
setTimeouts in interface FtdiInterfacercveTimeout - The receive timeout to set (ms)xmitTimeout - The transmit timeout to set (ms)FtdiExceptionpublic int read(byte[] data)
throws FtdiException
read in interface FtdiInterfacedata - A byte array to receive the read data.FtdiExceptionpublic int read(byte[] data,
int offset,
int count)
throws FtdiException
read in interface FtdiInterfacedata - A byte array to receive the read dataoffset - The offset in the array to the start of the datacount - The maximum number of bytes to readFtdiExceptionpublic int write(byte[] data)
throws FtdiException
write in interface FtdiInterfacedata - A byte array containing the data to write.FtdiExceptionpublic int write(byte[] data,
int offset,
int count)
throws FtdiException
write in interface FtdiInterfacedata - A byte array containing the data to writeoffset - The offset in the array to the start of the datacount - The number of bytes to writeFtdiExceptionpublic int getQueueStatus()
throws FtdiException
getQueueStatus in interface FtdiInterfaceFtdiExceptionpublic int getModemStatus()
throws FtdiException
getModemStatus in interface FtdiInterfaceFtdiExceptionCopyright © 2014 LSST. All Rights Reserved.