Class TmPacket
- java.lang.Object
-
- org.yamcs.TmPacket
-
- Direct Known Subclasses:
PacketWithTime
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
XtceTmRecorderwill 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 Summary
Fields Modifier and Type Field Description static intSTATUS_MASK_DO_NOT_ARCHIVEstatic intSTATUS_MASK_INVALIDstatic intSTATUS_MASK_LOCAL_GEN_TIME
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetEarthReceptionTime()Returns the time when the packet has been received on earth orTimeEncoding.INVALID_INSTANTif it has not been set.longgetGenerationTime()The time when the packet has been generated by the payload.byte[]getPacket()longgetReceptionTime()Return the time when the packet has been received in Yamcs.intgetSeqCount()The sequence count together with the generation time are supposed to uniquely identify the packet.intgetStatus()The 32bit flag.booleanisInvalid()voidsetDoNotArchive()Sets the flag that this packet will not be archived.voidsetEarthRceptionTime(long ertime)voidsetGenerationTime(long time)voidsetInvalid()voidsetInvalid(boolean invalid)voidsetLocalGenTime()Set the flag that this packet generation time is in fact local time.voidsetSequenceCount(int seqCount)voidsetStatus(int status)
-
-
-
Field Detail
-
STATUS_MASK_INVALID
public static final int STATUS_MASK_INVALID
- See Also:
- Constant Field Values
-
STATUS_MASK_LOCAL_GEN_TIME
public static final int STATUS_MASK_LOCAL_GEN_TIME
- See Also:
- Constant Field Values
-
STATUS_MASK_DO_NOT_ARCHIVE
public static final int STATUS_MASK_DO_NOT_ARCHIVE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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()
-
setInvalid
public void setInvalid()
-
setInvalid
public void setInvalid(boolean invalid)
-
isInvalid
public boolean isInvalid()
-
getEarthReceptionTime
public long getEarthReceptionTime()
Returns the time when the packet has been received on earth orTimeEncoding.INVALID_INSTANTif 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.
- Returns:
- the time of the reception of the packet on ground.
-
setEarthRceptionTime
public void setEarthRceptionTime(long ertime)
-
setLocalGenTime
public void setLocalGenTime()
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)
-
-