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 ड्राइवरों या ट्रांसीवर्स और ऊपरी संचार मॉड्यूल के बीच हार्डवेयर-स्वतंत्र परत है। यह ट्रांसमिशन अनुरोधों को 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] के माध्यम से हार्डवेयर बफ़र्स तक पहुंचता है। यह अमूर्त IDs [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] के अनुसार उच्चतम प्राथमिकता वाली प्रविष्टि को भेजता है। CanIf द्वारा <User_RxIndication> को अग्रेषित करने से पहले प्राप्त L-PDUs सॉफ़्टवेयर फ़िल्टरिंग और लंबाई सत्यापन से गुजरते हैं [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) ECU के CAN संचार के सभी हार्डवेयर-स्वतंत्र कार्यों को संभालता है। इसके नीचे के CAN ड्राइवर केवल अपने ठोस हार्डवेयर का ध्यान रखते हैं। CanIf ट्रांसमिशन अनुरोधों, ट्रांसमिशन पुष्टिकरणों, रिसेप्शन संकेतों और त्रुटि संदेशों को प्रोसेस करता है और CAN कंट्रोलर्स SWS CanIf पृ. 13 को प्रारंभ या रोकता है। यह विशेष रूप से CanDrv [SWS_CANIF_00023] की सेवाओं के माध्यम से हार्डवेयर बफ़र्स तक पहुंचता है। नियंत्रण सेवाएं एक अमूर्त ControllerId के साथ काम करती हैं, जो 0 से शुरू होकर सभी CanDrv इंस्टेंसेस के कंट्रोलर्स को नंबर देती है [SWS_CANIF_00653]। ट्रांसीवर्स के लिए TransceiverId [SWS_CANIF_00655] के साथ भी यही लागू होता है।

नीचे की ओर, CanIf कई CanTrcv ड्राइवरों के APIs को एक एकीकृत इंटरफ़ेस में जोड़ता है, लेकिन इसमें स्वयं कोई ट्रांसीवर लॉजिक नहीं होता है SWS CanIf पृ. 21। कई CanDrvs के मामले में भी, प्रत्येक कॉलबैक केवल एक बार मौजूद होता है। CanIf Can_HwType SWS CanIf पृ. 68 में ControllerId द्वारा कॉलिंग ड्राइवर को पहचानता है।

ऊपर की ओर, 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 कंट्रोलर्स तथा ट्रांसीवर्स के ड्राइवरों के बीच मध्यस्थता करता है। त्रुटि, सुरक्षा और मिररिंग संदेश 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] के हैंडल हैं। कई सेवाओं को प्री-कंपाइल स्विच के माध्यम से हटाया जा सकता है, उदा. 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] को अग्रेषित करता है। पोलिंग संचालन में, Can_MainFunction_Mode() परिवर्तन SWS CanIf पृ. 152 का पता लगाता है। केवल CAN_CS_STARTED में CanIf_SetPduMode() अनुरोध [SWS_CANIF_00874] स्वीकार करता है।

कंट्रोलर प्रारंभ करें और PDU चैनल सक्षम करेंCanSm / obere SchichtCanIfCanCanControllerCanIf_SetControllerMode(ControllerId,CAN_CS_STARTED)Can_SetControllerMode(Controller, Transition)START में संक्रमण का अनुरोध करेंE_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_STARTED में अनुमतE_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 में हो; संक्रमणों का एक चयन दिखाया गया है

स्टेट डायग्राम: CanIf_SetPduMode() द्वारा और कंट्रोलर घटनाओं द्वारा संक्रमणों के साथ चार PDU चैनल मोड। विनिर्देश की तरह, तीन प्रतिबंधित मोड एक सुपरस्टेट में संयुक्त हैं। स्रोत: [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] पर भी लागू होता है।

किसी रिक्वेस्ट को केवल इन शर्तों के तहत ही स्वीकार किया जाता है:

  • कंट्रोलर शुरू हो चुका है और ट्रांसमिशन पाथ ऑनलाइन या ऑफ़लाइन सक्रिय है [SWS_CANIF_00317]।
  • सक्रिय PnTxFilter के साथ, केवल CanIfTxPduPnFilterPdus ही पास होते हैं [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)

अनुक्रम आरेख (Sequence Diagram): हार्डवेयर व्यस्त होने पर L-PDU बफ़र हो जाती है। पूर्व अनुरोध की पुष्टि फिर बफ़र से पुनः भेजने की प्रक्रिया शुरू करती है। स्रोत: [SWS_CANIF_00381], [SWS_CANIF_00386], [SWS_CANIF_00668], [SWS_CANIF_00183], SWS CanIf पृ. 138, SWS CanIf पृ. 143

ट्रिगर किए गए ट्रांसमिशन (Triggered Transmission) में, यूज़र डेटा पास नहीं करता है, बल्कि एक NULL-SduDataPtr [SWS_CANIF_00882] पास करता है। यदि हार्डवेयर खाली है, तो ड्राइवर CanIf_TriggerTransmit() [SWS_CANIF_00883] के माध्यम से डेटा प्राप्त करता है। CanIf कॉल को <User_TriggerTransmit> पर अग्रेषित करता है और उसका परिणाम लौटाता है [SWS_CANIF_00885]। यदि हार्डवेयर व्यस्त है, तो CanIf केवल ट्रांसमिट रिक्वेस्ट [SWS_CANIF_00881] को बफ़र करता है। डायनामिक L-PDUs की CanId को 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केवल ट्रांसमिट अनुरोध कोCanIfTxBuffer में बफ़र करें (यदि संभव हो)

अनुक्रम आरेख (Sequence Diagram): Trigger Transmit में, ड्राइवर यूज़र से डेटा केवल तभी लेता है जब हार्डवेयर ऑब्जेक्ट खाली होता है। स्रोत: [SWS_CANIF_00882], [SWS_CANIF_00885], [SWS_CANIF_00881], SWS CanIf चित्र 9.6 पृ. 137

रिसेप्शन पाथ: फ़िल्टर करना, लंबाई जाँचना, अग्रेषित करना

रिसेप्शन के बाद, ड्राइवर CanIf_RxIndication() को Mailbox और डेटा के साथ कॉल करता है [SWS_CANIF_00006]। प्रोसेसिंग तीन चरणों में चलती है:

  • सॉफ़्टवेयर फ़िल्टर: BasicCAN-HRHs के लिए, CanIf सॉफ़्टवेयर [SWS_CANIF_00663] SWS CanIf पृ. 39 के माध्यम से फ़िल्टर करता है। अस्वीकृति प्रोसेसिंग को समाप्त कर देती है [SWS_CANIF_00389]।
  • लंबाई की जाँच: यदि कॉन्फ़िगर किया गया हो, तो यह अनुसरण करता है [SWS_CANIF_00390], और कम से कम कॉन्फ़िगर की गई लंबाई को स्वीकार करता है [SWS_CANIF_00026]।
  • फॉरवर्डिंग: स्वीकृत L-PDUs कॉन्फ़िगर किए गए <User_RxIndication> [SWS_CANIF_00056] [SWS_CANIF_00135] पर जाती हैं। डायनामिक L-SDUs के मामले में, CanId CAN_ID_32 [SWS_CANIF_00848] में समाप्त होती है।
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] के माध्यम से इसकी रिपोर्ट करता है।

यदि आंशिक नेटवर्किंग सक्रिय है, तो प्रति कंट्रोलर एक 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] पर सेट करता है और BusOff की रिपोर्ट CanSm [SWS_CANIF_00724] SWS CanIf चित्र 9.11 पृ. 147 को करता है। CanSm CanIf_SetControllerMode() SWS CanIf पृ. 160 के माध्यम से रिकवरी को नियंत्रित करता है।

BusOff रिपोर्टिंग और रिकवरीCanSm (<User_ControllerBusOff>)CanIfCanCanControllerBusOff-Erkennungआवश्यकतानुसार कंट्रोलरSTOPPED पर सेट करेंCanIf_ControllerBusOff(ControllerId)चैनल CANIF_TX_OFFLINE पर,Sendepuffer leerenSecurity-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>

अनुक्रम आरेख (Sequence Diagram): 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 अमान्य पैरामीटरों को विकास त्रुटियों (development errors) के रूप में रिपोर्ट करता है, उदाहरण के लिए 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_SetControllerMode [SWS_CANIF_00003] 📄 PDF

Std_ReturnType CanIf_SetControllerMode (uint8 ControllerId, Can_ControllerStateType ControllerMode);

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

इम्प्लीमेंटर गाइड जल्द आएगी (जटिलता I2)

फ़ंक्शन 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_SetPduMode [SWS_CANIF_00008] 📄 PDF

Std_ReturnType CanIf_SetPduMode (uint8 ControllerId, CanIf_PduModeType PduModeRequest);

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

इम्प्लीमेंटर गाइड जल्द आएगी (जटिलता I3)

फ़ंक्शन CanIf_SetDynamicTxId [SWS_CANIF_00189] 📄 PDF

void CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId);

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

फ़ंक्शन 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_CheckValidation [SWS_CANIF_00178] 📄 PDF

Std_ReturnType CanIf_CheckValidation (EcuM_WakeupSourceType WakeupSource);

This service is performed to validate a previous 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#d8a06a5e
Content hash
d8a06a5e
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);
CanIf_GetVersionInfo फ़ंक्शन

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…

CanIf_GetControllerErrorState फ़ंक्शन

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);
CanIf_GetControllerMode फ़ंक्शन

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);
CanIf_GetControllerRxErrorCounter फ़ंक्शन

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);
CanIf_GetControllerTxErrorCounter फ़ंक्शन

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);
CanIf_GetPduMode फ़ंक्शन

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

Std_ReturnType CanIf_GetPduMode (uint8 ControllerId, CanIf_PduModeType* PduModePtr);
CanIf_GetTrcvMode फ़ंक्शन

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);
CanIf_GetTrcvWakeupReason फ़ंक्शन

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);
CanIf_GetTxConfirmationState फ़ंक्शन

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…

CanIf_SetBaudrate फ़ंक्शन

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);
CanIf_SetControllerMode फ़ंक्शन

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

Std_ReturnType CanIf_SetControllerMode (uint8 ControllerId, Can_ControllerStateType ControllerMode);
CanIf_SetDynamicTxId फ़ंक्शन

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

void CanIf_SetDynamicTxId (PduIdType CanIfTxSduId, Can_IdType CanId);
CanIf_SetPduMode फ़ंक्शन

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);
CanIf_SetTrcvMode फ़ंक्शन

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);
CanIf_SetTrcvWakeupMode फ़ंक्शन

This function shall call CanTrcv_SetTrcvWakeupMode.

Std_ReturnType CanIf_SetTrcvWakeupMode (uint8 TransceiverId, CanTrcv_TrcvWakeupModeType TrcvWakeupMode);

सेवाएँ · Check…

CanIf_CheckTrcvWakeFlag फ़ंक्शन

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

Std_ReturnType CanIf_CheckTrcvWakeFlag (uint8 TransceiverId);
CanIf_CheckTrcvWakeFlagIndication फ़ंक्शन

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);
CanIf_CheckValidation फ़ंक्शन

This service is performed to validate a previous wakeup event.

Std_ReturnType CanIf_CheckValidation (EcuM_WakeupSourceType WakeupSource);
CanIf_CheckWakeup फ़ंक्शन

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…

CanIf_ControllerBusOff फ़ंक्शन

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

void CanIf_ControllerBusOff (uint8 ControllerId);
CanIf_ControllerErrorStatePassive फ़ंक्शन

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);
CanIf_ControllerModeIndication फ़ंक्शन

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…

CanIf_ReadRxNotifStatus फ़ंक्शन

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);
CanIf_ReadRxPduData फ़ंक्शन

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);
CanIf_ReadTxNotifStatus फ़ंक्शन

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);

सेवाएँ · अन्य

CanIf_ClearTrcvWufFlag फ़ंक्शन

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

Std_ReturnType CanIf_ClearTrcvWufFlag (uint8 TransceiverId);
CanIf_ClearTrcvWufFlagIndication फ़ंक्शन

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);
CanIf_ConfirmPnAvailability फ़ंक्शन

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);
CanIf_EnableBusMirroring फ़ंक्शन

Enables or disables mirroring for a CAN controller.

Std_ReturnType CanIf_EnableBusMirroring (uint8 ControllerId, boolean MirroringActive);
CanIf_ErrorNotification फ़ंक्शन

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);
CanIf_Transmit फ़ंक्शन

Requests transmission of a PDU.

Std_ReturnType CanIf_Transmit (PduIdType TxPduId, const PduInfoType* PduInfoPtr);
CanIf_TrcvModeIndication फ़ंक्शन

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);

कॉलबैक

CanIf_RxIndication फ़ंक्शन

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);
CanIf_TriggerTransmit फ़ंक्शन

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);
CanIf_TxConfirmation फ़ंक्शन

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

void CanIf_TxConfirmation (PduIdType CanTxPduId);

कॉलआउट और अपेक्षित इंटरफ़ेस

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);
<User_ClearTrcvWufFlagIndication> फ़ंक्शन

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

void <User_ClearTrcvWufFlagIndication> (uint8 TransceiverId);
<User_ConfirmPnAvailability> फ़ंक्शन

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

void <User_ConfirmPnAvailability> (uint8 TransceiverId);
<User_ControllerBusOff> फ़ंक्शन

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

void <User_ControllerBusOff> (uint8 ControllerId);
<User_ControllerModeIndication> फ़ंक्शन

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);
<User_RxIndication> फ़ंक्शन

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

void <User_RxIndication> (PduIdType RxPduId, const PduInfoType* PduInfoPtr);
<User_TrcvModeIndication> फ़ंक्शन

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);
<User_TriggerTransmit> फ़ंक्शन

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);
<User_TxConfirmation> फ़ंक्शन

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);
<User_ValidateWakeupEvent> फ़ंक्शन

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);

टाइप

CanIf_ConfigType टाइप

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.

CanIf_PduModeType टाइप

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.