Skip to content

Commit

Permalink
Merge pull request #811 from tcfx44/master
Browse files Browse the repository at this point in the history
Support for ext CAN IDs in wireshark files
  • Loading branch information
collin80 authored Jul 10, 2024
2 parents d97c8d4 + 105c7a0 commit 514845f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions framefileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5064,9 +5064,13 @@ bool FrameFileIO::loadWiresharkFile(QString filename, QVector<CANFrame>* frames)
thisFrame.isReceived = true; // TODO: check if tx detection is possible

thisFrame.setFrameType(QCanBusFrame::DataFrame);
thisFrame.setFrameId((0xff & *(packetData+17)) << 8 | (0xff & *(packetData+16)));
if (thisFrame.frameId() <= 0x7FF) thisFrame.setExtendedFrameFormat(false);
else thisFrame.setExtendedFrameFormat(true);
if ((0x80 & *(packetData+19))) {
thisFrame.setExtendedFrameFormat(true);
thisFrame.setFrameId((0x3f & *(packetData+19))<<24 | (0xff & *(packetData+18)) << 16 | (0xff & *(packetData+17)) << 8 | (0xff & *(packetData+16)));
} else {
thisFrame.setExtendedFrameFormat(false);
thisFrame.setFrameId((0xff & *(packetData+17)) << 8 | (0xff & *(packetData+16)));
}
thisFrame.bus = 0;
int numBytes = *(packetData+20);
QByteArray bytes(numBytes, 0);
Expand Down

0 comments on commit 514845f

Please sign in to comment.