- All Implemented Interfaces:
com.google.common.util.concurrent.Service,SystemParametersProducer,AggregatedDataLink,Link,LinkActionProvider,TcDataLink
- Direct Known Subclasses:
UdpTcFrameLink
-
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
FieldsModifier and TypeFieldDescriptionprotected CltuGeneratorprotected CommandHistoryPublisherprotected intprotected MasterChannelFrameMultiplexerFields 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 voidAck the BD frames Note: the AD frames are acknowledged in the when the COP1 ack is receivedprotected byte[]encodeCltu(int vcId, byte[] data) optionally encode the data to CLTU if the CLTU generator is configured.protected voidfailBypassFrame(TcTransferFrame tf, String reason) Returns a default linkSpec.voidinit(String yamcsInstance, String linkName, 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.voidsetCommandHistoryPublisher(CommandHistoryPublisher commandHistoryPublisher) Methods inherited from class org.yamcs.tctm.AbstractLink
addAction, collectSystemParameters, connectionStatus, dataIn, dataOut, disable, doDisable, doEnable, enable, getAction, getActions, getConfig, getCurrentTime, getDataInCount, getDataOutCount, getDetailedStatus, 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, doStart, doStop, 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, getDetailedStatus, getExtraInfo, getLinkStatus, getName, getParent, getSpec, isDisabled, isEffectivelyDisabled, resetCounters, setParent, setupSystemParametersMethods inherited from interface org.yamcs.parameter.SystemParametersProducer
getFrequencyMethods inherited from interface org.yamcs.tctm.TcDataLink
isCommandingAvailable, isTcDataLinkImplemented
-
Field Details
-
frameCount
protected int frameCount -
multiplexer
-
commandHistoryPublisher
-
cltuGenerator
-
-
Constructor Details
-
AbstractTcFrameLink
public AbstractTcFrameLink()
-
-
Method Details
-
getDefaultSpec
Description copied from interface:LinkReturns a default linkSpec. This can be used in an implementation of {Link.getSpec(). Eventually (after a few years), it is expected to migrate this logic directly into {LinkLink.getSpec(), rather than returning null from there. But we want to give sufficient time for links everywhere to start defining their arguments.- Specified by:
getDefaultSpecin interfaceLink
-
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 classAbstractLinkconfig- - the configuration - cannot be null (but can be empty)
-
encodeCltu
protected byte[] encodeCltu(int vcId, byte[] data) optionally encode the data to CLTU if the CLTU generator is configured.Randomization will also be performed if configured.
-
getSubLinks
- Specified by:
getSubLinksin interfaceAggregatedDataLink
-
setCommandHistoryPublisher
- Specified by:
setCommandHistoryPublisherin interfaceTcDataLink
-
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)
- Specified by:
sendCommandin interfaceTcDataLink- Returns:
-
ackBypassFrame
Ack the BD frames Note: the AD frames are acknowledged in the when the COP1 ack is received- Parameters:
tf-
-
failBypassFrame
-