public class FtdiLocal extends Object implements FtdiInterface
| Constructor and Description |
|---|
FtdiLocal() |
| 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 org.lsst.ccs.drivers.commons.DriverException
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, restricts the list of
available devices to those with a serial number
containing this string.org.lsst.ccs.drivers.commons.DriverExceptionpublic void open(String node, int index, String serial) throws org.lsst.ccs.drivers.commons.DriverException
open in interface FtdiInterfacenode - The name of the node where the device is located, or
null to specify a local device.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.org.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
close in interface FtdiInterfaceorg.lsst.ccs.drivers.commons.DriverExceptionpublic void setBaudrate(int baudrate)
throws org.lsst.ccs.drivers.commons.DriverException
setBaudrate in interface FtdiInterfacebaudrate - The baud rate to set.org.lsst.ccs.drivers.commons.DriverExceptionpublic void setDataCharacteristics(int wordLength,
int stopBits,
int parity)
throws org.lsst.ccs.drivers.commons.DriverException
setDataCharacteristics in interface FtdiInterfacewordLength - The encoded word length to set..stopBits - The encoded number of stop bits to set..parity - The encoded parity value to set.org.lsst.ccs.drivers.commons.DriverExceptionpublic void setTimeouts(int rcveTimeout,
int xmitTimeout)
throws org.lsst.ccs.drivers.commons.DriverException
setTimeouts in interface FtdiInterfacercveTimeout - The receive timeout to set (ms). A value of 0
means no timeout.xmitTimeout - The transmit timeout to set (ms). A value of 0
means no timeout.org.lsst.ccs.drivers.commons.DriverExceptionpublic int read(byte[] data)
throws org.lsst.ccs.drivers.commons.DriverException
read in interface FtdiInterfacedata - A byte array to receive the read data.org.lsst.ccs.drivers.commons.DriverExceptionpublic int read(byte[] data,
int offset,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
read in interface FtdiInterfacedata - A byte array to receive the read data.offset - The offset in the array to the start of the data.count - The maximum number of bytes to read.org.lsst.ccs.drivers.commons.DriverExceptionpublic int write(byte[] data)
throws org.lsst.ccs.drivers.commons.DriverException
write in interface FtdiInterfacedata - A byte array containing the data to write.org.lsst.ccs.drivers.commons.DriverExceptionpublic int write(byte[] data,
int offset,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
write in interface FtdiInterfacedata - A byte array containing the data to write.offset - The offset in the array to the start of the data.count - The number of bytes to write.org.lsst.ccs.drivers.commons.DriverExceptionpublic int getQueueStatus()
throws org.lsst.ccs.drivers.commons.DriverException
getQueueStatus in interface FtdiInterfaceorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getModemStatus()
throws org.lsst.ccs.drivers.commons.DriverException
getModemStatus in interface FtdiInterfaceorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2014 LSST. All rights reserved.