Package org.yamcs.tctm
Class GenericPacketPreprocessor
java.lang.Object
org.yamcs.tctm.AbstractPacketPreprocessor
org.yamcs.tctm.GenericPacketPreprocessor
- All Implemented Interfaces:
PacketPreprocessor
Generic packet preprocessor.
Reads the timestamp (8 bytes) and the sequence count (4 bytes) from a user defined offset.
Optionally allows to specify also a checksum algorithm to be used. The checksum is at the end of the packet.
timestampOffset | Offset in the packet where to read the 8 bytes timestamp from. If negative, do not read the timestmap from within
the packet but use the local wallclock time instead. The way to translate the timestamp to Yamcs time is configured
by the timeEncoding property. |
seqCountOffset | Offset in the packet where to read the sequence count from. If negative, do not read the sequence count from
within the packet and set it to 0 instead.
Note: this class does not check for sequence count continuity. |
errorDetection | If present, specify which error detection to use. Example: errorDetection: -type: "CRC-16-CCIIT" |
byteOrder | Can be BIG_ENDIAN (default) or LITTLE_ENDIAN. Configures the byte order used for reading the timestamp, sequence count and crc |
timeEncoding | Can be used to configure the way the timestamp is translated to Yamcs time. See the
AbstractPacketPreprocessor for details. If this option is not specified, the default epoch used is UNIX.
|
-
Nested Class Summary
Nested classes/interfaces inherited from class org.yamcs.tctm.AbstractPacketPreprocessor
AbstractPacketPreprocessor.TimeDecoderType, AbstractPacketPreprocessor.TimeEpochs
-
Field Summary
Fields inherited from class org.yamcs.tctm.AbstractPacketPreprocessor
byteOrder, checkForSequenceDiscontinuity, CONFIG_KEY_BYTE_ORDER, CONFIG_KEY_CHECK_SEQUENCE, CONFIG_KEY_ERROR_DETECTION, CONFIG_KEY_TCO_SERVICE, CONFIG_KEY_TIME_ENCODING, customEpoch, customEpochIncludeLeapSecond, errorDetectionCalculator, ETYPE_CORRUPTED_PACKET, eventProducer, log, tcoService, timeDecoder, timeEpoch, timeService, useLocalGenerationTime
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreturn the default decoder type.Processes the packet and returns it.Methods inherited from class org.yamcs.tctm.AbstractPacketPreprocessor
checkForSequenceDiscontinuity, checkForSequenceDiscontinuity, getByteOrder, getErrorDetectionWordCalculator, setRealtimePacketTime, shiftFromEpoch, verifyCrc
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
-
Constructor Details
-
GenericPacketPreprocessor
-
-
Method Details
-
process
Description copied from interface:PacketPreprocessor
Processes the packet and returns it.What this function does is project depended. However, we expect that the generation time and sequence count are filled in.
Can return null if the packet is to be ignored.
- Parameters:
tmPacket
- - the packet that has to be processed- Returns:
- the processed packet
-
getDefaultDecoderType
Description copied from class:AbstractPacketPreprocessor
return the default decoder type. The subclasses may override this for compatibility with old Yamcs releases- Overrides:
getDefaultDecoderType
in classAbstractPacketPreprocessor
-