Package org.yamcs.tctm.pus
Class PusCommandPostprocessor
- java.lang.Object
-
- org.yamcs.tctm.pus.PusCommandPostprocessor
-
- All Implemented Interfaces:
CommandPostprocessor
public class PusCommandPostprocessor extends Object implements CommandPostprocessor
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandHistoryPublishercommandHistoryListenerprotected CcsdsSeqCountFillerseqFiller
-
Constructor Summary
Constructors Constructor Description PusCommandPostprocessor(String yamcsInstance)PusCommandPostprocessor(String yamcsInstance, YConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBinaryLength(PreparedCommand pc)Return the size of the binary packet for this command.byte[]process(PreparedCommand pc)processes the command and returns the binary buffer.voidsetCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener)sets the command history listener which can be used by the preprocessor to provide command history entries related to the command processed
-
-
-
Field Detail
-
seqFiller
protected CcsdsSeqCountFiller seqFiller
-
commandHistoryListener
protected CommandHistoryPublisher commandHistoryListener
-
-
Constructor Detail
-
PusCommandPostprocessor
public PusCommandPostprocessor(String yamcsInstance)
-
PusCommandPostprocessor
public PusCommandPostprocessor(String yamcsInstance, YConfiguration config)
-
-
Method Detail
-
process
public byte[] process(PreparedCommand pc)
Description copied from interface:CommandPostprocessorprocesses 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 postprocessor is expected to fail the command in the command history (also filling in an appropiate reason)- Specified by:
processin interfaceCommandPostprocessor- Returns:
-
getBinaryLength
public int getBinaryLength(PreparedCommand pc)
Description copied from interface:CommandPostprocessorReturn 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.
- Specified by:
getBinaryLengthin interfaceCommandPostprocessor- Returns:
- the size of the binary packet which the method
CommandPostprocessor.process(PreparedCommand)will return.
-
setCommandHistoryPublisher
public void setCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener)
Description copied from interface:CommandPostprocessorsets the command history listener which can be used by the preprocessor to provide command history entries related to the command processed- Specified by:
setCommandHistoryPublisherin interfaceCommandPostprocessor
-
-