| 329 | } |
| 330 | |
| 331 | void ISOTPScriptHelper::newISOMessage(ISOTP_MESSAGE msg) |
| 332 | { |
| 333 | qDebug() << "isotpScriptHelper got a ISOTP message"; |
| 334 | if (!gotFrameFunction.isCallable()) return; //nothing to do if we can't even call the function |
| 335 | //qDebug() << "Got frame in script interface"; |
| 336 | |
| 337 | QJSValueList args; |
| 338 | args << msg.bus << msg.ID << msg.len; |
| 339 | QJSValue dataBytes = scriptEngine->newArray(static_cast<uint>(msg.len)); |
| 340 | |
| 341 | for (int j = 0; j < msg.len; j++) dataBytes.setProperty(static_cast<quint32>(j), QJSValue(msg.data[j])); |
| 342 | args.append(dataBytes); |
| 343 | gotFrameFunction.call(args); |
| 344 | } |
| 345 | |
| 346 | |
| 347 | |