A small fix to make transmitted frame timestamps a bit more accurate
but still not synced to capture device.
This commit is contained in:
@@ -19,6 +19,8 @@ SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(pare
|
|||||||
isAutoRestart = false;
|
isAutoRestart = false;
|
||||||
targetID = -1;
|
targetID = -1;
|
||||||
|
|
||||||
|
txTimestampBasis = QDateTime::currentMSecsSinceEpoch();
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,6 +159,7 @@ void SerialWorker::sendFrame(const CANFrame *frame, int bus = 0)
|
|||||||
int ID;
|
int ID;
|
||||||
CANFrame tempFrame = *frame;
|
CANFrame tempFrame = *frame;
|
||||||
tempFrame.isReceived = false;
|
tempFrame.isReceived = false;
|
||||||
|
tempFrame.timestamp = ((QDateTime::currentMSecsSinceEpoch() - txTimestampBasis) * 1000);
|
||||||
|
|
||||||
//qDebug() << "Sending out frame with id " << frame->ID;
|
//qDebug() << "Sending out frame with id " << frame->ID;
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ private:
|
|||||||
bool can0Enabled, can1Enabled;
|
bool can0Enabled, can1Enabled;
|
||||||
int deviceBuildNum;
|
int deviceBuildNum;
|
||||||
int deviceSingleWireMode;
|
int deviceSingleWireMode;
|
||||||
|
uint64_t txTimestampBasis;
|
||||||
|
|
||||||
void procRXChar(unsigned char);
|
void procRXChar(unsigned char);
|
||||||
void sendCommValidation();
|
void sendCommValidation();
|
||||||
|
|||||||
Reference in New Issue
Block a user