- 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: false
The 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: UNIX
If this option is not configured, the default will be different for each pre-processor.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteOrderprotected booleanprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected longprotected booleanprotected ErrorDetectionWordCalculatorprotected static final Stringprotected EventProducerprotected final Logprotected TimeCorrelationServiceprotected TimeDecoderprotected AbstractPacketPreprocessor.TimeEpochsprotected TimeServiceprotected booleanIf true, do not extract time from packets but use the local generation time. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPacketPreprocessor(String yamcsInstance, YConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidcheckForSequenceDiscontinuity(boolean checkForSequenceDiscontinuity) The packet preprocessor processes multiple packets that should be in sequence.static ByteOrdergetByteOrder(YConfiguration config) return the default decoder type.static ErrorDetectionWordCalculatorprotected voidsetRealtimePacketTime(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 longshiftFromEpoch(long t) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:PacketPreprocessorThe 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:
checkForSequenceDiscontinuityin interfacePacketPreprocessor
-