Class TmPacket
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 Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the time when the packet has been received on earth orTimeEncoding.INVALID_INSTANT
if it has not been set.long
The time when the packet has been generated by the payload.long
getObt()
byte[]
long
Return the time when the packet has been received in Yamcs.int
The sequence count together with the generation time are supposed to uniquely identify the packet.int
The 32bit flag.boolean
int
length()
void
Sets the flag that this packet will not be archived.void
setEarthRceptionTime
(Instant ertime) Deprecated.void
setEarthReceptionTime
(Instant ertime) void
setGenerationTime
(long time) void
void
setInvalid
(boolean invalid) void
Set the flag that this packet generation time is in fact local time.void
setObt
(long obt) void
setRootContainer
(SequenceContainer rootContainer) void
setSequenceCount
(int seqCount) void
setStatus
(int status)
-
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
Returns the time when the packet has been received on earth orTimeEncoding.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
-
setEarthRceptionTime
Deprecated.UsesetEarthReceptionTime(Instant)
instead. (typo fix) -
getRootContainer
-
setRootContainer
-
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)
-