455 {
457
459 PRINT(
"*** INFO: sendDataTimeout %d" PRINT_EOL,
size);
460 }
461
463 return 0;
464
465
471 }
472
473
474
475
482
483
484#if !EFI_UNIT_TEST
486 size_t numFcReceived = 0;
487 int separationTimeUs = 0;
488 while (numFcReceived < 3) {
489
491 efiPrintf("IsoTp: Flow Control frame not received");
492
493 return 0;
494 }
496
497
499
500 continue;
501 }
502
503
504 numFcReceived++;
506
507 if (flowStatus == CAN_FLOW_STATUS_ABORT) {
508 efiPrintf("IsoTp: Flow Control ABORT");
509
510 return -4;
511 }
512
513 if (flowStatus == CAN_FLOW_STATUS_WAIT_MORE) {
514
515 if (numFcReceived < 3) {
516 continue;
517 }
518
519 return -5;
520 }
521
522 if (flowStatus != CAN_FLOW_STATUS_OK) {
523 efiPrintf("IsoTp: Flow Control unknown Status %d", flowStatus);
524
525 return -6;
526 }
527
530 if (blockSize != 0) {
531
532 efiPrintf("IsoTp: Flow Control blockSize is not supported %d", blockSize);
533
534 return -7;
535 }
536
537 if (minSeparationTime <= 0x7f) {
538
539 separationTimeUs = minSeparationTime * 1000;
540 } else if ((minSeparationTime >= 0xf1) && (minSeparationTime <= 0xf9)) {
541
542 separationTimeUs = (minSeparationTime - 0xf0) * 100;
543 }
544
545 break;
546 }
547#endif
548
549
550 uint8_t idx = 1;
553
555 header.
index = ((idx++) & 0x0f);
558 if (numSent < 1)
559 break;
562
563#if ! EFI_UNIT_TEST
564 if (separationTimeUs) {
565 chThdSleepMicroseconds(separationTimeUs);
566 }
567#endif
568 }
570}
int sendFrame(const IsoTpFrameHeader &header, const uint8_t *data, int num, can_sysinterval_t timeout)
size_t isoHeaderByteIndex
fifo_buffer_sync< CANRxFrame, ISOTP_RX_QUEUE_LEN > rxFifoBuf
static constexpr engine_configuration_s * engineConfiguration
@ ISO_TP_FRAME_CONSECUTIVE
@ ISO_TP_FRAME_FLOW_CONTROL
uint8_t data8[8]
Frame data.