MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / parseMessageLine

Method parseMessageLine

dbc/dbchandler.cpp:332–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332DBC_MESSAGE* DBCFile::parseMessageLine(QString line)
333{
334 QRegularExpression regex;
335 QRegularExpressionMatch match;
336
337 DBC_MESSAGE *msgPtr;
338
339 qDebug() << "Found a BO line";
340 regex.setPattern("^BO\\_ (\\w+) (\\w+) *: (\\w+) (\\w+)");
341 match = regex.match(line);
342 //captured 1 = the ID in decimal
343 //captured 2 = The message name
344 //captured 3 = the message length
345 //captured 4 = the NODE responsible for this message
346 if (match.hasMatch())
347 {
348 DBC_MESSAGE msg;
349 msg.ID = match.captured(1).toULong() & 0x7FFFFFFFul; //the ID is always stored in decimal format
350 msg.name = match.captured(2);
351 msg.len = match.captured(3).toUInt();
352 msg.sender = findNodeByName(match.captured(4));
353 if (!msg.sender) msg.sender = findNodeByIdx(0);
354 messageHandler->addMessage(msg);
355 msgPtr = messageHandler->findMsgByID(msg.ID);
356 }
357 else msgPtr = nullptr;
358 return msgPtr;
359}
360
361DBC_SIGNAL* DBCFile::parseSignalLine(QString line, DBC_MESSAGE *msg)
362{

Callers

nothing calls this directly

Calls 2

addMessageMethod · 0.80
findMsgByIDMethod · 0.80

Tested by

no test coverage detected