diff --git a/connections/socketcand.cpp b/connections/socketcand.cpp index a049d8c..2f2a8fa 100644 --- a/connections/socketcand.cpp +++ b/connections/socketcand.cpp @@ -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;