public class LoaderCanOpenProxy extends CanOpenProxy
| Modifier and Type | Class and Description |
|---|---|
protected static class |
FcsTcpProxy.ClientContext
A class to handle the tcpip connexion.
|
| Modifier and Type | Field and Description |
|---|---|
protected FcsTcpProxy.ClientContext |
clientContext |
static org.lsst.ccs.utilities.logging.Logger |
COMMAND_LOG
A Logger for CommandDispenser.
|
protected int |
fieldBusTimeout |
protected Condition |
hardwareBooted |
protected Lock |
lock |
protected String |
name |
protected int |
portNumber |
protected boolean |
stopped |
protected boolean |
stopping |
protected boolean |
tcpServerStarted |
bootedDeviceNB, bootingCompleted, hardwareBootProcessEnded, hardwareMapByName, hardwareMapByNodeIDalertSeparater| Constructor and Description |
|---|
LoaderCanOpenProxy(int portNumber,
int fieldBusTimeout,
String clientName,
long hardwareBootTimeout) |
| Modifier and Type | Method and Description |
|---|---|
Object |
call(String clientName,
String command)
This methods send a command to the tcp client.
|
void |
connectHardware()
This methods connect the CWrapper client, and the TCP server and check
the hardware.
|
boolean |
isReady(String clientName) |
void |
postStart()
check that all pieces of hardware is booted.
|
protected void |
processCommand(String command)
Processes a command received from the tcp client.
|
protected void |
processUnknownCommand(String message)
Process a message received from the CAN bus when this message is an unknown message.
|
void |
start()
We don't want the tcp server to be started during INITIALISATION phase.
|
void |
startServer()
Starts the server tcp on the port portNumber.
|
void |
startThreadReader()
Starts a thread which read on the tcp socket, waiting for messages coming
from tcp proxy.
|
void |
stopServer()
Stops the tcp server.
|
allDevicesBooted, bootProcess, canClearAlert, checkNodeID, checkStarted, disconnectHardware, getMyClientName, getNodeName, getPdoStorage, init, initialize, isCWrapperConnected, isRealHardware, listBootedNodes, listHardwareNames, printHardwareList, printHardwareState, printPDOStorage, processEmcyMessage, processResponseToReadSDO, processSDORequestError, publishData, readPDOs, readSDO, readSDOCommand, readSDOLong, retrieveHardwareInfo, sendCanOpen, sendCanOpenCommand, shutdownNow, toString, writeSDOclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckHardware, checkStoppedstartServer, startThreadReaderraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarning, raiseWarningpublic static final org.lsst.ccs.utilities.logging.Logger COMMAND_LOG
@LookupName protected String name
@ConfigurationParameter(isFinal=true,
range="1024..99000",
description="tcpip port number on which this tcpip server starts on.")
protected int portNumber
@ConfigurationParameter(description="Timeout in Millisecond. If a command sent to the CANbus doesn\'t respond during this amount of time, we considere that they could be an issue on the hardware.") protected int fieldBusTimeout
protected volatile boolean stopped
protected volatile boolean stopping
protected volatile boolean tcpServerStarted
protected FcsTcpProxy.ClientContext clientContext
protected final Lock lock
protected final Condition hardwareBooted
public LoaderCanOpenProxy(int portNumber,
int fieldBusTimeout,
String clientName,
long hardwareBootTimeout)
public void start()
start in interface org.lsst.ccs.framework.HasLifecyclepublic void postStart()
CanOpenProxypostStart in interface org.lsst.ccs.framework.HasLifecyclepostStart in class CanOpenProxypublic void connectHardware()
connectHardware in interface BridgeToHardwareconnectHardware in class CanOpenProxy@Command(type=ACTION,
level=1,
description="Starts the tcp server.")
public void startServer()
@Command(type=ACTION,
level=1,
description="Starts to listen to the tcp client.")
public void startThreadReader()
protected void processCommand(String command)
public void stopServer()
public boolean isReady(String clientName)
public Object call(String clientName, String command)
clientName - command - protected void processUnknownCommand(String message)
nodeID - Copyright © 2017 LSST. All rights reserved.