public class TestSrp extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
TestSrp.ConsThread
Inner class for detecting console input while reading continuously.
|
protected static class |
TestSrp.OnOff
Data fields
|
| Modifier and Type | Field and Description |
|---|---|
protected TestSrp.ConsThread |
consThread |
protected Srp |
srp |
| Constructor and Description |
|---|
TestSrp()
Constructor.
|
TestSrp(Srp srp)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect(String ipAddr,
int port)
Connects to a device.
|
String |
contRead(int addr,
int count)
Continuously reads registers.
|
void |
disconnect()
Disconnects from the device.
|
protected static String |
formatHex(int addr,
int[] data)
Formats, in hexadecimal, array of register values.
|
protected static String |
formatRate(long start,
int count)
Formats continuous test rates.
|
String |
read(int addr)
Reads a register.
|
String |
read(int addr,
int count)
Reads registers.
|
void |
setDebug(TestSrp.OnOff state)
Sets the debug state.
|
void |
setSrpVersion(int version)
Sets the SRP version
|
void |
update(int addr,
int mask,
int value)
Updates a register.
|
void |
write(int addr,
int... value)
Writes registers.
|
protected final Srp srp
protected final TestSrp.ConsThread consThread
public TestSrp()
public TestSrp(Srp srp)
srp - Srp object@Command(name="setsrpversion",
description="Set the SRP version")
public void setSrpVersion(@Argument(description="Version number")
int version)
version - The version to set@Command(name="setdebug",
description="Set the debug state")
public void setDebug(@Argument(description="The state (on or off)")
TestSrp.OnOff state)
state - The debug state to set, ON or OFF@Command(name="connect",
description="Open connection to device")
public void connect(@Argument(name="ipaddr",description="IP address")
String ipAddr,
@Argument(name="port",description="Port number")
int port)
throws org.lsst.ccs.drivers.commons.DriverException
ipAddr - The IP addressport - The port numberorg.lsst.ccs.drivers.commons.DriverException@Command(name="disconnect",
description="Close connection to device")
public void disconnect()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="read",
description="Read a register")
public String read(@Argument(name="addr",description="Register address")
int addr)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressorg.lsst.ccs.drivers.commons.DriverException@Command(name="read",
description="Reads registers")
public String read(@Argument(name="addr",description="Register address")
int addr,
@Argument(name="count",description="Register count")
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addresscount - The number of registers to readorg.lsst.ccs.drivers.commons.DriverException@Command(name="write",
description="Write a register")
public void write(@Argument(name="addr",description="Register address")
int addr,
@Argument(name="value",description="Register values")
int... value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addressvalue - The values to writeorg.lsst.ccs.drivers.commons.DriverException@Command(name="update",
description="Update a register")
public void update(@Argument(name="addr",description="Register address")
int addr,
@Argument(name="mask",description="Mask of bits to change")
int mask,
@Argument(name="value",description="Register value")
int value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressmask - The mask of bits to changevalue - The value to writeorg.lsst.ccs.drivers.commons.DriverException@Command(name="contread",
description="Continuously read a set of registers")
public String contRead(@Argument(description="First register address")
int addr,
@Argument(description="Number of registers")
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addresscount - The number of registers to readorg.lsst.ccs.drivers.commons.DriverExceptionprotected static String formatHex(int addr, int[] data)
addr - The address of the first data worddata - Array of data wordsprotected static String formatRate(long start, int count)
start - The start timecount - The number of operationsCopyright © 2018 LSST. All rights reserved.