Class AbstractTcFrameLink

java.lang.Object
com.google.common.util.concurrent.AbstractService
org.yamcs.tctm.AbstractLink
org.yamcs.tctm.ccsds.AbstractTcFrameLink
All Implemented Interfaces:
com.google.common.util.concurrent.Service, SystemParametersProducer, AggregatedDataLink, Link, LinkActionProvider, TcDataLink
Direct Known Subclasses:
UdpTcFrameLink

public abstract class AbstractTcFrameLink extends AbstractLink implements AggregatedDataLink, TcDataLink
Sends TC as TC frames (CCSDS 232.0-B-3) or TC frames embedded in CLTU (CCSDS 231.0-B-3).
  • Field Details

  • Constructor Details

    • AbstractTcFrameLink

      public AbstractTcFrameLink()
  • Method Details

    • getDefaultSpec

      public Spec getDefaultSpec()
      Description copied from interface: Link
      Returns a default link Spec. 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:
      getDefaultSpec in interface Link
    • init

      public void init(String yamcsInstance, String linkName, YConfiguration config)
      Description copied from interface: Link
      Called at startup to initialize the link.

      The config corresponds to the map that is under the link definition in yamcs.instance.yaml.

      Specified by:
      init in interface Link
      Overrides:
      init in class AbstractLink
      config - - 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

      public List<Link> getSubLinks()
      Specified by:
      getSubLinks in interface AggregatedDataLink
    • setCommandHistoryPublisher

      public void setCommandHistoryPublisher(CommandHistoryPublisher commandHistoryPublisher)
      Specified by:
      setCommandHistoryPublisher in interface TcDataLink
    • sendCommand

      public boolean sendCommand(PreparedCommand preparedCommand)
      Description copied from interface: TcDataLink
      Attempt to send the command and return true if the command has been sent or its processing has finished.

      If false is returned, the LinkManager will attempt to send the command via the next TC link (if any).

      The link is expected to update the CommandHistoryPublisher.AcknowledgeSent_KEY ack 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_KEY ack 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:
      sendCommand in interface TcDataLink
      Returns:
    • ackBypassFrame

      protected void ackBypassFrame(TcTransferFrame tf)
      Ack the BD frames Note: the AD frames are acknowledged in the when the COP1 ack is received
      Parameters:
      tf -
    • failBypassFrame

      protected void failBypassFrame(TcTransferFrame tf, String reason)