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

Method newUDSMessage

scriptcontainer.cpp:408–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408void UDSScriptHelper::newUDSMessage(UDS_MESSAGE msg)
409{
410 //qDebug() << "udsScriptHelper got a UDS message";
411 qDebug() << "UDS script helper. Meg data len: " << msg.len;
412 if (!gotFrameFunction.isCallable()) return; //nothing to do if we can't even call the function
413 //qDebug() << "Got frame in script interface";
414
415 QJSValueList args;
416 args << msg.bus << msg.ID << msg.service << msg.subFunc << msg.len;
417 QJSValue dataBytes = scriptEngine->newArray(static_cast<unsigned int>(msg.len));
418
419 for (int j = 0; j < msg.data.length(); j++) dataBytes.setProperty(static_cast<quint32>(j), QJSValue(msg.data[j]));
420 args.append(dataBytes);
421 gotFrameFunction.call(args);
422}
423

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected