Package org.yamcs

Class TmPacket

java.lang.Object
org.yamcs.TmPacket

public class TmPacket extends Object
Packet with acquisition time, generation time and sequence count.

It is assumed that (generation time, sequence count) uniquely identifies the packet

Starting with yamcs 4.11 there is a 32 bitfield status that can be set on the packets by the pre-processor. The bits currently defined:

  • bit 0 (msb) - always 0
  • bits 1-15 - user defined (pre-processor specific)
  • bits 16-28 - reserved for future Yamcs use
  • bit 29 - DO_NOT_ARCHIVE - the XtceTmRecorder will not archive the packets that have this bit set.
  • bit 30 - LOCAL_GEN_TIME - when the pre-processor cannot find the generation time, it can use the local time instead and set this bit
  • bit 31(lsb) - INVALID - used for example when the packet fails crc or checksum verification

For the invalid packets there is an option at the link level to redirect them on a different stream. Using StreamSQL any other packet can be redirected as well.

  • Field Details

    • STATUS_MASK_INVALID

      public static final int STATUS_MASK_INVALID
      See Also:
    • STATUS_MASK_LOCAL_GEN_TIME

      public static final int STATUS_MASK_LOCAL_GEN_TIME
      See Also:
    • STATUS_MASK_DO_NOT_ARCHIVE

      public static final int STATUS_MASK_DO_NOT_ARCHIVE
      See Also:
  • Constructor Details

    • TmPacket

      public TmPacket(long rectime, byte[] pkt)
    • TmPacket

      public TmPacket(long rectime, long gentime, int seqCount, byte[] pkt)
  • Method Details

    • getGenerationTime

      public long getGenerationTime()
      The time when the packet has been generated by the payload.
      Returns:
    • setGenerationTime

      public void setGenerationTime(long time)
    • getReceptionTime

      public long getReceptionTime()
      Return the time when the packet has been received in Yamcs.
      Returns:
    • getSeqCount

      public int getSeqCount()
      The sequence count together with the generation time are supposed to uniquely identify the packet.

      Note that for CCSDS space packets (as per CCSDS 133.0-B), this sequence count is a combination of the application identifier(APID) and packet sequence count.

      This means that the sequence count cannot be directly used to asses packet loss or packet ordering without having more information about the nature of the count.

      Returns:
    • setSequenceCount

      public void setSequenceCount(int seqCount)
    • getPacket

      public byte[] getPacket()
    • length

      public int length()
    • setInvalid

      public void setInvalid()
    • setInvalid

      public void setInvalid(boolean invalid)
    • isInvalid

      public boolean isInvalid()
    • getEarthReceptionTime

      public Instant getEarthReceptionTime()
      Returns the time when the packet has been received on earth or TimeEncoding.INVALID_INSTANT if it has not been set.

      The exact time returned will depend on how the packet has been received. For SLE links it will be the time when the first bit of the last containing frame has been received at the ground station.

      Some links will not set this parameter.

      The reason this uses a high resolution instant whereas the others are using millisecond resolution times is that the ground stations usually have high resolution clocks able to provide this accuracy. This is also the time used to perform space to ground time synchronisation.

      Returns:
      the time of the reception of the packet on ground.
    • setEarthReceptionTime

      public void setEarthReceptionTime(Instant ertime)
    • setEarthRceptionTime

      @Deprecated public void setEarthRceptionTime(Instant ertime)
      Deprecated.
      Use setEarthReceptionTime(Instant) instead. (typo fix)
    • setLocalGenTimeFlag

      public void setLocalGenTimeFlag()
      Set the flag that this packet generation time is in fact local time.
    • setDoNotArchive

      public void setDoNotArchive()
      Sets the flag that this packet will not be archived.
    • getStatus

      public int getStatus()
      The 32bit flag.

      Be aware that this will change also the values set by the setInvalid

      Returns:
    • setStatus

      public void setStatus(int status)
    • getObt

      public long getObt()
    • setObt

      public void setObt(long obt)