- All Implemented Interfaces:
com.google.common.util.concurrent.Service,SystemParametersProducer,Link,LinkActionProvider,ParameterDataLink,TcDataLink,TmPacketDataLink
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.yamcs.tctm.Link
Link.StatusNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
FieldsFields inherited from class org.yamcs.tctm.AbstractTcTmParamLink
cmdPostProcessor, commandHistoryPublisher, packetCount, packetPreprocessor, parameterCount, parameterSink, updateSimulationTimeFields inherited from class org.yamcs.tctm.AbstractLink
config, dataInCount, dataOutCount, disabled, eventProducer, LINK_NAMESPACE, linkName, log, timeService, yamcsInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Link.StatusIn case the link should be connected (i.e. is running and enabled) this method is called to return the actual connection statusprotected voidprotected voiddoEnable()protected voiddoStart()protected voiddoStop()Returns a short detail status (one-line)getSpec()Returns the valid configuration of the input args of this link.voidhandleIncomingPacket(byte[] packet) voidinit(String instance, String name, YConfiguration config) Called at startup to initialize the link.booleansendCommand(PreparedCommand preparedCommand) Attempt to send the command and return true if the command has been sent or its processing has finished.Methods inherited from class org.yamcs.tctm.AbstractTcTmParamLink
ackCommand, failedCommand, getDefaultSpec, initTc, initTm, postprocess, processPacket, setCommandHistoryPublisher, setParameterSink, setTmSinkMethods inherited from class org.yamcs.tctm.AbstractLink
addAction, collectSystemParameters, dataIn, dataOut, disable, enable, getAction, getActions, getConfig, getCurrentTime, getDataInCount, getDataOutCount, getEventLoop, getLinkStatus, getName, getParent, getSystemParameters, getYamcsInstance, isDisabled, isRunningAndEnabled, resetCounters, setParent, setupSystemParametersMethods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.yamcs.tctm.Link
disable, enable, getConfig, getDataInCount, getDataOutCount, getExtraInfo, getLinkStatus, getName, getParent, isDisabled, isEffectivelyDisabled, resetCounters, setParent, setupSystemParametersMethods inherited from interface org.yamcs.tctm.ParameterDataLink
isParameterDataLinkImplementedMethods inherited from interface org.yamcs.parameter.SystemParametersProducer
getFrequencyMethods inherited from interface org.yamcs.tctm.TcDataLink
isCommandingAvailable, isTcDataLinkImplementedMethods inherited from interface org.yamcs.tctm.TmPacketDataLink
isTmPacketDataLinkImplemented
-
Field Details
-
host
-
port
protected int port -
initialDelay
protected long initialDelay
-
-
Constructor Details
-
UdpTcTmDataLink
public UdpTcTmDataLink()
-
-
Method Details
-
getSpec
Description copied from interface:LinkReturns the valid configuration of the input args of this link.- Returns:
- the argument specification, or
nullif the args should not be validated.
-
init
Description copied from interface:LinkCalled at startup to initialize the link.The config corresponds to the map that is under the link definition in yamcs.instance.yaml.
- Specified by:
initin interfaceLink- Overrides:
initin classAbstractTcTmParamLinkconfig- - the configuration - cannot be null (but can be empty)
-
sendCommand
Description copied from interface:TcDataLinkAttempt to send the command and return true if the command has been sent or its processing has finished.If false is returned, the
LinkManagerwill attempt to send the command via the next TC link (if any).The link is expected to update the
CommandHistoryPublisher.AcknowledgeSent_KEYack in the command history if the method returned true. If it returned false, the ack should not be updated (it will be updated by the next link or by the Link Manager if there is other no link).The link can update the
CommandHistoryPublisher.AcknowledgeSent_KEYack with a negative ack and return true (i.e. the command has not been really sent but it has finished processing).The return true/false has been introduced in Yamcs 5.6.0. Before that version, the old method sendTc was implicitly returning true. As of Yamcs 5.6.0 most links return true even when they cannot send the command (setting the negative Sent ack).
Throwing an exception is equivalent with returning false, except a error log will be printed (this is considered a bug)
- Returns:
-
connectionStatus
Description copied from class:AbstractLinkIn case the link should be connected (i.e. is running and enabled) this method is called to return the actual connection status- Specified by:
connectionStatusin classAbstractLink
-
doStart
protected void doStart()- Specified by:
doStartin classcom.google.common.util.concurrent.AbstractService
-
doEnable
- Overrides:
doEnablein classAbstractLink- Throws:
Exception
-
doDisable
- Overrides:
doDisablein classAbstractLink- Throws:
Exception
-
doStop
protected void doStop()- Specified by:
doStopin classcom.google.common.util.concurrent.AbstractService
-
getDetailedStatus
Description copied from interface:LinkReturns a short detail status (one-line)- Specified by:
getDetailedStatusin interfaceLink- Overrides:
getDetailedStatusin classAbstractLink
-
handleIncomingPacket
public void handleIncomingPacket(byte[] packet)
-