Class PusPacketPreprocessor

All Implemented Interfaces:
PacketPreprocessor

public class PusPacketPreprocessor extends CcsdsPacketPreprocessor
Implementation for ECSS PUS (ECSS-E-ST-70-41C) packets. The header structure is:

Primary header (specified by CCSDS 133.0-B-1)

  • packet version number (3 bits)
  • packet type (1 bit)
  • secondary header flag (1 bit)
  • application process ID (11 bits)
  • sequence flags (2 bits)
  • packet sequence count (14 bits)

Secondary header (PUS specific)

  • TM packet PUS version number (4 bits)
  • spacecraft time reference status (4 bits)
  • service type ID (8 bits)
  • message subtype ID (8 bits)
  • message type counter (16 bits)
  • destination ID (16 bits)
  • time (absolute time) variable
  • spare optional

The time packets have no secondary header and the apid set to 0. The data part consists of the current onboard time in the same encoding like in the normal packets.

In this class we read

  • the APID and sequence count from the CCSDS primary header interested in the time and the sequence count.
  • the time from the PUS secondary header and from the time packets.

The offset of where the time is read from is configurable as this has changed between different versions of the standards.

Example configuration:

 dataLinks:
 ...
 - name: tm_realtime
   packetPreprocessorClassName: org.yamcs.tctm.pus.PusPacketPreprocessor
   packetPreprocessorArgs:
   errorDetection:
     type: CRC-16-CCIIT
   pktTimeOffset: 13
   timePktTimeOffset: 7
   timeEncoding:
      epoch: CUSTOM
      epochUTC: 1970-01-01T00:00:00Z
      timeIncludesLeapSeconds: false
 
  • Constructor Details

    • PusPacketPreprocessor

      public PusPacketPreprocessor(String yamcsInstance)
    • PusPacketPreprocessor

      public PusPacketPreprocessor(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