Class AbstractPacketPreprocessor
- All Implemented Interfaces:
PacketPreprocessor
- Direct Known Subclasses:
CcsdsPacketPreprocessor
,CspPacketPreprocessor
,GenericPacketPreprocessor
dataLinks: ... packetPreprocessor: org.yamcs.tctm.concrete_classname packetPreprocessorArgs: byteOrder: LITTLE_ENDIAN checkSequence: true timeEncoding: epoch: CUSTOM epochUTC: 1970-01-01T00:00:00Z timeIncludesLeapSeconds: falseThe
byteOrder
option (default is BIG_ENDIAN
) is used by some implementing classes to decode parts of
the header.
The checkSequence
option (default is true) can configure the implementing classes to raise an event if the
sequence count is not continuous (this indicates packet loss).
The timeEncoding
is used to convert the extracted time to Yamcs time.
epoch
can be one of TAI, J2000, UNIX, GPS, CUSTOM.
If CUSTOM is specified, the epochUTC
has to be used to specify the UTC time which is used as an epoch (UTC is
used here loosely because strictly speaking UTC has been only introduced in 1972 so it does not make sense for the
times before).
The time read from the packet is interpreted as delta from epochUTC
.
If timeIncludesLeapSeconds
is true
(default), the delta time is considered as having the leap seconds
included (practically it is the real time that passed).
TAI, J2000 and GPS have the leap seconds included, UNIX does not.
The example above is equivalent with:
timeEncoding: epoch: UNIXIf this option is not configured, the default will be different for each pre-processor.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
Modifier and TypeFieldDescriptionprotected ByteOrder
protected boolean
protected static final String
protected static final String
protected static final String
static final String
protected static final String
protected long
protected boolean
protected ErrorDetectionWordCalculator
protected static final String
protected EventProducer
protected final Log
protected TimeCorrelationService
protected TimeDecoder
protected AbstractPacketPreprocessor.TimeEpochs
protected TimeService
protected boolean
If true, do not extract time from packets but use the local generation time. -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractPacketPreprocessor
(String yamcsInstance, YConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
checkForSequenceDiscontinuity
(boolean checkForSequenceDiscontinuity) The packet preprocessor processes multiple packets that should be in sequence.static ByteOrder
getByteOrder
(YConfiguration config) return the default decoder type.static ErrorDetectionWordCalculator
protected void
setRealtimePacketTime
(TmPacket tmPacket, int offset) Decodes the time at the offset using the time decoder, sets and verifies the generation time depending on the timeEpoch and the tcoService.protected long
shiftFromEpoch
(long t) void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.tctm.PacketPreprocessor
process, process
-
Field Details
-
CONFIG_KEY_ERROR_DETECTION
- See Also:
-
CONFIG_KEY_TIME_ENCODING
- See Also:
-
CONFIG_KEY_TCO_SERVICE
- See Also:
-
CONFIG_KEY_BYTE_ORDER
- See Also:
-
CONFIG_KEY_CHECK_SEQUENCE
- See Also:
-
ETYPE_CORRUPTED_PACKET
- See Also:
-
errorDetectionCalculator
-
eventProducer
-
timeService
-
checkForSequenceDiscontinuity
protected boolean checkForSequenceDiscontinuity -
timeEpoch
-
customEpoch
protected long customEpoch -
customEpochIncludeLeapSecond
protected boolean customEpochIncludeLeapSecond -
timeDecoder
-
byteOrder
-
tcoService
-
useLocalGenerationTime
protected boolean useLocalGenerationTimeIf true, do not extract time from packets but use the local generation time.It is a good idea to set the
TmPacket.setLocalGenTimeFlag()
flag to indicate it.The flag has to be set by the pre-processor!
-
log
-
-
Constructor Details
-
AbstractPacketPreprocessor
-
-
Method Details
-
verifyCrc
-
getErrorDetectionWordCalculator
-
setRealtimePacketTime
Decodes the time at the offset using the time decoder, sets and verifies the generation time depending on the timeEpoch and the tcoService.If there is any exception when decoding the time, the packet is marked as invalid.
It is important this is called only for realtime packets.
- Parameters:
tmPacket
-offset
-
-
shiftFromEpoch
protected long shiftFromEpoch(long t) -
getByteOrder
-
getDefaultDecoderType
return the default decoder type. The subclasses may override this for compatibility with old Yamcs releases -
checkForSequenceDiscontinuity
public boolean checkForSequenceDiscontinuity() -
checkForSequenceDiscontinuity
public void checkForSequenceDiscontinuity(boolean checkForSequenceDiscontinuity) Description copied from interface:PacketPreprocessor
The packet preprocessor processes multiple packets that should be in sequence. This flag can be used to check that indeed the packets are in sequence and produce a warning otherwise.- Specified by:
checkForSequenceDiscontinuity
in interfacePacketPreprocessor
-