Package org.yamcs.tctm
Class GenericPacketPreprocessor
- java.lang.Object
-
- org.yamcs.tctm.AbstractPacketPreprocessor
-
- org.yamcs.tctm.GenericPacketPreprocessor
-
- All Implemented Interfaces:
PacketPreprocessor
public class GenericPacketPreprocessor extends AbstractPacketPreprocessor
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 timeEncodingproperty.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. 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 AbstractPacketPreprocessorfor details. If this option is not specified, the default epoch used is UNIX. See the
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.yamcs.tctm.AbstractPacketPreprocessor
AbstractPacketPreprocessor.TimeEpochs
-
-
Field Summary
-
Fields inherited from class org.yamcs.tctm.AbstractPacketPreprocessor
byteOrder, CONFIG_KEY_ERROR_DETECTION, CONFIG_KEY_TCO_SERVICE, CONFIG_KEY_TIME_ENCODING, customEpoch, customEpochIncludeLeapSecond, errorDetectionCalculator, eventProducer, log, tcoService, timeDecoder, timeEpoch, timeService, useLocalGenerationTime
-
-
Constructor Summary
Constructors Constructor Description GenericPacketPreprocessor(String yamcsInstance, YConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TmPacketprocess(TmPacket tmPacket)Processes the packet and returns it.-
Methods inherited from class org.yamcs.tctm.AbstractPacketPreprocessor
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
checkForSequenceDiscontinuity, process
-
-
-
-
Constructor Detail
-
GenericPacketPreprocessor
public GenericPacketPreprocessor(String yamcsInstance, YConfiguration config)
-
-
Method Detail
-
process
public TmPacket process(TmPacket tmPacket)
Description copied from interface:PacketPreprocessorProcesses 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
-
-