Merge pull request #915 from wernerc11/pcan_fix_extended_ids

Corrected extended CAN ID read for IDs < 0x800
This commit is contained in:
Collin Kidder
2025-05-05 18:37:18 -04:00
committed by GitHub
+8 -4
View File
@@ -1454,7 +1454,8 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector<CANFrame>* frames)
QByteArray bytes(numBytes, 0);
thisFrame.isReceived = true;
thisFrame.bus = 0;
if (thisFrame.frameId() > 0x10000000)
if ((thisFrame.frameId() > 0x10000000) ||
(tokens[3].length() >= 8))
{
thisFrame.setExtendedFrameFormat(true);
}
@@ -1506,7 +1507,8 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector<CANFrame>* frames)
//qDebug() << thisFrame.payload().length();
thisFrame.isReceived = true;
thisFrame.bus = tokens[2].toInt();
if (thisFrame.frameId() > 0x10000000)
if ((thisFrame.frameId() > 0x10000000) ||
(tokens[4].length() >= 8))
{
thisFrame.setExtendedFrameFormat(true);
}
@@ -1548,7 +1550,8 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector<CANFrame>* frames)
//qDebug() << thisFrame.payload().length();
thisFrame.isReceived = true;
thisFrame.bus = 0;
if (thisFrame.frameId() > 0x10000000)
if ((thisFrame.frameId() > 0x10000000) ||
(tokens[3].length() >= 8))
{
thisFrame.setExtendedFrameFormat(true);
}
@@ -1600,7 +1603,8 @@ bool FrameFileIO::loadPCANFile(QString filename, QVector<CANFrame>* frames)
//qDebug() << thisFrame.payload().length();
thisFrame.isReceived = true;
thisFrame.bus = tokens[3].toInt();
if (thisFrame.frameId() > 0x10000000)
if ((thisFrame.frameId() > 0x10000000) ||
(tokens[4].length() >= 8))
{
thisFrame.setExtendedFrameFormat(true);
}