| Modifier and Type | Class and Description |
|---|---|
static class |
Srp.BoardType |
| Modifier and Type | Field and Description |
|---|---|
protected Srp.BoardType |
boardType |
static int |
DEFAULT_PORT
Constants and data.
|
static int |
PORT_0
Constants and data.
|
static int |
PORT_1
Constants and data.
|
static int |
PORT_2
Constants and data.
|
static int |
PORT_3
Constants and data.
|
| Constructor and Description |
|---|
Srp()
For backwards compatibility
|
Srp(String logName)
Create an SRP and give a name to be included in log messages and exceptions
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearSimRegMap()
Clears the simulated register map.
|
void |
close()
Closes the connection.
|
Srp.BoardType |
getBoardType()
Gets the board type.
|
String |
getBuildStamp()
Gets the build stamp
|
byte[] |
getIpAddress()
Gets the IP address.
|
int |
getNumSeqErr()
Gets the sequence error count.
|
int |
getNumTimeout()
Gets the socket timeout count.
|
int |
getReadTimeout()
Gets the read timeout
|
int |
getReadWarning()
Gets the read warning time.
|
protected int |
getSimRegMap(int addr)
Gets from the simulated register map.
|
boolean |
isSimulated()
Gets whether simulated
|
void |
open(int node)
Opens a connection to a board.
|
void |
open(int node,
int port)
Opens a connection to a board.
|
void |
open(String host)
Opens a connection to a board.
|
void |
open(String host,
int port)
Opens a connection to a board.
|
protected void |
putSimRegMap(int addr,
int value)
Puts to the simulated register map.
|
int |
readReg(int addr)
Reads a register.
|
int[] |
readRegs(int addr,
int count)
Reads registers.
|
void |
setDebug(Boolean on)
Sets the debug state.
|
void |
setLogName(String logName) |
void |
setReadTimeout(int timeout)
Sets the read timeout.
|
void |
setReadWarning(int time)
Sets the read warning time.
|
void |
setSrpVersion(int version)
Sets the SRP protocol version.
|
void |
setValidBoardTypes(Collection types)
Sets the collection of valid board types.
|
protected void |
simInitialize()
Initializes the simulation.
|
protected int[] |
simReadRegs(int addr,
int count)
Reads simulated registers.
|
protected void |
simWriteRegs(int addr,
int[] value,
int count)
Writes simulated registers.
|
int |
updateReg(int addr,
int mask,
int value)
Updates a register.
|
void |
writeReg(int addr,
int value)
Writes a register.
|
void |
writeRegs(int addr,
int[] value)
Writes registers.
|
public static final int DEFAULT_PORT
public static final int PORT_0
public static final int PORT_1
public static final int PORT_2
public static final int PORT_3
protected Srp.BoardType boardType
public Srp(String logName)
logName - public Srp()
public void setLogName(String logName)
public void setValidBoardTypes(Collection types)
types - The collection of valid typespublic void setSrpVersion(int version)
version - The protocol versionpublic void open(String host, int port) throws org.lsst.ccs.drivers.commons.DriverException
host - The host name or IP address, or null or empty for simulationport - The port number, or 0 for defaultorg.lsst.ccs.drivers.commons.DriverExceptionpublic void open(String host) throws org.lsst.ccs.drivers.commons.DriverException
host - The IP address, or null or empty for simulationorg.lsst.ccs.drivers.commons.DriverExceptionpublic void open(int node,
int port)
throws org.lsst.ccs.drivers.commons.DriverException
node - The IP private network node number, or 0 for simulationport - The port number, or 0 for defaultorg.lsst.ccs.drivers.commons.DriverExceptionpublic void open(int node)
throws org.lsst.ccs.drivers.commons.DriverException
node - The IP private network node number, or 0 for simulationorg.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setReadTimeout(int timeout)
timeout - The timeout (ms)public int getReadTimeout()
public void setReadWarning(int time)
time - The time (ms)public int getReadWarning()
public Srp.BoardType getBoardType()
public String getBuildStamp() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setDebug(Boolean on)
on - The debug on state, true or falsepublic byte[] getIpAddress()
public boolean isSimulated()
public void writeReg(int addr,
int value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressvalue - The value to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegs(int addr,
int[] value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addressvalue - The array of values to write. If it contains more than the allowed
maximum number (1024 for SRP V3, 64 otherwise) of values, only the
allowed number are written.org.lsst.ccs.drivers.commons.DriverExceptionpublic int readReg(int addr)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressorg.lsst.ccs.drivers.commons.DriverExceptionpublic int[] readRegs(int addr,
int count)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The first register addresscount - The number of registers to read. If greater than the allowed
maximum number (1024 for SRP V3, 64 otherwise) of registers, only the
allowed number are read.org.lsst.ccs.drivers.commons.DriverExceptionpublic int updateReg(int addr,
int mask,
int value)
throws org.lsst.ccs.drivers.commons.DriverException
addr - The register addressmask - The mask of bits to be updatedvalue - The value to use for updatingorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getNumSeqErr()
public int getNumTimeout()
protected void simInitialize()
protected void simWriteRegs(int addr,
int[] value,
int count)
addr - The first register addressvalue - The array of values to write.count - The number of values to write.protected int[] simReadRegs(int addr,
int count)
addr - The first register addresscount - The number of registers to read.protected final void clearSimRegMap()
protected final void putSimRegMap(int addr,
int value)
addr - The register addressvalue - The array of values to write.protected final int getSimRegMap(int addr)
addr - The register addressCopyright © 2022 LSST. All rights reserved.