DEENESPTFRRUARHIKOZHNL

CAN Interface (CanIf)

ModulCanIf (CAN Interface)
BSW-Modul-ID60
Standard-Header#include "CanIf.h"
SWS-SpezifikationAUTOSAR_SWS_CANInterface.pdf
ClusterCAN

دليل الوحدةمولَّد بالذكاء الاصطناعي

يتوسط رسائل CAN والتحكم في الوضع بشكل مستقل عن العتاد بين برامج تشغيل CAN ومكدس الاتصالات.
مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: claude-opus-5-5 · الجهد: high · درجة الحرارة: غير قابل للتحكم · الموجّه: a6221da93ef5 المصدر أسئلة مفتوحة (1)
المرساة السببية: R20-11 صالح اعتبارًا من R20-11 مُركَّب حديثًا لهذا الإصدار من المواصفة.
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

يتوسط رسائل CAN والتحكم في الوضع بشكل مستقل عن العتاد بين برامج تشغيل CAN ومكدس الاتصالات.

تُعد CanIf الطبقة المستقلة عن العتاد بين برامج تشغيل CAN أو أجهزة الإرسال والاستقبال (Transceivers) ووحدات الاتصال العليا. تقوم بتعيين أوامر الإرسال إلى Can_Write()، وتخزن مؤقتاً عند انشغال العتاد، وتُمرر التأكيدات وعمليات الاستقبال المصفاة إلى استدعاءات رد الاتصال المُكوّنة [SWS_CANIF_00318]. وتتحكم في أوضاع وحدات التحكم وأجهزة الإرسال والاستقبال نيابة عن CanSm وتبلغ عن BusOff وتغييرات الوضع. تقوم أوضاع قنوات PDU بتبديل مسار الإرسال ومسار الاستقبال بشكل منفصل. ولا يتم الإرسال إلا إذا كانت وحدة التحكم في CAN_CS_STARTED وتم تمكين مسار الإرسال [SWS_CANIF_00317].

تتولى CAN Interface (CanIf) جميع المهام المستقلة عن العتاد لاتصالات CAN. ويشمل ذلك أوامر الإرسال، والتأكيدات، ومؤشرات الاستقبال، وبلاغات الأخطاء، بالإضافة إلى بدء تشغيل وحدات تحكم CAN وإيقافها SWS CanIf ص. 13. لا تصل CanIf إلى مخازن العتاد المؤقتة إلا عبر خدمات CanDrv [SWS_CANIF_00023]. وتخاطب وحدات التحكم وأجهزة الإرسال والاستقبال للعديد من برامج التشغيل عبر معرفات مجردة [SWS_CANIF_00653]. ويحدد التكوين استدعاءات رد الاتصال التي يتم استدعاؤها في PduR أو CanNm أو CanTp أو CanSm أو EcuM [SWS_CANIF_00011] [SWS_CANIF_00724].

kontext ul Obere Schichten PduR, CanNm, CanTp, J1939Tp, J1939Nm, CanTSyn, Xcp, CDD canif CanIf ul->canif CanIf_Transmit() CanIf_SetPduMode() CanIf_ReadRxPduData() cansm CanSm / CDD cansm->canif CanIf_SetControllerMode() CanIf_SetTrcvMode() ecum EcuM / Integrationscode ecum->canif CanIf_Init() CanIf_CheckWakeup() CanIf_CheckValidation() canif->ul <User_RxIndication> <User_TxConfirmation> <User_TriggerTransmit> canif->cansm <User_ControllerBusOff> <User_ControllerModeIndication> <User_TrcvModeIndication> canif->ecum <User_ValidateWakeupEvent> can برنامج تشغيل CAN (Can) نسخة واحدة أو أكثر canif->can Can_Write() Can_SetControllerMode() Can_CheckWakeup() trcv CAN-Transceiver-Treiber (CanTrcv) canif->trcv CanTrcv_SetOpMode() CanTrcv_CheckWakeup() det Det canif->det Det_ReportError() Det_ReportRuntimeError() idsm IdsM canif->idsm Sicherheitsereignisse mirror Bus Mirroring canif->mirror Mirror_ReportCanFrame() can->canif CanIf_RxIndication() CanIf_TxConfirmation() CanIf_ControllerBusOff() CanIf_ControllerModeIndication() trcv->canif CanIf_TrcvModeIndication()

مخطط السياق: CanIf بين وحدات الاتصال العليا، وإدارة الأوضاع، وبرامج التشغيل لوحدات التحكم وأجهزة الإرسال والاستقبال. المصادر: [SWS_CANIF_00012]، [SWS_CANIF_00358]، SWS CanIf ص. 21

يقوم EcuM بتهيئة CanIf باستخدام CanIf_Init(). بعد ذلك تكون كل قناة مضبوطة على CANIF_OFFLINE [SWS_CANIF_00864]، وحتى ذلك الوقت ترفض الخدمات عبر E_NOT_OK [SWS_CANIF_00661]. يعمل بدء تشغيل وحدة التحكم عبر CanIf_SetControllerMode() بشكل غير متزامن. ويبلغ CanIf_ControllerModeIndication() عن الاكتمال، والذي تُمرره CanIf بدوره إلى CanSm [SWS_CANIF_00003] [SWS_CANIF_00711]. وبعد ذلك فقط يقبل CanIf_SetPduMode() الطلبات [SWS_CANIF_00874]. تقوم أوضاع قنوات PDU بتبديل مسار الإرسال ومسار الاستقبال بشكل منفصل. وتقوم أحداث وحدة التحكم مثل SLEEP أو STOPPED أو BusOff بضبطها قسرياً [SWS_CANIF_00865] [SWS_CANIF_00866].

pdumodi cluster_offline OFFLINE (Oberzustand) start off CANIF_OFFLINE kein Senden, kein Empfang start->off CanIf_Init() txoff CANIF_TX_OFFLINE استقبال فقط off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE إرسال واستقبال off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE استقبال، ويتم تأكيد الإرسال فوراً txact->off CAN_CS_SLEEP txact->txoff CAN_CS_STOPPED / BusOff txact->on CanIf_SetPduMode(CANIF_ONLINE) on->off CanIf_SetPduMode(CANIF_OFFLINE) أو CAN_CS_SLEEP on->txoff CanIf_SetPduMode(CANIF_TX_OFFLINE) أو CAN_CS_STOPPED / BusOff on->txact CanIf_SetPduMode(CANIF_TX_OFFLINE_ACTIVE) hinweis لا يُقبل ()CanIf_SetPduMode إلا عند كون وحدة التحكم في CAN_CS_STARTED؛ المعروض هو مجموعة مختارة من الانتقالات

مخطط الحالة: أوضاع قنوات PDU الأربعة وانتقالاتها بواسطة CanIf_SetPduMode() وأحداث وحدة التحكم. المصادر: [SWS_CANIF_00137]، [SWS_CANIF_00866]، SWS CanIf الشكل 7.8 ص. 61

عند الإرسال، يستدعي CanIf_Transmit() Can_Write() [SWS_CANIF_00318]. وإذا كان العتاد مشغولاً، تقوم CanIf بتخزين L-PDU مؤقتاً طالما تم تكوين مخزن مؤقت [SWS_CANIF_00381]. وعند التأكيد التالي، تقوم بإرسال المدخل ذي الأولوية القصوى لاحقاً [SWS_CANIF_00668]. وتخضع وحدات L-PDU المستلمة لتصفية برمجية وفحص للطول قبل أن تُمررها CanIf إلى <User_RxIndication> [SWS_CANIF_00389] [SWS_CANIF_00056].

في حالة الخطأ، يضبط BusOff القناة على CANIF_TX_OFFLINE ويتم إبلاغ CanSm به [SWS_CANIF_00724]. وعند إيقاف وحدة التحكم، تؤكد CanIf جميع أوامر الإرسال المعلقة بواسطة E_NOT_OK [SWS_CANIF_00739]. وتنتقل أخطاء المعلمات وأخطاء وقت التشغيل إلى DET [SWS_CANIF_91006] [SWS_CANIF_91007].

الدور: محور تبادل مستقل عن العتاد بين برامج تشغيل CAN ومكدس الاتصالات

تتولى CAN Interface (CanIf) جميع المهام المستقلة عن العتاد لاتصالات CAN الخاصة بـ ECU. وتعتني برامج تشغيل CAN الموجودة أدناه فقط بعتادها الملموس. تعالج CanIf أوامر الإرسال، وتأكيدات الإرسال، ومؤشرات الاستقبال، وبلاغات الأخطاء، وتبدأ أو توقف وحدات تحكم CAN SWS CanIf ص. 13. وتصل إلى مخازن العتاد المؤقتة حصرياً عبر خدمات CanDrv [SWS_CANIF_00023]. تعمل خدمات التحكم باستخدام ControllerId مجرد يُرقم وحدات التحكم لجميع مثيلات CanDrv تصاعدياً بدءاً من 0 [SWS_CANIF_00653]. وينطبق الشيء نفسه على أجهزة الإرسال والاستقبال مع TransceiverId [SWS_CANIF_00655].

باتجاه الأسفل، تجمع CanIf واجهات برمجة التطبيقات لعدة برامج تشغيل CanTrcv في واجهة موحدة، ولكنها لا تحتوي في حد ذاتها على منطق جهاز إرسال واستقبال SWS CanIf ص. 21. وحتى في حالة وجود برامج تشغيل CanDrv متعددة، يتواجد كل استدعاء رد اتصال مرة واحدة فقط. تتعرف CanIf على برنامج التشغيل المُستدعي من ControllerId في Can_HwType SWS CanIf ص. 68.

باتجاه الأعلى، تستدعي CanIf استدعاءات رد اتصال قابلة للتكوين مثل <User_TxConfirmation> و<User_RxIndication> [SWS_CANIF_00011] [SWS_CANIF_00012]. يحدد التكوين المستلم الفعلي، مثل PduR_CanIfRxIndication [SWS_CANIF_00442] أو CanTp_TxConfirmation [SWS_CANIF_00550]. تبلغ CanIf عن BusOff وتغييرات الوضع إلى CanSm أو CDD [SWS_CANIF_00724] [SWS_CANIF_00711]. وتذهب عمليات التحقق من صحة التنبيه إلى EcuM [SWS_CANIF_00563].

kontext ul Obere Schichten PduR, CanNm, CanTp, J1939Tp, J1939Nm, CanTSyn, Xcp, CDD canif CanIf ul->canif CanIf_Transmit() CanIf_SetPduMode() CanIf_ReadRxPduData() cansm CanSm / CDD cansm->canif CanIf_SetControllerMode() CanIf_SetTrcvMode() ecum EcuM / Integrationscode ecum->canif CanIf_Init() CanIf_CheckWakeup() CanIf_CheckValidation() canif->ul <User_RxIndication> <User_TxConfirmation> <User_TriggerTransmit> canif->cansm <User_ControllerBusOff> <User_ControllerModeIndication> <User_TrcvModeIndication> canif->ecum <User_ValidateWakeupEvent> can برنامج تشغيل CAN (Can) نسخة واحدة أو أكثر canif->can Can_Write() Can_SetControllerMode() Can_CheckWakeup() trcv CAN-Transceiver-Treiber (CanTrcv) canif->trcv CanTrcv_SetOpMode() CanTrcv_CheckWakeup() det Det canif->det Det_ReportError() Det_ReportRuntimeError() idsm IdsM canif->idsm Sicherheitsereignisse mirror Bus Mirroring canif->mirror Mirror_ReportCanFrame() can->canif CanIf_RxIndication() CanIf_TxConfirmation() CanIf_ControllerBusOff() CanIf_ControllerModeIndication() trcv->canif CanIf_TrcvModeIndication()

مخطط السياق: تتوسط CanIf بين وحدات الاتصال العليا، وإدارة الأوضاع (CanSm، EcuM)، وبرامج التشغيل لوحدات تحكم CAN وأجهزة الإرسال والاستقبال. تذهب بلاغات الأخطاء والأمان وعكس البيانات (Mirroring) إلى DET وIdsM وMirror. المصادر: [SWS_CANIF_00011]، [SWS_CANIF_00724]، [SWS_CANIF_00358]، [SWS_CANIF_00905]، [SWS_CANIF_00913]، SWS CanIf ص. 13

يعتمد النطاق الوظيفي بشكل كبير على التكوين. يقرأ CanIf_Init() من حاويات التكوين، من بين أمور أخرى، عدد وحدات التحكم وتعيين HTHs/HRHs SWS CanIf ص. 22. يُعد HTH وHRH مقابض لكائنات إرسال أو استقبال منطقية [SWS_CANIF_00291] [SWS_CANIF_00292]. ويمكن إلغاء تحديد العديد من الخدمات عبر مفاتيح Pre-Compile، على سبيل المثال CanIf_ReadRxPduData() [SWS_CANIF_00330] أو CanIf_SetBaudrate() [SWS_CANIF_00871]. وإذا لم يتم تكوين اسم لاستدعاء رد اتصال غير إلزامي، يُلغى الاستدعاء SWS CanIf ص. 133. في المقابل، يجب دائماً تكوين <User_ControllerBusOff> [SWS_CANIF_00524].

من التهيئة إلى وحدة التحكم التي تم بدء تشغيلها

يستدعي EcuM CanIf_Init() [SWS_CANIF_00001]. في هذه العملية، تقوم CanIf بتهيئة المتغيرات، والأعلام، والمخازن المؤقتة [SWS_CANIF_00085]، بالإضافة إلى جميع المخازن المؤقتة لوحدات L-PDU للإرسال [SWS_CANIF_00387]. تبدأ كل قناة في CANIF_OFFLINE [SWS_CANIF_00864]. وتظل وحدات التحكم بعد ذلك في الوضع STOPPED، الذي لا يتم فيه إرسال أو استقبال. يقوم EcuM بتهيئة CanDrv وCanTrcv بشكل منفصل SWS CanIf ص. 40. قبل التهيئة، تُرجع جميع الخدمات باستثناء CanIf_Init() وCanIf_GetVersionInfo() E_NOT_OK [SWS_CANIF_00661]. ومن يستدعي CanIf_DeInit() [SWS_CANIF_91002] يجب عليه التأكد من عدم وجود عمليات إرسال جارية SWS CanIf ص. 81.

يعمل بدء تشغيل وحدة التحكم بشكل غير متزامن. يستدعي CanIf_SetControllerMode() [SWS_CANIF_00003] Can_SetControllerMode() [SWS_CANIF_00308]. ويبلغ برنامج التشغيل لاحقاً عن التغيير المكتمل بواسطة CanIf_ControllerModeIndication() [SWS_CANIF_00699]، وتُمرر CanIf البلاغ إلى CanSm [SWS_CANIF_00711]. وفي وضع الاستقصاء (Polling)، يتعرف Can_MainFunction_Mode() على التغيير SWS CanIf ص. 152. وفي CAN_CS_STARTED فقط يقبل CanIf_SetPduMode() الطلبات [SWS_CANIF_00874].

بدء وحدة التحكم وتمكين قناة PDUCanSm / obere SchichtCanIfCanCanControllerCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)طلب الانتقال إلى STARTE_OKE_OK (Anforderung angenommen)غير متزامن: التغييرلم يكتمل بعدloopCan_MainFunction_Mode() bis Moduswechsel erkanntفحص حالة العتادCanIf_ControllerModeIndication(ControllerId,CAN_CS_STARTED)<User_ControllerModeIndication>(CanSM_ControllerModeIndication)Use Case: PDU-Pfade freischaltenCanIf_SetPduMode(ControllerId, CANIF_ONLINE)مسموح به فقط في CAN_CS_STARTEDE_OK

مخطط التسلسل: تتم تسوية طلب البدء على الفور، ولكن لا يُشار إلى تغيير الوضع إلا لاحقاً. بعد ذلك يمكن تمكين مسارات PDU. المصادر: [SWS_CANIF_00308]، [SWS_CANIF_00711]، [SWS_CANIF_00874]، SWS CanIf ص. 156.

أوضاع قنوات PDU: تبديل مسار الإرسال ومسار الاستقبال بشكل منفصل

لكل قناة في وحدة التحكم وضع من النوع CanIf_PduModeType [SWS_CANIF_00137]. تقوم الطبقات العليا بضبطه بواسطة CanIf_SetPduMode() وقراءته بواسطة CanIf_GetPduMode() [SWS_CANIF_00008] [SWS_CANIF_00009]. الأوضاع بالتفصيل SWS CanIf ص. 58:

  • CANIF_OFFLINE: تُرفض أوامر الإرسال بواسطة E_NOT_OK ويتم إفراغ المخازن المؤقتة. وتُحجب المؤشرات والتأكيدات [SWS_CANIF_00073].
  • CANIF_TX_OFFLINE: يتم حظر مسار الإرسال فقط، بينما يظل الاستقبال نشطاً [SWS_CANIF_00489].
  • CANIF_TX_OFFLINE_ACTIVE: يتم تأكيد أوامر الإرسال فوراً، دون تمريرها إلى CanDrv [SWS_CANIF_00072].
  • CANIF_ONLINE: الإرسال والاستقبال نشطان بالكامل [SWS_CANIF_00075].

تضبط أحداث وحدة التحكم وضع القناة قسرياً. يؤدي CAN_CS_SLEEP إلى CANIF_OFFLINE [SWS_CANIF_00865]. ويؤدي CAN_CS_STOPPED وBusOff إلى CANIF_TX_OFFLINE [SWS_CANIF_00866].

pdumodi cluster_offline OFFLINE (Oberzustand) start off CANIF_OFFLINE kein Senden, kein Empfang start->off CanIf_Init() txoff CANIF_TX_OFFLINE استقبال فقط off->txoff CAN_CS_STOPPED / BusOff on CANIF_ONLINE إرسال واستقبال off->on CanIf_SetPduMode(CANIF_ONLINE) txoff->off CAN_CS_SLEEP txoff->on CanIf_SetPduMode(CANIF_ONLINE) txact CANIF_TX_OFFLINE_ACTIVE استقبال، ويتم تأكيد الإرسال فوراً txact->off CAN_CS_SLEEP txact->txoff CAN_CS_STOPPED / BusOff txact->on CanIf_SetPduMode(CANIF_ONLINE) on->off CanIf_SetPduMode(CANIF_OFFLINE) أو CAN_CS_SLEEP on->txoff CanIf_SetPduMode(CANIF_TX_OFFLINE) أو CAN_CS_STOPPED / BusOff on->txact CanIf_SetPduMode(CANIF_TX_OFFLINE_ACTIVE) hinweis لا يُقبل ()CanIf_SetPduMode إلا عند كون وحدة التحكم في CAN_CS_STARTED؛ المعروض هو مجموعة مختارة من الانتقالات

مخطط الحالة: أوضاع قنوات PDU الأربعة مع الانتقالات بواسطة CanIf_SetPduMode() وبواسطة أحداث وحدة التحكم. تم تجميع الأوضاع الثلاثة المقيدة في حالة عليا كما في المواصفة. المصادر: [SWS_CANIF_00864]، [SWS_CANIF_00865]، [SWS_CANIF_00866]، [SWS_CANIF_00874]، SWS CanIf الشكل 7.8 ص. 61

مسار الإرسال: CanIf_Transmit، والتخزين المؤقت، وTrigger Transmit

يحدد CanIf_Transmit() [SWS_CANIF_00005] HTH ويستدعي Can_Write(). ويعود swPduHandle المُمرر لاحقاً في CanIf_TxConfirmation() [SWS_CANIF_00318]. قبل ذلك، تضبط CanIf البتين ذوي الأهمية القصوى في CanId [SWS_CANIF_00243]. وإذا أرجع Can_Write() E_OK، فإن هذا ينطبق أيضاً على أمر الإرسال [SWS_CANIF_00162].

لا يُقبل أي أمر إلا بموجب هذه الشروط:

  • وحدة التحكم في حالة تشغيل ومسار الإرسال في وضع online أو offline active [SWS_CANIF_00317].
  • عند تنشيط PnTxFilter، تمر وحدات CanIfTxPduPnFilterPdu فقط [SWS_CANIF_00750].
  • يتم تقصير البيانات الزائدة عن الطول باستخدام CanIfTxPduTruncation [SWS_CANIF_00894]، وإلا تُرفض [SWS_CANIF_00900].

تذكر مواضع الوثائق الأحدث بالإضافة إلى ذلك CanXL_Write() SWS CanIf ص. 87. بالنسبة للإصدار R20-11، يُعد Can_Write() وحده معيارياً إلزامياً.

txentscheidung start aufruf CanIf_Transmit(TxPduId, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init modus وحدة التحكم في CAN_CS_STARTED و مسار الإرسال online / offline active؟ init->modus نعم nok1 E_NOT_OK init->nok1 لا active Kanal in CANIF_TX_OFFLINE_ACTIVE? modus->active نعم nok2 E_NOT_OK (عند CANIF_OFFLINE يُضاف CANIF_E_STOPPED) modus->nok2 لا pn PnTxFilter نشط وليست CanIfTxPduPnFilterPdu؟ active->pn لا bestaetigen <User_TxConfirmation> sofort, kein Can_Write() active->bestaetigen نعم laenge SduLength أكبر من PDU العامة؟ pn->laenge لا nok3 E_NOT_OK pn->nok3 نعم trunc CanIfTxPduTruncation aktiviert? laenge->trunc نعم write Can_Write(Hth, PduInfo) laenge->write لا kuerzen تقليص البيانات إلى طول PDU العامة trunc->kuerzen نعم nok4 CANIF_E_TXPDU_LENGTH_EXCEEDED, E_NOT_OK trunc->nok4 لا kuerzen->write rueck القيمة المرجعة من ()Can_Write؟ write->rueck puffer التخزين المؤقت نشط و حجم المخزن المؤقت > 0؟ rueck->puffer CAN_BUSY ok E_OK rueck->ok E_OK gleich نفس L-PDU مخزنة مؤقتاً بالفعل؟ puffer->gleich نعم nok5 E_NOT_OK (L-PDU verloren) puffer->nok5 لا frei freies Pufferelement? gleich->frei لا ueberschreiben الكتابة فوق النسخة المخزنة مؤقتاً gleich->ueberschreiben نعم ablegen L-PDU in CanIfTxBuffer ablegen frei->ablegen نعم nok6 E_NOT_OK frei->nok6 لا ueberschreiben->ok ablegen->ok

مخطط النشاط: هكذا يقرر CanIf_Transmit() بين الرفض، والتأكيد المحاكى، والإرسال المباشر، والتخزين المؤقت. تفسير: تم اختيار ترتيب الفحوصات لتسهيل القراءة. المصادر: [SWS_CANIF_00317]، [SWS_CANIF_00382]، [SWS_CANIF_00072]، [SWS_CANIF_00381]، [SWS_CANIF_00837]، SWS CanIf الشكل 7.5 ص. 51

إذا أبلغ Can_Write() عن CAN_BUSY وكان CanIfPublicTxBuffering نشطاً [SWS_CANIF_00063]، تحاول CanIf تخزين L-PDU مؤقتاً [SWS_CANIF_00381]. ويتطلب ذلك حجماً للمخزن المؤقت أكبر من الصفر [SWS_CANIF_00835]. وإذا كانت نفس الـ L-PDU موجودة بالفعل في المخزن المؤقت، يتم الكتابة فوقها [SWS_CANIF_00068]. وإذا كان المخزن المؤقت ممتلئاً، تُرفض أي L-PDU جديدة بواسطة E_NOT_OK [SWS_CANIF_00837]. وتوجد الـ L-PDU دائماً في موضع واحد فقط: في كائن العتاد أو في المخزن المؤقت لـ CanIf SWS CanIf ص. 43.

عند CanIf_TxConfirmation() [SWS_CANIF_00007]، تُخطر CanIf المستخدم المسؤول عبر <User_TxConfirmation> باستخدام E_OK [SWS_CANIF_00383]. وفي نفس الاستدعاء، تفحص المخازن المؤقتة لـ HTH الذي أصبح شاغراً [SWS_CANIF_00386]. وتُمرر المدخل المنتظر ذو الأولوية القصوى إلى Can_Write() [SWS_CANIF_00668] [SWS_CANIF_00070]. وعند E_OK تقوم بإزالة المدخل فوراً من المخزن المؤقت [SWS_CANIF_00183]. تذكر مواضع الوثائق الأحدث استدعاء رد الاتصال LSduR_CanIfTxConfirmation() SWS CanIf ص. 157. وفي R20-11 ينطبق <User_TxConfirmation>.

الإرسال مع التخزين المؤقت وإعادة الإرسال عند التأكيدObere Schicht (z. B. PduR)CanIfCanCanControllerUse Case: أمر إرسال عند انشغال العتادCanIf_Transmit(TxPduId, PduInfoPtr)Can_Write(Hth, PduInfo)CAN_BUSYL-PDU in CanIfTxBuffer ablegenE_OKUse Case: تأكيد لأمر سابقTransmit-InterruptCanIf_TxConfirmation(CanTxPduId)فحص المخزن المؤقت لـ HTH التي أصبحت متاحةaltالذاكرة المؤقتة ممتلئة()Can_Write للإدخالذو الأولوية القصوىL-PDU in Hardware schreibenE_OKإزالة الإدخال من الذاكرة المؤقتة فورًاPuffer leerkein weiterer Can_Write()-Aufruf<User_TxConfirmation>(TxPduId, E_OK)

مخطط التسلسل: عند انشغال العتاد، يتم تخزين L-PDU مؤقتاً. ثم يؤدي تأكيد أمر سابق إلى إطلاق الإرسال اللاحق من المخزن المؤقت. المصادر: [SWS_CANIF_00381]، [SWS_CANIF_00386]، [SWS_CANIF_00668]، [SWS_CANIF_00183]، SWS CanIf ص. 138، SWS CanIf ص. 143.

في الإرسال المُحفّز (Triggered Transmission)، لا يُمرر المستخدم بيانات، بل مؤشر SduDataPtr-NULL [SWS_CANIF_00882]. وإذا كان العتاد شاغراً، يجلب برنامج التشغيل البيانات عبر CanIf_TriggerTransmit() [SWS_CANIF_00883]. تُمرر CanIf الاستدعاء إلى <User_TriggerTransmit> وتُرجع نتيجته [SWS_CANIF_00885]. وإذا كان العتاد مشغولاً، تخزن CanIf فقط طلب الإرسال (Transmit Request) مؤقتاً [SWS_CANIF_00881]. يمكن تغيير CanId لوحدات L-PDU الديناميكية باستخدام CanIf_SetDynamicTxId() [SWS_CANIF_00189]. وبدلاً من ذلك، تأتي من MetaData [SWS_CANIF_00855] SWS CanIf ص. 34.

Trigger TransmitObere SchichtCanIfCanCanControllerCanIf_Transmit(TxPduId, PduInfoPtr)SduDataPtr = NULL، فقط SduLengthCan_Write(Hth, PduInfo)altHardwareobjekt freiCanIf_TriggerTransmit(TxPduId, PduInfoPtr)<User_TriggerTransmit>(TxPduId, PduInfoPtr)Daten in bereitgestelltenPuffer kopierenE_OKE_OK (تم تمرير القيمة المرجعة)L-PDU in Hardware kopierenE_OKE_OKHardwareobjekt belegtCAN_BUSYفقط Transmit Request فيتخزين CanIfTxBuffer مؤقتاً (إذا كان ذلك ممكناً)

مخطط التسلسل: في Trigger Transmit، لا يجلب برنامج التشغيل البيانات من المستخدم إلا عندما يصبح كائن العتاد شاغراً. المصادر: [SWS_CANIF_00882]، [SWS_CANIF_00885]، [SWS_CANIF_00881]، SWS CanIf الشكل 9.6 ص. 137.

مسار الاستقبال: التصفية، والتحقق من الطول، والتوجيه

بعد الاستقبال، يستدعي برنامج التشغيل CanIf_RxIndication() باستخدام Mailbox والبيانات [SWS_CANIF_00006]. وتتم المعالجة في ثلاث مراحل:

rx start aufruf CanIf_RxIndication(Mailbox, PduInfoPtr) start->aufruf init CanIf initialisiert? aufruf->init keine لا توجد معالجة Rx init->keine لا filterkonf Software-Filter konfiguriert (BasicCAN-HRH)? init->filterkonf نعم filter Software-Filter: CanId akzeptiert? filterkonf->filter نعم dlckonf فحص الطول نشط؟ filterkonf->dlckonf لا verworfen إنهاء دون إشارة filter->verworfen لا filter->dlckonf نعم dlc الطول >= الطول المُهيأ؟ dlckonf->dlc نعم akzeptiert L-PDU akzeptiert dlckonf->akzeptiert لا dlcfehler Det_ReportRuntimeError() CANIF_E_INVALID_DATA_LENGTH dlc->dlcfehler لا dlc->akzeptiert نعم neben اعتماداً على التكوين: ملء المخزن المؤقت للاستقبال، تعيين حالة الإشعار akzeptiert->neben ziel Ziel-Nutzer konfiguriert? akzeptiert->ziel indikation <User_RxIndication>(RxPduId, PduInfoPtr) ziel->indikation نعم ende Ende ziel->ende لا indikation->ende

مخطط النشاط: تقرر التصفية البرمجية وفحص الطول ما إذا كان سيُشار إلى L-PDU المستلمة أم لا. تظهر الآثار الجانبية المعتمدة على التكوين بشكل متوازٍ. المصادر: [SWS_CANIF_00421]، [SWS_CANIF_00389]، [SWS_CANIF_00168]، [SWS_CANIF_00199]، [SWS_CANIF_00392]، SWS CanIf الشكل 7.6 ص. 51

بشكل تكميلي، تقدم CanIf خدمات الاستعلام. يقرأ CanIf_ReadRxPduData() البيانات من مخزن مؤقت للاستقبال خاص به [SWS_CANIF_00194] [SWS_CANIF_00198]، ولكنه ليس مخصصاً لاستقبال النطاقات [SWS_CANIF_00329]. يقوم CanIf_ReadTxNotifStatus() وCanIf_ReadRxNotifStatus() بإعادة تعيين الحالة عند القراءة [SWS_CANIF_00393] [SWS_CANIF_00394]. ويضمن أسلوب «read-and-consume» هذا وقوع حدث واحد على الأقل منذ آخر استدعاء SWS CanIf ص. 55. ويجمع CanIf_GetTxConfirmationState() تأكيدات وحدة تحكم بأكملها [SWS_CANIF_00734].

أجهزة الإرسال والاستقبال، والتنبيه، والشبكات الجزئية (Partial Networking)

تُوجّه CanIf خدمات جهاز الإرسال والاستقبال مباشرة إلى برنامج تشغيل CanTrcv. يستدعي CanIf_SetTrcvMode() CanTrcv_SetOpMode() [SWS_CANIF_00358]، ويستدعي CanIf_GetTrcvMode() CanTrcv_GetOpMode() [SWS_CANIF_00363]. وتُمرر CanIf تغييرات وضع جهاز الإرسال والاستقبال إلى CanSm [SWS_CANIF_00712].

ل للتنبيه، يستعلم CanIf_CheckWakeup() من وحدات التحكم وأجهزة الإرسال والاستقبال عن مصدر التنبيه [SWS_CANIF_00395] SWS CanIf ص. 56. وللتحقق من الصحة، تخزن CanIf أول استقبال صالح لوحدة تحكم تم بدء تشغيلها [SWS_CANIF_00286]. ثم يبلغ CanIf_CheckValidation() عنه عبر <User_ValidateWakeupEvent> [SWS_CANIF_00179].

إذا كانت الشبكات الجزئية (Partial Networking) نشطة، يضع PnTxFilter طبقة إضافية فوق أوضاع القنوات لكل وحدة تحكم [SWS_CANIF_00747]. ويتم تفعيله عند CAN_CS_SLEEP [SWS_CANIF_00749] ويُعاد إلغاء تفعيله مع أول تأكيد أو إشارة [SWS_CANIF_00751] [SWS_CANIF_00896] SWS CanIf ص. 70.

التصرف في حالة الخطأ

BusOff: يبلغ برنامج التشغيل عن الخطأ بواسطة CanIf_ControllerBusOff() [SWS_CANIF_00218]. وبناءً على ذلك تضبط CanIf القناة على CANIF_TX_OFFLINE [SWS_CANIF_00866] وتبلغ CanSm عن BusOff [SWS_CANIF_00724] SWS CanIf الشكل 9.11 ص. 147. وتتحكم CanSm في الاستعادة عبر CanIf_SetControllerMode() SWS CanIf ص. 160.

الإبلاغ عن BusOff والاستعادةCanSm (<User_ControllerBusOff>)CanIfCanCanControllerBusOff-Erkennungوحدة التحكم عند الحاجةالضبط على STOPPEDCanIf_ControllerBusOff(ControllerId)القناة على CANIF_TX_OFFLINE،Sendepuffer leerenعند الإبلاغ عن أحداث الأمان (Security-Event-Reporting):CANIF_SEV_ERRORSTATE_BUSOFF<User_ControllerBusOff>(ControllerId)= CanSM_ControllerBusOff()Use Case: WiederherstellungCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)E_OKE_OKCanIf_ControllerModeIndication(ControllerId,CAN_CS_STARTED)<User_ControllerModeIndication>

مخطط التسلسل: التسلسل بدءاً من اكتشاف BusOff مروراً بالبلاغ إلى CanSm وصولاً إلى إعادة تشغيل وحدة التحكم. المصادر: [SWS_CANIF_00218]، [SWS_CANIF_00866]، [SWS_CANIF_00724]، [SWS_CANIF_00918]، SWS CanIf ص. 154، SWS CanIf ص. 160

إيقاف وحدة التحكم: عند الدخول في CAN_CS_STOPPED، تُفرغ CanIf مخازن الإرسال المؤقتة [SWS_CANIF_00485]. وتؤكد جميع أوامر الإرسال المعلقة بواسطة E_NOT_OK [SWS_CANIF_00739]. وهكذا يتلقى كل PDU مقبول تأكيداً، سواء كان إيجابياً أو سلبياً SWS CanIf ص. 54.

رسائل الخطأ: يُبلّغ CanIf عن المعلمات غير الصالحة كأخطاء تطوير، مثل CANIF_E_PARAM_CONTROLLERID [SWS_CANIF_00311] [SWS_CANIF_91006]. وتتضمن أخطاء وقت التشغيل من بين أمور أخرى CANIF_E_INVALID_DATA_LENGTH [SWS_CANIF_00168] وCANIF_E_STOPPED [SWS_CANIF_00382] [SWS_CANIF_91007]. لا تظهر طلبات الإرسال المفقودة إلا من خلال القيمة المُرجعة أو غياب التأكيد Error Description ص. 22. وتُبلّغ CanIf عن الأحداث الأمنية مثل CANIF_SEV_ERRORSTATE_PASSIVE إلى IdsM [SWS_CANIF_00913] [SWS_CANIF_00917].

أدلة تفصيلية إضافية

دليل تم إنشاؤه بواسطة الذكاء الاصطناعي استناداً إلى مقتطفات من المواصفات. تُعد المتطلبات المرتبطة معيارية للإصدار R20-11؛ وتم تمييز مواضع المستندات المأخوذة من إصدارات أحدث على هذا النحو.

CAN Interface (CanIf)

The CanIf abstracts CAN hardware details and provides uniform access to multiple CAN controllers and transceivers for higher-layer modules (PduR, CanTp, CanNm, CanSM).

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

دالة CanIf_Init [SWS_CANIF_00001] 📄 PDF

void CanIf_Init (const CanIf_ConfigType* ConfigPtr);

This service Initializes internal and external interfaces of the CAN Interface for the further processing.

دليل المنفِّذ قيد الإعداد (التعقيد I3)

دالة CanIf_DeInit [SWS_CANIF_91002] 📄 PDF

void CanIf_DeInit (void);

De-initializes the CanIf module.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة CanIf_ReadRxPduData [SWS_CANIF_00194] 📄 PDF

Std_ReturnType CanIf_ReadRxPduData (PduIdType CanIfRxSduId, PduInfoType* CanIfRxInfoPtr);

This service provides the Data Length and the received data of the requested CanIfRxSduId to the calling upper layer.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ReadTxNotifStatus [SWS_CANIF_00202] 📄 PDF

CanIf_NotifStatusType CanIf_ReadTxNotifStatus (PduIdType CanIfTxSduId);

This service returns the confirmation status (confirmation occurred or not) of a specific static or dynamic CAN Tx L-PDU, requested by the CanIfTxSduId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ReadRxNotifStatus [SWS_CANIF_00230] 📄 PDF

CanIf_NotifStatusType CanIf_ReadRxNotifStatus (PduIdType CanIfRxSduId);

This service returns the indication status (indication occurred or not) of a specific CAN Rx L-PDU, requested by the CanIfRxSduId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_SetTrcvMode [SWS_CANIF_00287] 📄 PDF

Std_ReturnType CanIf_SetTrcvMode (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This service changes the operation mode of the tansceiver TransceiverId, via calling the corresponding CAN Transceiver Driver service.

دليل المنفِّذ قيد الإعداد (التعقيد I3)

دالة CanIf_CheckWakeup [SWS_CANIF_00219] 📄 PDF

Std_ReturnType CanIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);

This service checks, whether an underlying CAN driver or a CAN transceiver driver already signals a wakeup event.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_GetTxConfirmationState [SWS_CANIF_00734] 📄 PDF

CanIf_NotifStatusType CanIf_GetTxConfirmationState (uint8 ControllerId);

This service reports, if any TX confirmation has been done for the whole CAN controller since the last CAN controller start.

دالة CanIf_ClearTrcvWufFlag [SWS_CANIF_00760] 📄 PDF

Std_ReturnType CanIf_ClearTrcvWufFlag (uint8 TransceiverId);

Requests the CanIf module to clear the WUF flag of the designated CAN transceiver.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_CheckTrcvWakeFlag [SWS_CANIF_00761] 📄 PDF

Std_ReturnType CanIf_CheckTrcvWakeFlag (uint8 TransceiverId);

Requests the CanIf module to check the Wake flag of the designated CAN transceiver.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_SetBaudrate [SWS_CANIF_00867] 📄 PDF

Std_ReturnType CanIf_SetBaudrate (uint8 ControllerId, uint16 BaudRateConfigID);

This service shall set the baud rate configuration of the CAN controller. Depending on necessary baud rate modifications the controller might have to reset.

دالة CanIf_GetControllerRxErrorCounter [SWS_CANIF_91003] 📄 PDF

Std_ReturnType CanIf_GetControllerRxErrorCounter (uint8 ControllerId, uint8* RxErrorCounterPtr);

This service calls the corresponding CAN Driver service for obtaining the Rx error counter of the CAN controller.

دالة CanIf_GetControllerTxErrorCounter [SWS_CANIF_91004] 📄 PDF

Std_ReturnType CanIf_GetControllerTxErrorCounter (uint8 ControllerId, uint8* TxErrorCounterPtr);

This service calls the corresponding CAN Driver service for obtaining the Tx error counter of the CAN controller.

دالة CanIf_EnableBusMirroring [SWS_CANIF_91005] 📄 PDF

Std_ReturnType CanIf_EnableBusMirroring (uint8 ControllerId, boolean MirroringActive);

Enables or disables mirroring for a CAN controller.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_TriggerTransmit [SWS_CANIF_00883] 📄 PDF

Std_ReturnType CanIf_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_TxConfirmation [SWS_CANIF_00007] 📄 PDF

void CanIf_TxConfirmation (PduIdType CanTxPduId);

This service confirms a previously successfully processed transmission of a CAN TxPDU.

دليل المنفِّذ قيد الإعداد (التعقيد I3)

دالة CanIf_RxIndication [SWS_CANIF_00006] 📄 PDF

void CanIf_RxIndication (const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr);

This service indicates a successful reception of a received CAN Rx L-PDU to the CanIf after passing all filters and validation checks.

دليل المنفِّذ قيد الإعداد (التعقيد I3)

دالة CanIf_ControllerBusOff [SWS_CANIF_00218] 📄 PDF

void CanIf_ControllerBusOff (uint8 ControllerId);

This service indicates a Controller BusOff event referring to the corresponding CAN Controller with the abstract CanIf ControllerId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ConfirmPnAvailability [SWS_CANIF_00815] 📄 PDF

void CanIf_ConfirmPnAvailability (uint8 TransceiverId);

This service indicates that the transceiver is running in PN communication mode referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ClearTrcvWufFlagIndication [SWS_CANIF_00762] 📄 PDF

void CanIf_ClearTrcvWufFlagIndication (uint8 TransceiverId);

This service indicates that the transceiver has cleared the WufFlag referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_CheckTrcvWakeFlagIndication [SWS_CANIF_00763] 📄 PDF

void CanIf_CheckTrcvWakeFlagIndication (uint8 TransceiverId);

This service indicates that the check of the transceiver's wake-up flag has been finished by the corresponding CAN transceiver with the abstract CanIf TransceiverId. This indication is used to cope with the asynchronous transceiver communication.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ControllerModeIndication [SWS_CANIF_00699] 📄 PDF

void CanIf_ControllerModeIndication (uint8 ControllerId, Can_ControllerStateType ControllerMode);

This service indicates a controller state transition referring to the corresponding CAN controller with the abstract CanIf ControllerId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_TrcvModeIndication [SWS_CANIF_00764] 📄 PDF

void CanIf_TrcvModeIndication (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This service indicates a transceiver state transition referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ControllerErrorStatePassive [SWS_CANIF_91008] 📄 PDF

void CanIf_ControllerErrorStatePassive (uint8 ControllerId, uint16 RxErrorCounter, uint16 TxErrorCounter);

The function derives the ErrorCounterTreshold from RxErrorCounter/ TxErrorCounter values and reports it to the IdsM as security event CANIF_SEV_ERRORSTATE_PASSIVE to the IdsM. It also prepares the context data for the respective security event.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة CanIf_ErrorNotification [SWS_CANIF_91009] 📄 PDF

void CanIf_ErrorNotification (uint8 ControllerId, Can_ErrorType Can_ErrorType);

The function shall derive the bus error source rx or tx from the parameter CanError and report the bus error as security event CANIF_SEV_TX_ERROR_DETECTED or CANIF_SEV_RX_ ERROR_DETECTED. It also prepares the context data for the respective security event.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة <User_TriggerTransmit> [SWS_CANIF_00886] 📄 PDF

Std_ReturnType <User_TriggerTransmit> (PduIdType TxPduId, PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_TxConfirmation> [SWS_CANIF_00011] 📄 PDF

void <User_TxConfirmation> (PduIdType TxPduId, Std_ReturnType result);

The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_RxIndication> [SWS_CANIF_00012] 📄 PDF

void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);

Indication of a received PDU from a lower layer communication interface module.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

دالة <User_ValidateWakeupEvent> [SWS_CANIF_00532] 📄 PDF

void <User_ValidateWakeupEvent> (EcuM_WakeupSourceType sources);

This service indicates if a wake up event initiated from the wake up source (CAN controller or transceiver) after a former request to the CAN Driver or CAN Transceiver Driver module is valid.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_ControllerBusOff> [SWS_CANIF_00014] 📄 PDF

void <User_ControllerBusOff> (uint8 ControllerId);

This service indicates a bus-off event to the corresponding upper layer module (mainly the CAN State Manager module).

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_ConfirmPnAvailability> [SWS_CANIF_00821] 📄 PDF

void <User_ConfirmPnAvailability> (uint8 TransceiverId);

This service indicates that the CAN transceiver is running in PN communication mode.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_ClearTrcvWufFlagIndication> [SWS_CANIF_00788] 📄 PDF

void <User_ClearTrcvWufFlagIndication> (uint8 TransceiverId);

This service indicates that the CAN transceiver has cleared the WufFlag. This function is called in CanIf_ClearTrcvWufFlagIndication.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_CheckTrcvWakeFlagIndication> [SWS_CANIF_00814] 📄 PDF

void <User_CheckTrcvWakeFlagIndication> (uint8 TransceiverId);

This service indicates that the wake up flag in the CAN transceiver is set. This function is called in CanIf_CheckTrcvWakeFlagIndication.

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_ControllerModeIndication> [SWS_CANIF_00687] 📄 PDF

void <User_ControllerModeIndication> (uint8 ControllerId, Can_ControllerStateType ControllerMode);

This service indicates a CAN controller state transition to the corresponding upper layer module (mainly the CAN State Manager module).

دليل المنفِّذ قيد الإعداد (التعقيد I1)

دالة <User_TrcvModeIndication> [SWS_CANIF_00693] 📄 PDF

void <User_TrcvModeIndication> (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This service indicates a CAN transceiver state transition to the corresponding upper layer module (mainly the CAN State Manager module).

دليل المنفِّذ قيد الإعداد (التعقيد I1)

نوع CanIf_ConfigType [SWS_CANIF_00144] 📄 PDF

This type defines a data structure for the post build parameters of the CAN interface for all underlying CAN drivers. At initialization the CanIf gets a pointer to a structure of this type to get access to its configuration data, which is necessary for initialization.

نوع CanIf_PduModeType [SWS_CANIF_00137] 📄 PDF

The PduMode of a channel defines its transmit or receive activity. Communication direction (transmission and/or reception) of the channel can be controlled separately or together by upper layers.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

نوع CanIf_NotifStatusType [SWS_CANIF_00201] 📄 PDF

Type CanIf_NotifStatusType.

دليل المنفِّذ قيد الإعداد (التعقيد I2)

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_CanIf
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_CanIf@rel:R20-11#c2099949
Content hash
c2099949
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CANInterface.pdf#nameddest=SWS_CANIF_00001

خريطة المواضيع

عرض التفاصيل

اختر عنصرًا من المخطط.

التهيئة والحالة

CanIf_DeInit دالة

De-initializes the CanIf module.

void CanIf_DeInit (void);

This service returns the version information of the called CAN Interface module.

void CanIf_GetVersionInfo (Std_VersionInfoType* VersionInfo);
CanIf_Init دالة

This service Initializes internal and external interfaces of the CAN Interface for the further processing.

void CanIf_Init (const CanIf_ConfigType* ConfigPtr);

الخدمات · Get…

This service calls the corresponding CAN Driver service for obtaining the error state of the CAN controller.

Std_ReturnType CanIf_GetControllerErrorState (uint8 ControllerId, Can_ErrorStateType* ErrorStatePtr);

This service calls the corresponding CAN Driver service for obtaining the current status of the CAN controller.

Std_ReturnType CanIf_GetControllerMode (uint8 ControllerId, Can_ControllerStateType* ControllerModePtr);

This service calls the corresponding CAN Driver service for obtaining the Rx error counter of the CAN controller.

Std_ReturnType CanIf_GetControllerRxErrorCounter (uint8 ControllerId, uint8* RxErrorCounterPtr);

This service calls the corresponding CAN Driver service for obtaining the Tx error counter of the CAN controller.

Std_ReturnType CanIf_GetControllerTxErrorCounter (uint8 ControllerId, uint8* TxErrorCounterPtr);

This service reports the current mode of a requested PDU channel.

Std_ReturnType CanIf_GetPduMode (uint8 ControllerId, CanIf_PduModeType* PduModePtr);

This function invokes CanTrcv_GetOpMode and updates the parameter TransceiverModePtr with the value OpMode provided by CanTrcv.

Std_ReturnType CanIf_GetTrcvMode (uint8 TransceiverId, CanTrcv_TrcvModeType* TransceiverModePtr);

This service returns the reason for the wake up of the transceiver TransceiverId, via calling the corresponding CAN Transceiver Driver service.

Std_ReturnType CanIf_GetTrcvWakeupReason (uint8 TransceiverId, CanTrcv_TrcvWakeupReasonType* TrcvWuReasonPtr);

This service reports, if any TX confirmation has been done for the whole CAN controller since the last CAN controller start.

CanIf_NotifStatusType CanIf_GetTxConfirmationState (uint8 ControllerId);

الخدمات · Set…

This service shall set the baud rate configuration of the CAN controller. Depending on necessary baud rate modifications the controller might have to reset.

Std_ReturnType CanIf_SetBaudrate (uint8 ControllerId, uint16 BaudRateConfigID);

This service calls the corresponding CAN Driver service for changing of the CAN controller mode.

Std_ReturnType CanIf_SetControllerMode (uint8 ControllerId, Can_ControllerStateType ControllerMode);

This service reconfigures the corresponding CAN identifier of the requested CAN L-PDU.

void CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId);

This service sets the requested mode at the L-PDUs of a predefined logical PDU channel.

Std_ReturnType CanIf_SetPduMode (uint8 ControllerId, CanIf_PduModeType PduModeRequest);

This service changes the operation mode of the tansceiver TransceiverId, via calling the corresponding CAN Transceiver Driver service.

Std_ReturnType CanIf_SetTrcvMode (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

This function shall call CanTrcv_SetTrcvWakeupMode.

Std_ReturnType CanIf_SetTrcvWakeupMode (uint8 TransceiverId, CanTrcv_TrcvWakeupModeType TrcvWakeupMode);

الخدمات · Check…

Requests the CanIf module to check the Wake flag of the designated CAN transceiver.

Std_ReturnType CanIf_CheckTrcvWakeFlag (uint8 TransceiverId);

This service indicates that the check of the transceiver's wake-up flag has been finished by the corresponding CAN transceiver with the abstract CanIf TransceiverId. This indication is used to cope with the asynchronous transceiver communication.

void CanIf_CheckTrcvWakeFlagIndication (uint8 TransceiverId);

This service is performed to validate a previous wakeup event.

Std_ReturnType CanIf_CheckValidation (EcuM_WakeupSourceType WakeupSource);

This service checks, whether an underlying CAN driver or a CAN transceiver driver already signals a wakeup event.

Std_ReturnType CanIf_CheckWakeup (EcuM_WakeupSourceType WakeupSource);

الخدمات · Controller…

This service indicates a Controller BusOff event referring to the corresponding CAN Controller with the abstract CanIf ControllerId.

void CanIf_ControllerBusOff (uint8 ControllerId);

The function derives the ErrorCounterTreshold from RxErrorCounter/ TxErrorCounter values and reports it to the IdsM as security event CANIF_SEV_ERRORSTATE_PASSIVE to the IdsM. It also prepares the context data for the respective security event.

void CanIf_ControllerErrorStatePassive (uint8 ControllerId, uint16 RxErrorCounter, uint16 TxErrorCounter);

This service indicates a controller state transition referring to the corresponding CAN controller with the abstract CanIf ControllerId.

void CanIf_ControllerModeIndication (uint8 ControllerId, Can_ControllerStateType ControllerMode);

الخدمات · Read…

This service returns the indication status (indication occurred or not) of a specific CAN Rx L-PDU, requested by the CanIfRxSduId.

CanIf_NotifStatusType CanIf_ReadRxNotifStatus (PduIdType CanIfRxSduId);

This service provides the Data Length and the received data of the requested CanIfRxSduId to the calling upper layer.

Std_ReturnType CanIf_ReadRxPduData (PduIdType CanIfRxSduId, PduInfoType* CanIfRxInfoPtr);

This service returns the confirmation status (confirmation occurred or not) of a specific static or dynamic CAN Tx L-PDU, requested by the CanIfTxSduId.

CanIf_NotifStatusType CanIf_ReadTxNotifStatus (PduIdType CanIfTxSduId);

الخدمات · أخرى

Requests the CanIf module to clear the WUF flag of the designated CAN transceiver.

Std_ReturnType CanIf_ClearTrcvWufFlag (uint8 TransceiverId);

This service indicates that the transceiver has cleared the WufFlag referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

void CanIf_ClearTrcvWufFlagIndication (uint8 TransceiverId);

This service indicates that the transceiver is running in PN communication mode referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

void CanIf_ConfirmPnAvailability (uint8 TransceiverId);

Enables or disables mirroring for a CAN controller.

Std_ReturnType CanIf_EnableBusMirroring (uint8 ControllerId, boolean MirroringActive);

The function shall derive the bus error source rx or tx from the parameter CanError and report the bus error as security event CANIF_SEV_TX_ERROR_DETECTED or CANIF_SEV_RX_ ERROR_DETECTED. It also prepares the context data for the respective security event.

void CanIf_ErrorNotification (uint8 ControllerId, Can_ErrorType Can_ErrorType);

Requests transmission of a PDU.

Std_ReturnType CanIf_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);

This service indicates a transceiver state transition referring to the corresponding CAN transceiver with the abstract CanIf TransceiverId.

void CanIf_TrcvModeIndication (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

دوال الاستدعاء الراجع

This service indicates a successful reception of a received CAN Rx L-PDU to the CanIf after passing all filters and validation checks.

void CanIf_RxIndication (const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

Std_ReturnType CanIf_TriggerTransmit (PduIdType TxPduId, PduInfoType* PduInfoPtr);

This service confirms a previously successfully processed transmission of a CAN TxPDU.

void CanIf_TxConfirmation (PduIdType CanTxPduId);

دوال Callout والواجهات المتوقعة

This service indicates that the wake up flag in the CAN transceiver is set. This function is called in CanIf_CheckTrcvWakeFlagIndication.

void <User_CheckTrcvWakeFlagIndication> (uint8 TransceiverId);

This service indicates that the CAN transceiver has cleared the WufFlag. This function is called in CanIf_ClearTrcvWufFlagIndication.

void <User_ClearTrcvWufFlagIndication> (uint8 TransceiverId);

This service indicates that the CAN transceiver is running in PN communication mode.

void <User_ConfirmPnAvailability> (uint8 TransceiverId);

This service indicates a bus-off event to the corresponding upper layer module (mainly the CAN State Manager module).

void <User_ControllerBusOff> (uint8 ControllerId);

This service indicates a CAN controller state transition to the corresponding upper layer module (mainly the CAN State Manager module).

void <User_ControllerModeIndication> (uint8 ControllerId, Can_ControllerStateType ControllerMode);

Indication of a received PDU from a lower layer communication interface module.

void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);

This service indicates a CAN transceiver state transition to the corresponding upper layer module (mainly the CAN State Manager module).

void <User_TrcvModeIndication> (uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

Std_ReturnType <User_TriggerTransmit> (PduIdType TxPduId, PduInfoType* PduInfoPtr);

The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.

void <User_TxConfirmation> (PduIdType TxPduId, Std_ReturnType result);

This service indicates if a wake up event initiated from the wake up source (CAN controller or transceiver) after a former request to the CAN Driver or CAN Transceiver Driver module is valid.

void <User_ValidateWakeupEvent> (EcuM_WakeupSourceType sources);

الأنواع

This type defines a data structure for the post build parameters of the CAN interface for all underlying CAN drivers. At initialization the CanIf gets a pointer to a structure of this type to get access to its configuration data, which is necessary for initialization.

Type CanIf_NotifStatusType.

The PduMode of a channel defines its transmit or receive activity. Communication direction (transmission and/or reception) of the channel can be controlled separately or together by upper layers.