public class TestAscii extends Object
| Constructor and Description |
|---|
TestAscii()
Constructor.
|
TestAscii(Ascii dev)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes connection to a device.
|
void |
open(org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
String ident,
int param)
Opens connection to a device.
|
void |
open(org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
String ident,
int baud,
Ascii.DataBits dbits,
Ascii.StopBits sbits,
Ascii.Parity parity,
Ascii.FlowCtrl flow)
Opens connection to a serially-connected device.
|
void |
openOld(org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
String ident,
int param)
Opens connection (old-style) to a device.
|
void |
openOld(org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
String ident,
int baud,
Ascii.DataBits dbits,
Ascii.StopBits sbits,
Ascii.Parity parity,
Ascii.FlowCtrl flow)
Opens connection (old-style) to a serially-connected device.
|
String |
read()
Reads a response.
|
String |
read(String command)
Writes a command and reads the response.
|
void |
setTerm(String term)
Sets the command terminator.
|
void |
timeout(double time)
Sets the response timeout.
|
void |
write(String command)
Writes a command.
|
protected final Ascii dev
public TestAscii()
public TestAscii(Ascii dev)
dev - The device to use@Command(name="open",
description="Open connection to general device")
public void open(@Argument(name="type",description="Connection type: net, serial or ftdi")
org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
@Argument(name="ident",description="Device identifier")
String ident,
@Argument(name="param",description="Device parameter")
int param)
throws org.lsst.ccs.drivers.commons.DriverException
type - The connection typeident - The device identificationparam - The device parameterorg.lsst.ccs.drivers.commons.DriverException@Command(name="open",
description="Open connection to serial device")
public void open(@Argument(name="type",description="Connection type: net, serial or ftdi")
org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
@Argument(name="ident",description="Device identifier")
String ident,
@Argument(name="baud",description="Baud rate")
int baud,
@Argument(name="dbits",description="The number of data bits")
Ascii.DataBits dbits,
@Argument(name="sbits",description="The number of stop bits")
Ascii.StopBits sbits,
@Argument(name="parity",description="The parity")
Ascii.Parity parity,
@Argument(name="flow",description="The flow control")
Ascii.FlowCtrl flow)
throws org.lsst.ccs.drivers.commons.DriverException
type - The connection typeident - The device identificationbaud - The baud ratedbits - The number of data bits (eight or seven)sbits - The number of stop bits (one or two)parity - The parity (none, odd, even, mark or space)flow - The flow control (none, xon, rts or dtr)org.lsst.ccs.drivers.commons.DriverException@Command(name="openold",
description="Open connection to general device")
public void openOld(@Argument(name="type",description="Connection type: net, serial or ftdi")
org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
@Argument(name="ident",description="Device identifier")
String ident,
@Argument(name="param",description="Device parameter")
int param)
throws org.lsst.ccs.drivers.commons.DriverException
type - The connection typeident - The device identificationparam - The device parameterorg.lsst.ccs.drivers.commons.DriverException@Command(name="openold",
description="Open connection to serial device")
public void openOld(@Argument(name="type",description="Connection type: net, serial or ftdi")
org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
@Argument(name="ident",description="Device identifier")
String ident,
@Argument(name="baud",description="Baud rate")
int baud,
@Argument(name="dbits",description="The number of data bits")
Ascii.DataBits dbits,
@Argument(name="sbits",description="The number of stop bits")
Ascii.StopBits sbits,
@Argument(name="parity",description="The parity")
Ascii.Parity parity,
@Argument(name="flow",description="The flow control")
Ascii.FlowCtrl flow)
throws org.lsst.ccs.drivers.commons.DriverException
type - The connection typeident - The device identificationbaud - The baud ratedbits - The number of data bits (eight or seven)sbits - The number of stop bits (one or two)parity - The parity (none, odd, even, mark or space)flow - The flow control (none, xon, rts or dtr)org.lsst.ccs.drivers.commons.DriverException@Command(name="close",
description="Close connection to device")
public void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="write",
description="Write command to device")
public void write(@Argument(name="command",description="Command to write")
String command)
throws org.lsst.ccs.drivers.commons.DriverException
command - The command to send (without terminator)org.lsst.ccs.drivers.commons.DriverException@Command(name="read",
description="Read response from device")
public String read()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="read",
description="Write command and read response")
public String read(@Argument(name="command",description="Command to write")
String command)
throws org.lsst.ccs.drivers.commons.DriverException
command - The command to send (without terminator)org.lsst.ccs.drivers.commons.DriverException@Command(name="timeout",
description="Set read response timeout")
public void timeout(@Argument(name="time",description="Timeout value (sec)")
double time)
throws org.lsst.ccs.drivers.commons.DriverException
time - The timeout (secs); 0 means no timeoutorg.lsst.ccs.drivers.commons.DriverException@Command(name="setterm",
description="Set command terminator")
public void setTerm(@Argument(name="term",description="Terminator string")
String term)
term - The terminator to setCopyright © 2016 LSST. All rights reserved.