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

Method sendFrame

scriptcontainer.cpp:230–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void CANScriptHelper::sendFrame(QJSValue bus, QJSValue id, QJSValue length, QJSValue data)
231{
232 CANFrame frame;
233 frame.extended = false;
234 frame.remote = false;
235 frame.ID = static_cast<uint32_t>(id.toInt());
236 frame.len = length.toUInt();
237 if (frame.len > 8) frame.len = 8;
238
239 if (!data.isArray()) qDebug() << "data isn't an array";
240
241 for (unsigned int i = 0; i < frame.len; i++)
242 {
243 frame.data[i] = (uint8_t)data.property(i).toInt();
244 }
245
246 frame.bus = (uint32_t)bus.toInt();
247 //if (frame.bus > 1) frame.bus = 1;
248
249 if (frame.ID > 0x7FF) frame.extended = true;
250
251 qDebug() << "sending frame from script";
252 CANConManager::getInstance()->sendFrame(frame);
253}
254
255void CANScriptHelper::gotTargettedFrame(const CANFrame &frame)
256{

Callers 11

processIncomingFrameMethod · 0.45
handleTickMethod · 0.45
timerTickMethod · 0.45
sendISOTPFrameMethod · 0.45
processFrameMethod · 0.45
frameTimerTickMethod · 0.45
writeMethod · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
gotCANFrameFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected