Merge pull request #533 from qurrent-llc/fix_socketcandpartialframedrop

Fix socketcand empty frame drop
This commit is contained in:
Collin Kidder
2022-10-19 19:06:29 -04:00
committed by GitHub
+4 -9
View File
@@ -288,18 +288,13 @@ QString SocketCANd::decodeFrames(QString data, int busNum)
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, frameParsed[2].toDouble() * 1000000l));
//buildFrame.len = frameParsed[3].length() * 0.5;
if(frameParsed.length() < 4)
int framelength = 0;
if(frameParsed.length() == 4)
{
qDebug() << "Received frame doesn't contain any data: " << data;
//todo
//this is not totally true, ive seen frames come through that look like < frame 1F020240 1664924225.371291 >
//if we found the closing token but theres no data then remove the message from the buffer
return data;
framelength = frameParsed[3].length() * 0.5;
}
int framelength = frameParsed[3].length() * 0.5;
buildData.resize(framelength);
int c;