DEENESPTFRRUARHIKOZHNL

CAN Interface (CanIf)

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

모듈 가이드AI 생성

CAN 드라이버와 통신 스택 간에 CAN 메시지 및 모드 제어를 하드웨어 독립적으로 중개함.
AI 생성 미검증 모델: 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 통신의 모든 하드웨어 독립적 작업을 담당함. 여기에는 전송 요청, 확인, 수신 지시(Indication), 오류 알림뿐만 아니라 CAN 컨트롤러의 시작 및 정지가 포함됨 SWS CanIf 13쪽. CanIf는 CanDrv 서비스를 통해서만 하드웨어 버퍼에 접근함 [SWS_CANIF_00023]. 여러 드라이버의 컨트롤러 및 트랜시버를 추상 ID를 통해 지정함 [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_Init()을 사용하여 CanIf를 초기화함. 그 후 모든 채널은 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 상태일 때만 수락됨; 전환의 일부만 표시됨

상태 다이어그램: 4가지 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)는 ECU의 CAN 통신에서 발생하는 모든 하드웨어 독립적인 작업을 담당함. 그 하위의 CAN 드라이버는 구체적인 하드웨어만 처리함. CanIf는 전송 요청, 전송 확인, 수신 지시 및 오류 알림을 처리하고 CAN 컨트롤러를 시작 및 정지함 SWS CanIf 13쪽. 하드웨어 버퍼에는 오직 CanDrv의 서비스를 통해서만 접근함 [SWS_CANIF_00023]. 제어 서비스는 모든 CanDrv 인스턴스의 컨트롤러에 0부터 순차적으로 번호가 매겨진 추상적인 ControllerId을 사용하여 작동함 [SWS_CANIF_00653]. 트랜시버의 경우에도 TransceiverId에 대해 동일하게 적용됨 [SWS_CANIF_00655].

하위 방향으로 CanIf는 여러 CanTrcv 드라이버의 API를 통일된 인터페이스로 통합하지만, 자체적인 트랜시버 로직은 포함하지 않음 SWS CanIf 21쪽. CanDrv가 여러 개인 경우에도 각 콜백은 하나만 존재함. CanIf는 Can_HwType의 ControllerId을 통해 호출 드라이버를 식별함 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 컨트롤러와 트랜시버용 드라이버 사이를 중개함. 오류, 보안 및 미러링 알림은 DET, IdsM 및 Mirror로 전달됨. 출처: [SWS_CANIF_00011], [SWS_CANIF_00724], [SWS_CANIF_00358], [SWS_CANIF_00905], [SWS_CANIF_00913], SWS CanIf 13쪽

기능 범위는 구성에 크게 좌우됨. CanIf_Init()은 구성 컨테이너에서 컨트롤러 수와 HTH/HRH 매핑 등을 읽음 SWS CanIf 22쪽. HTH 및 HRH는 논리적 전송 또는 수신 객체에 대한 핸들임 [SWS_CANIF_00291] [SWS_CANIF_00292]. CanIf_ReadRxPduData() [SWS_CANIF_00330] 또는 CanIf_SetBaudrate() [SWS_CANIF_00871]과 같은 많은 서비스를 Pre-Compile 스위치를 통해 제외할 수 있음. 필수가 아닌 콜백에 이름이 구성되어 있지 않으면 호출되지 않음 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 모드로 유지됨. CanDrv 및 CanTrcv는 EcuM이 별도로 초기화함 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() 및 컨트롤러 이벤트를 통한 전이가 포함된 4가지 PDU 채널 모드. 3개의 제한된 모드는 명세서에서와 같이 하나의 상위 상태로 묶여 있습니다. 출처: [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의 최상위 2개 비트를 설정합니다 [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]. 이를 위해서는 0보다 큰 버퍼 크기가 전제되어야 합니다 [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: 이전 요청에 대한 확인(Confirmation)Transmit-InterruptCanIf_TxConfirmation(CanTxPduId)사용 가능해진 HTH의 버퍼 검사alt버퍼 채워짐엔트리에 대한 Can_Write()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에서 사용자는 데이터를 전달하지 않고 NULL-SduDataPtr을 전달합니다 [SWS_CANIF_00882]. 하드웨어가 비어 있으면 드라이버는 CanIf_TriggerTransmit()를 통해 데이터를 가져옵니다 [SWS_CANIF_00883]. CanIf는 호출을 <User_TriggerTransmit>로 전달하고 그 결과를 반환합니다 [SWS_CANIF_00885]. 하드웨어가 사용 중인 경우 CanIf는 Transmit Request만 버퍼링합니다 [SWS_CANIF_00881]. 동적 L-PDU의 CanId는 CanIf_SetDynamicTxId()로 변경할 수 있습니다 [SWS_CANIF_00189]. 또는 MetaData에서 가져옵니다 [SWS_CANIF_00855] SWS CanIf 34쪽.

Trigger TransmitObere SchichtCanIfCanCanControllerCanIf_Transmit(TxPduId, PduInfoPtr)SduDataPtr = NULL, SduLength만 해당Can_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에 버퍼링(가능한 경우)

시퀀스 다이어그램: Trigger Transmit에서 드라이버는 하드웨어 객체가 비어 있을 때만 사용자로부터 데이터를 가져옵니다. 출처: [SWS_CANIF_00882], [SWS_CANIF_00885], [SWS_CANIF_00881], SWS CanIf 그림 9.6 137쪽

수신 경로: 필터링, 길이 검사, 전달

수신 후 드라이버는 Mailbox 및 데이터와 함께 CanIf_RxIndication()을 호출합니다 [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 지시(Indication) 없이 종료 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].

트랜시버, Wake-up 및 Partial Networking

트랜시버 서비스는 CanIf가 CanTrcv 드라이버로 직접 전달합니다. CanIf_SetTrcvMode()은 CanTrcv_SetOpMode()을 호출하고 [SWS_CANIF_00358], CanIf_GetTrcvMode()은 CanTrcv_GetOpMode()를 호출합니다 [SWS_CANIF_00363]. 트랜시버의 모드 변경은 CanIf가 CanSm으로 전달합니다 [SWS_CANIF_00712].

Wake-up을 위해 CanIf_CheckWakeup()은 컨트롤러 및 트랜시버에 Wake-up 소스를 쿼리합니다 [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] 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 이벤트 보고 시: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_SEV_ERRORSTATE_PASSIVE와 같은 보안 이벤트는 CanIf가 IdsM에 보고합니다 [SWS_CANIF_00913] [SWS_CANIF_00917].

더 자세한 증거

명세서 발췌본을 바탕으로 AI가 생성한 가이드. 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_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_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#ef725eb9
Content hash
ef725eb9
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_CANInterface.pdf#nameddest=SWS_CANIF_00001

초기화 및 상태

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

콜아웃 및 예상 인터페이스

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.