Supplies functionality for timestamping data packets.
This class can analyze a data packet and create a proper packet id for it.
Definition at line 16 of file packetstamper.h.
#include <xSens_MT4/xcommunication/include/xsens/packetstamper.h>
Static Public Member Functions | |
static int64_t | calculateLargePacketCounter8 (int64_t frameCounter, int64_t lastCounter) |
Calculate the new large packet counter value based on frameCounter and the lastCounter. More... | |
static int64_t | calculateLargePacketCounter (int64_t frameCounter, int64_t lastCounter) |
Calculate the new large sample counter value based on frameCounter and the lastCounter. More... | |
static int64_t | calculateLargeSampleTime (int64_t frameTime, int64_t lastTime) |
Calculate the new large sample time value based on frameTime and the lastTime. More... | |
static int64_t | stampPacket (XsDataPacket &pack, XsDataPacket &highest) |
Create 64 bit counter for a packet. More... | |
Static Public Attributes | |
static const int64_t | MTSCBOUNDARY = 0x00010000LL |
16 bit MT Sample Counter boundary More... | |
static const int64_t | MTSCBOUNDARY_LOWMASK = (MTSCBOUNDARY - 1) |
16 bit MT Sample Counter boundary inclusive mask More... | |
static const int64_t | MTSCBOUNDARY_HIGHMASK = (~MTSCBOUNDARY_LOWMASK) |
16 bit MT Sample Counter boundary exclusive mask More... | |
static const int64_t | MTSCBOUNDARY_HALF = (MTSCBOUNDARY / 2) |
16 bit MT Sample Counter boundary/2, used for determining SC wrapping More... | |
static const int64_t | SC8BOUNDARY = 0x00000100LL |
8 bit Sample Counter boundary More... | |
static const int64_t | SC8BOUNDARY_LOWMASK = (SC8BOUNDARY - 1) |
8 bit Sample Counter boundary inclusive mask More... | |
static const int64_t | SC8BOUNDARY_HIGHMASK = (~SC8BOUNDARY_LOWMASK) |
8 bit Sample Counter boundary exclusive mask More... | |
static const int64_t | SC8BOUNDARY_HALF = (SC8BOUNDARY / 2) |
8 bit Sample Counter boundary/2, used for determining SC wrapping More... | |
|
static |
Calculate the new large sample counter value based on frameCounter and the lastCounter.
Wraparound is at the 16-bit boundary
[in] | frameCounter | The frame counter |
[in] | lastCounter | The last counter |
Definition at line 127 of file packetstamper.cpp.
References MTSCBOUNDARY, MTSCBOUNDARY_HALF, and MTSCBOUNDARY_LOWMASK.
Referenced by stampPacket().
|
static |
Calculate the new large packet counter value based on frameCounter and the lastCounter.
Wraparound is at the 8-bit boundary
[in] | frameCounter | The frame counter |
[in] | lastCounter | The last counter |
Definition at line 102 of file packetstamper.cpp.
References SC8BOUNDARY, SC8BOUNDARY_HALF, and SC8BOUNDARY_LOWMASK.
Referenced by stampPacket().
Calculate the new large sample time value based on frameTime and the lastTime.
Wraparound is at 864000000 (1 day @ 10kHz)
[in] | frameTime | The frame time |
[in] | lastTime | The last time |
Definition at line 152 of file packetstamper.cpp.
Referenced by stampPacket().
|
static |
Create 64 bit counter for a packet.
Wrap when new XsDataPacket is too far away from the previous XsDataPacket in time. Use half cache size as reasonable time difference When infinite cache, simply wrap when new is lower than old
pack | The XsDataPacket that needs its 64-bit sample counter updated |
highestPacket | The highest packet available for the current device, it will be updated if the new counter is higher than the stored value. |
Definition at line 47 of file packetstamper.cpp.
References calculateLargePacketCounter(), calculateLargePacketCounter8(), calculateLargeSampleTime(), and mrpt::system::now().
|
static |
16 bit MT Sample Counter boundary
Definition at line 19 of file packetstamper.h.
Referenced by calculateLargePacketCounter().
|
static |
16 bit MT Sample Counter boundary/2, used for determining SC wrapping
Definition at line 22 of file packetstamper.h.
Referenced by calculateLargePacketCounter().
|
static |
16 bit MT Sample Counter boundary exclusive mask
Definition at line 21 of file packetstamper.h.
|
static |
16 bit MT Sample Counter boundary inclusive mask
Definition at line 20 of file packetstamper.h.
Referenced by calculateLargePacketCounter().
|
static |
8 bit Sample Counter boundary
Definition at line 24 of file packetstamper.h.
Referenced by calculateLargePacketCounter8().
|
static |
8 bit Sample Counter boundary/2, used for determining SC wrapping
Definition at line 27 of file packetstamper.h.
Referenced by calculateLargePacketCounter8().
|
static |
8 bit Sample Counter boundary exclusive mask
Definition at line 26 of file packetstamper.h.
|
static |
8 bit Sample Counter boundary inclusive mask
Definition at line 25 of file packetstamper.h.
Referenced by calculateLargePacketCounter8().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019 |