Fix indentation issues.
This commit is contained in:
+12
-12
@@ -5113,15 +5113,15 @@ bool FrameFileIO::loadWiresharkSocketCANFile(QString filename, QVector<CANFrame>
|
|||||||
int lineCounter = 0;
|
int lineCounter = 0;
|
||||||
bool foundErrors = false;
|
bool foundErrors = false;
|
||||||
pcap_pkthdr packetHeader;
|
pcap_pkthdr packetHeader;
|
||||||
const char *packetData = NULL;
|
const char *packetData = NULL;
|
||||||
char errbuf[PCAP_ERRBUF_SIZE];
|
char errbuf[PCAP_ERRBUF_SIZE];
|
||||||
|
|
||||||
QByteArray ba = filename.toLocal8Bit();
|
QByteArray ba = filename.toLocal8Bit();
|
||||||
|
|
||||||
pcap_data_file = pcap_open_offline(ba.data(), errbuf, PCAP_LINKTYPE_SOCKETCAN);
|
pcap_data_file = pcap_open_offline(ba.data(), errbuf, PCAP_LINKTYPE_SOCKETCAN);
|
||||||
if (!pcap_data_file) {
|
if (!pcap_data_file) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
packetData = (const char*)pcap_next(pcap_data_file, &packetHeader);
|
packetData = (const char*)pcap_next(pcap_data_file, &packetHeader);
|
||||||
while (packetData) {
|
while (packetData) {
|
||||||
@@ -5143,8 +5143,8 @@ bool FrameFileIO::loadWiresharkSocketCANFile(QString filename, QVector<CANFrame>
|
|||||||
// ID and extended frame format
|
// ID and extended frame format
|
||||||
const quint32 can_id = qFromBigEndian<quint32>(packetData);
|
const quint32 can_id = qFromBigEndian<quint32>(packetData);
|
||||||
if (can_id & 0x80000000) {
|
if (can_id & 0x80000000) {
|
||||||
thisFrame.setExtendedFrameFormat(true);
|
thisFrame.setExtendedFrameFormat(true);
|
||||||
thisFrame.setFrameId(0x1fffffff & can_id);
|
thisFrame.setFrameId(0x1fffffff & can_id);
|
||||||
} else {
|
} else {
|
||||||
thisFrame.setExtendedFrameFormat(false);
|
thisFrame.setExtendedFrameFormat(false);
|
||||||
thisFrame.setFrameId(0x7ff & can_id);
|
thisFrame.setFrameId(0x7ff & can_id);
|
||||||
@@ -5178,7 +5178,7 @@ bool FrameFileIO::loadWiresharkSocketCANFile(QString filename, QVector<CANFrame>
|
|||||||
packetData = (const char*) pcap_next(pcap_data_file, &packetHeader);
|
packetData = (const char*) pcap_next(pcap_data_file, &packetHeader);
|
||||||
}
|
}
|
||||||
pcap_close(pcap_data_file);
|
pcap_close(pcap_data_file);
|
||||||
pcap_data_file = NULL;
|
pcap_data_file = NULL;
|
||||||
return !foundErrors;
|
return !foundErrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5189,10 +5189,10 @@ bool FrameFileIO::isWiresharkSocketCANFile(QString filename)
|
|||||||
QByteArray ba = filename.toLocal8Bit();
|
QByteArray ba = filename.toLocal8Bit();
|
||||||
|
|
||||||
pcap_data_file = pcap_open_offline(ba.data(), errbuf, PCAP_LINKTYPE_SOCKETCAN);
|
pcap_data_file = pcap_open_offline(ba.data(), errbuf, PCAP_LINKTYPE_SOCKETCAN);
|
||||||
if (!pcap_data_file) {
|
if (!pcap_data_file) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pcap_close(pcap_data_file);
|
pcap_close(pcap_data_file);
|
||||||
pcap_data_file = NULL;
|
pcap_data_file = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user