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

Method fetchOperand

framesenderwindow.cpp:518–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518int FrameSenderWindow::fetchOperand(int idx, ModifierOperand op)
519{
520 CANFrame *tempFrame = nullptr;
521 if (op.ID == 0) //numeric constant
522 {
523 if (op.notOper) return ~op.databyte;
524 else return op.databyte;
525 }
526 else if (op.ID == -2) //fetch data from a data byte within the output frame
527 {
528 if (op.notOper) return ~sendingData.at(idx).data[op.databyte];
529 else return sendingData.at(idx).data[op.databyte];
530 }
531 else //look up external data byte
532 {
533 tempFrame = lookupFrame(op.ID, op.bus);
534 if (tempFrame != nullptr)
535 {
536 if (op.notOper) return ~tempFrame->data[op.databyte];
537 else return tempFrame->data[op.databyte];
538 }
539 else return 0;
540 }
541}
542
543/// <summary>
544/// Try to find the most recent frame given the input criteria

Callers

nothing calls this directly

Calls 1

atMethod · 0.80

Tested by

no test coverage detected