public class Ascii extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CONN_TYPE_FTDI
Connection type - serial via FTDI chip
|
static int |
CONN_TYPE_NETWORK
Connection type - network
|
static int |
CONN_TYPE_SERIAL
Connection type - serial via serial port
|
| Constructor and Description |
|---|
Ascii() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the device connection.
|
boolean |
closeSilent()
Closes the device connection silently.
|
void |
flush()
Flushes any unread data.
|
void |
open(int type,
String ident,
int parm)
Opens a connection to the device.
|
void |
open(int type,
String ident,
int parm1,
int parm2)
Opens a connection to the device.
|
String |
read()
Reads a response.
|
String |
read(String command)
Reads a response after writing a command.
|
void |
setTerminator(String term)
Sets the command terminator.
|
void |
setTimeout(double time)
Sets the read timeout.
|
void |
write(String command)
Writes a command.
|
public static final int CONN_TYPE_NETWORK
public static final int CONN_TYPE_FTDI
public static final int CONN_TYPE_SERIAL
public void open(int type,
String ident,
int parm)
throws org.lsst.ccs.drivers.commons.DriverException
type - The type of connection to makeident - The device identifier:
host name or IP address for network
serial number for FTDI device
device name for serialparm - The device parameter:
port number for network
baud rate for FTDI or serialorg.lsst.ccs.drivers.commons.DriverExceptionpublic void open(int type,
String ident,
int parm1,
int parm2)
throws org.lsst.ccs.drivers.commons.DriverException
type - The type of connection to makeident - The device identifier:
host name or IP address for network
serial number for FTDI device
device name for serialparm1 - The first device parameter:
port number for network
baud rate for FTDI or serialparm2 - The second device parameter:
unused for network or serial
device index for FTDIorg.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic boolean closeSilent()
public void write(String command) throws org.lsst.ccs.drivers.commons.DriverException
command - The command to write, excluding terminatororg.lsst.ccs.drivers.commons.DriverExceptionpublic String read() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionorg.lsst.ccs.drivers.commons.DriverTimeoutExceptionpublic String read(String command) throws org.lsst.ccs.drivers.commons.DriverException
command - The command to write, excluding terminatororg.lsst.ccs.drivers.commons.DriverExceptionorg.lsst.ccs.drivers.commons.DriverTimeoutExceptionpublic void flush()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setTerminator(String term)
term - The terminator to be appended to each sent commandpublic void setTimeout(double time)
throws org.lsst.ccs.drivers.commons.DriverException
time - The read timeout (sec). 0 means no timeout.org.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2014 LSST. All rights reserved.