diff --git a/serialworker.cpp b/serialworker.cpp index b36940e..33ea8db 100644 --- a/serialworker.cpp +++ b/serialworker.cpp @@ -19,6 +19,8 @@ SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(pare isAutoRestart = false; targetID = -1; + txTimestampBasis = QDateTime::currentMSecsSinceEpoch(); + readSettings(); } @@ -157,6 +159,7 @@ void SerialWorker::sendFrame(const CANFrame *frame, int bus = 0) int ID; CANFrame tempFrame = *frame; tempFrame.isReceived = false; + tempFrame.timestamp = ((QDateTime::currentMSecsSinceEpoch() - txTimestampBasis) * 1000); //qDebug() << "Sending out frame with id " << frame->ID; diff --git a/serialworker.h b/serialworker.h index e0730f0..8aea384 100644 --- a/serialworker.h +++ b/serialworker.h @@ -85,6 +85,7 @@ private: bool can0Enabled, can1Enabled; int deviceBuildNum; int deviceSingleWireMode; + uint64_t txTimestampBasis; void procRXChar(unsigned char); void sendCommValidation();