|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lsst.ccs.drivers.ftdi.Ftdi
public class Ftdi
Accesses a device which uses the FTDI chip.
| Field Summary | |
|---|---|
static int |
DATABITS_7
Word length value: 7 bits |
static int |
DATABITS_8
Word length value: 8 bits |
static int |
PARITY_EVEN
Parity value: even |
static int |
PARITY_MARK
Parity value: mark |
static int |
PARITY_NONE
Parity value: none |
static int |
PARITY_ODD
Parity value: odd |
static int |
PARITY_SPACE
Parity value: space |
static int |
STOPBITS_1
Stop bits value: 1 |
static int |
STOPBITS_2
Stop bits value: 2 |
| Constructor Summary | |
|---|---|
Ftdi()
|
|
| Method Summary | |
|---|---|
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 local or 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DATABITS_8
public static final int DATABITS_7
public static final int STOPBITS_1
public static final int STOPBITS_2
public static final int PARITY_NONE
public static final int PARITY_ODD
public static final int PARITY_EVEN
public static final int PARITY_MARK
public static final int PARITY_SPACE
| Constructor Detail |
|---|
public Ftdi()
| Method Detail |
|---|
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.
FtdiException
public void open(String node,
int index,
String serial)
throws FtdiException
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.
FtdiException
public void close()
throws FtdiException
close in interface FtdiInterfaceFtdiException
public void setBaudrate(int baudrate)
throws FtdiException
setBaudrate in interface FtdiInterfacebaudrate - The baud rate to set.
FtdiException
public void setDataCharacteristics(int wordLength,
int stopBits,
int parity)
throws FtdiException
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.
FtdiException
public void setTimeouts(int rcveTimeout,
int xmitTimeout)
throws FtdiException
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.
FtdiException
public int read(byte[] data)
throws FtdiException
read in interface FtdiInterfacedata - A byte array to receive the read data.
FtdiException
public int read(byte[] data,
int offset,
int count)
throws FtdiException
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.
FtdiException
public int write(byte[] data)
throws FtdiException
write in interface FtdiInterfacedata - A byte array containing the data to write.
FtdiException
public int write(byte[] data,
int offset,
int count)
throws FtdiException
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.
FtdiException
public int getQueueStatus()
throws FtdiException
getQueueStatus in interface FtdiInterfaceFtdiException
public int getModemStatus()
throws FtdiException
getModemStatus in interface FtdiInterfaceFtdiException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||