| Modifier and Type | Class and Description |
|---|---|
static class |
Srp.BoardType |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
Constants and data.
|
| Constructor and Description |
|---|
Srp() |
| 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.
|
byte[] |
getIpAddress()
Gets the IP address.
|
int |
getNumSeqErr()
Gets the sequence error count.
|
int |
getNumTimeout()
Gets the socket timeout count.
|
protected int |
getSimRegMap(int addr)
Gets from the simulated register map.
|
boolean |
isSimulated()
Gets whether simulated
|
void |
open(String ipAddr)
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 |
setProbeAddress(int addr)
Sets the address to be probed at open 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 void setValidBoardTypes(Collection types)
types - The collection of valid typespublic void setProbeAddress(int addr)
addr - The address to be probed, or -1 to prevent probingpublic 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 numberorg.lsst.ccs.drivers.commons.DriverExceptionpublic void open(String ipAddr) throws org.lsst.ccs.drivers.commons.DriverException
ipAddr - The IP address, or null or empty for simulationorg.lsst.ccs.drivers.commons.DriverExceptionpublic void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic Srp.BoardType getBoardType()
public 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 © 2018 LSST. All rights reserved.