| 302 | } |
| 303 | |
| 304 | void ISOTPScriptHelper::sendISOTP(QJSValue bus, QJSValue id, QJSValue length, QJSValue data) |
| 305 | { |
| 306 | ISOTP_MESSAGE msg; |
| 307 | msg.extended = false; |
| 308 | msg.ID = id.toInt(); |
| 309 | msg.len = length.toUInt(); |
| 310 | |
| 311 | if (!data.isArray()) qDebug() << "data isn't an array"; |
| 312 | |
| 313 | for (int i = 0; i < msg.len; i++) |
| 314 | { |
| 315 | msg.data[i] = static_cast<uint8_t>(data.property(i).toInt()); |
| 316 | } |
| 317 | |
| 318 | msg.bus = bus.toInt(); |
| 319 | |
| 320 | if (msg.ID > 0x7FF) msg.extended = true; |
| 321 | |
| 322 | qDebug() << "sending isotp message from script"; |
| 323 | handler->sendISOTPFrame(msg.bus, msg.ID, msg.data); |
| 324 | } |
| 325 | |
| 326 | void ISOTPScriptHelper::setRxCallback(QJSValue cb) |
| 327 | { |
nothing calls this directly
no test coverage detected