Class GenericPacketPreprocessor

java.lang.Object
org.yamcs.tctm.AbstractPacketPreprocessor
org.yamcs.tctm.GenericPacketPreprocessor
All Implemented Interfaces:
PacketPreprocessor

public class GenericPacketPreprocessor extends AbstractPacketPreprocessor
Generic packet preprocessor.

Reads the timestamp (8 bytes) and the sequence count (4 bytes) from a user defined offset.

Optionally allows to specify also a checksum algorithm to be used. The checksum is at the end of the packet.

timestampOffset Offset in the packet where to read the 8 bytes timestamp from. If negative, do not read the timestmap from within the packet but use the local wallclock time instead. The way to translate the timestamp to Yamcs time is configured by the timeEncoding property.
seqCountOffset Offset in the packet where to read the sequence count from. If negative, do not read the sequence count from within the packet and set it to 0 instead.

Note: this class does not check for sequence count continuity.

errorDetection If present, specify which error detection to use. Example: errorDetection:
  -type: "CRC-16-CCIIT"
byteOrder Can be BIG_ENDIAN (default) or LITTLE_ENDIAN. Configures the byte order used for reading the timestamp, sequence count and crc
timeEncoding Can be used to configure the way the timestamp is translated to Yamcs time. See the AbstractPacketPreprocessor for details. If this option is not specified, the default epoch used is UNIX.
  • Constructor Details

    • GenericPacketPreprocessor

      public GenericPacketPreprocessor(String yamcsInstance, YConfiguration config)
  • Method Details

    • process

      public TmPacket process(TmPacket tmPacket)
      Description copied from interface: PacketPreprocessor
      Processes the packet and returns it.

      What this function does is project depended. However, we expect that the generation time and sequence count are filled in.

      Can return null if the packet is to be ignored.

      Parameters:
      tmPacket - - the packet that has to be processed
      Returns:
      the processed packet
    • getDefaultDecoderType

      protected AbstractPacketPreprocessor.TimeDecoderType getDefaultDecoderType()
      Description copied from class: AbstractPacketPreprocessor
      return the default decoder type. The subclasses may override this for compatibility with old Yamcs releases
      Overrides:
      getDefaultDecoderType in class AbstractPacketPreprocessor