A small fix to make transmitted frame timestamps a bit more accurate

but still not synced to capture device.
This commit is contained in:
Collin Kidder
2016-02-28 16:56:04 -05:00
parent 4767a7349f
commit e2cedf2482
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -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;
+1
View File
@@ -85,6 +85,7 @@ private:
bool can0Enabled, can1Enabled;
int deviceBuildNum;
int deviceSingleWireMode;
uint64_t txTimestampBasis;
void procRXChar(unsigned char);
void sendCommValidation();