Interface CommandPostprocessor

All Known Implementing Classes:
AbstractCommandPostProcessor, CfsCommandPostprocessor, CspCommandPostprocessor, GenericCommandPostprocessor, IssCommandPostprocessor, PusCommandPostprocessor

public interface CommandPostprocessor
The command post processor is responsible to provide the binary packet that will be send out for a PreparedCommand. It is used to add sequence counts, compute checkwords, etc
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Return the size of the binary packet for this command.
    default void
    init(String yamcsInstance, YConfiguration config)
    Called to initialise the postprocessor and set the cmd hist publisher (used to publish command acknowledgments), the timeService (required to timestamp acks) and the configuration
    byte[]
    processes the command and returns the binary buffer.
    default void
    sets the command history listener which can be used by the preprocessor to provide command history entries related to the command processed
  • Method Details

    • init

      default void init(String yamcsInstance, YConfiguration config)
      Called to initialise the postprocessor and set the cmd hist publisher (used to publish command acknowledgments), the timeService (required to timestamp acks) and the configuration
    • process

      byte[] process(PreparedCommand pc)
      processes the command and returns the binary buffer. Returns null if the command cannot be processed (e.g. its size does not correspond to what this processor expects). In this case, the post-processor is expected to fail the command in the command history (also filling in an appropriate reason)
      Parameters:
      pc -
      Returns:
      the processed command or null if the command cannot be processed
    • setCommandHistoryPublisher

      default void setCommandHistoryPublisher(CommandHistoryPublisher commandHistoryPublisher)
      sets the command history listener which can be used by the preprocessor to provide command history entries related to the command processed
    • getBinaryLength

      default int getBinaryLength(PreparedCommand pc)
      Return the size of the binary packet for this command.

      This is required in the frame links which bundle multiple commands together to know if the command will fit into the frame before post-processing it.

      Parameters:
      pc -
      Returns:
      the size of the binary packet which the method process(PreparedCommand) will return.