Go to the documentation of this file.
65 #ifndef PACKETSTAMPER_H
66 #define PACKETSTAMPER_H
double m_toa0
The recomputed Time Of Arrival of PID 0.
double m_rate
The estimated clock rate per pid.
Contains an interpreted data message. The class provides easy access to the contained data through it...
DataPair m_latest
Latest known data (later data may arrive with a lower pid, which will not be put in this item)
static const int64_t SC8BOUNDARY
8 bit Sample Counter boundary
std::list< DataPair > m_dataPoints
The filtered history of interesting data items.
static const int64_t AWINDABOUNDARY
32 bit MT Sample Counter boundary
int64_t stampPacket(XsDataPacket &pack, XsDataPacket const &highest)
Create 64 bit counter for a packet.
static int64_t calculateLargePacketCounter(int64_t frameCounter, int64_t lastCounter, int64_t boundary)
Calculate the new large packet counter value based on frameCounter and the lastCounter.
int64_t m_pid
Packet ID of data item.
static const int64_t MTSCBOUNDARY
16 bit MT Sample Counter boundary
void estimateClockParameters()
Estimate the clock parameters based on the available data points.
DataPair m_linearize
The very first item received, used to normalize to 0,0 so we have less computational issues with larg...
bool operator==(DataPair const &other) const
Returns true if the items are equal.
void estimateTos(XsDataPacket &pack)
Estimate the time of sampling for the supplied packet pack and update it.
Supplies functionality for timestamping data packets.
bool rejectOutlier()
Remove the worst outlier from the known data points.
PacketStamper()
Default constructor.
void resetTosEstimation()
Reset the Time Of Sampling estimation parameters.
int m_rejectionCountdown
A countdown value that is used after the input sanity check rejects input to reject subsequent sample...
int64_t estimateTosInternal(int64_t pid, int64_t toa)
Estimate the time of sampling for the supplied pid.
static int64_t calculateLargeSampleTime(int64_t frameTime, int64_t lastTime)
Calculate the new large sample time value based on frameTime and the lastTime.
int64_t m_toa
Time Of Arrival of data item.