AUTOSAR SWS CANInterface
AUTOSAR SWS CANInterface
AUTOSAR SWS CANInterface
AUTOSAR CP R21-11
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Introduction and functional overview 10
3 Related documentation 15
3.1 Input documents & related standards and norms . . . . . . . . . . . . 15
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Constraints and assumptions 17
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . 17
5 Dependencies to other modules 18
5.1 Upper Protocol Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2 Initialization: Ecu State Manager . . . . . . . . . . . . . . . . . . . . . 19
5.3 Mode Control: CAN State Manager . . . . . . . . . . . . . . . . . . . . 19
5.4 Lower layers: CAN Driver . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5 Lower layers: CAN Transceiver Driver . . . . . . . . . . . . . . . . . . 20
5.6 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.7 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.7.1 Code file structure . . . . . . . . . . . . . . . . . . . . . . . . 22
5.7.2 Header file structure . . . . . . . . . . . . . . . . . . . . . . . 22
6 Requirements Tracing 23
7 Functional specification 28
7.1 General Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.2 Hardware object handles . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.3 Static L-PDUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.4 Dynamic L-PDUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.4.1 Dynamic Transmit L-PDUs . . . . . . . . . . . . . . . . . . . 33
7.4.2 Dynamic receive L-PDUs . . . . . . . . . . . . . . . . . . . . 34
7.5 Physical channel view . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.6 CAN Hardware Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
7.7 BasicCAN and FullCAN reception . . . . . . . . . . . . . . . . . . . . . 37
7.8 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.9 Transmit request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.10 Transmit data flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.11 Transmit buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7.11.1 General behavior . . . . . . . . . . . . . . . . . . . . . . . . 42
7.11.2 Buffer characteristics . . . . . . . . . . . . . . . . . . . . . . 43
7.11.2.1 Storage of L-PDUs in the transmit L-PDU buffer . . . 43
7.11.2.2 Clearance of transmit L-PDU buffers . . . . . . . . . 44
7.11.2.3 Initialization of transmit L-PDU buffers . . . . . . . . 45
7.11.3 Data integrity of transmit L-PDU buffers . . . . . . . . . . . . 45
8.3.2 CanIf_DeInit . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3.3 CanIf_SetControllerMode . . . . . . . . . . . . . . . . . . . . 76
8.3.4 CanIf_GetControllerMode . . . . . . . . . . . . . . . . . . . . 77
8.3.5 CanIf_GetControllerErrorState . . . . . . . . . . . . . . . . . 78
8.3.6 CanIf_Transmit . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.3.7 CanIf_ReadRxPduData . . . . . . . . . . . . . . . . . . . . . 81
8.3.8 CanIf_ReadTxNotifStatus . . . . . . . . . . . . . . . . . . . . 82
8.3.9 CanIf_ReadRxNotifStatus . . . . . . . . . . . . . . . . . . . . 83
8.3.10 CanIf_SetPduMode . . . . . . . . . . . . . . . . . . . . . . . 84
8.3.11 CanIf_GetPduMode . . . . . . . . . . . . . . . . . . . . . . . 85
8.3.12 CanIf_GetVersionInfo . . . . . . . . . . . . . . . . . . . . . . 85
8.3.13 CanIf_SetDynamicTxId . . . . . . . . . . . . . . . . . . . . . 86
8.3.14 CanIf_SetTrcvMode . . . . . . . . . . . . . . . . . . . . . . . 87
8.3.15 CanIf_GetTrcvMode . . . . . . . . . . . . . . . . . . . . . . . 88
8.3.16 CanIf_GetTrcvWakeupReason . . . . . . . . . . . . . . . . . 89
8.3.17 CanIf_SetTrcvWakeupMode . . . . . . . . . . . . . . . . . . 91
8.3.18 CanIf_CheckWakeup . . . . . . . . . . . . . . . . . . . . . . 92
8.3.19 CanIf_CheckValidation . . . . . . . . . . . . . . . . . . . . . 93
8.3.20 CanIf_GetTxConfirmationState . . . . . . . . . . . . . . . . . 94
8.3.21 CanIf_ClearTrcvWufFlag . . . . . . . . . . . . . . . . . . . . 95
8.3.22 CanIf_CheckTrcvWakeFlag . . . . . . . . . . . . . . . . . . . 96
8.3.23 CanIf_SetBaudrate . . . . . . . . . . . . . . . . . . . . . . . 96
8.3.24 CanIf_GetControllerRxErrorCounter . . . . . . . . . . . . . . 97
8.3.25 CanIf_GetControllerTxErrorCounter . . . . . . . . . . . . . . 98
8.3.26 CanIf_EnableBusMirroring . . . . . . . . . . . . . . . . . . . 99
8.3.27 CanIf_GetCurrentTime . . . . . . . . . . . . . . . . . . . . . 100
8.3.28 CanIf_EnableEgressTimeStamp . . . . . . . . . . . . . . . . 100
8.3.29 CanIf_GetEgressTimeStamp . . . . . . . . . . . . . . . . . . 101
8.3.30 CanIf_GetIngressTimeStamp . . . . . . . . . . . . . . . . . . 102
8.4 Callback notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.4.1 CanIf_TriggerTransmit . . . . . . . . . . . . . . . . . . . . . . 103
8.4.2 CanIf_TxConfirmation . . . . . . . . . . . . . . . . . . . . . . 104
8.4.3 CanIf_RxIndication . . . . . . . . . . . . . . . . . . . . . . . 105
8.4.4 CanIf_ControllerBusOff . . . . . . . . . . . . . . . . . . . . . 106
8.4.5 CanIf_ConfirmPnAvailability . . . . . . . . . . . . . . . . . . 107
8.4.6 CanIf_ClearTrcvWufFlagIndication . . . . . . . . . . . . . . . 108
8.4.7 CanIf_CheckTrcvWakeFlagIndication . . . . . . . . . . . . . 109
8.4.8 CanIf_ControllerModeIndication . . . . . . . . . . . . . . . . 110
8.4.9 CanIf_TrcvModeIndication . . . . . . . . . . . . . . . . . . . 111
8.4.10 CanIf_ControllerErrorStatePassive . . . . . . . . . . . . . . . 112
8.4.11 CanIf_ErrorNotification . . . . . . . . . . . . . . . . . . . . . 113
8.5 Scheduled functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.6 Expected interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.6.1 Mandatory interfaces . . . . . . . . . . . . . . . . . . . . . . 114
8.6.2 Optional interfaces . . . . . . . . . . . . . . . . . . . . . . . . 114
8.6.3 Configurable interfaces . . . . . . . . . . . . . . . . . . . . . 116
The CAN Interface module consists of all CAN hardware independent tasks, which
belongs to the CAN communication device drivers of the corresponding ECU. Those
functionality is implemented once in the CAN Interface module, so that underlying CAN
device drivers only focus on access and control of the corresponding specific CAN
hardware device.
CanIf fulfils main control flow and data flow requirements of the PDU Router and
upper layer communication modules of the AUTOSAR COM stack: transmit request
processing, transmit confirmation / receive indication / error notification and start /
stop of a CAN Controller and thus waking up / participating on a network. Its data
processing and notification API is based on CAN L-SDUs, whereas APIs for control
and mode handling provides a CAN Controller related view.
In case of Transmit Requests CanIf completes the L-PDU transmission with cor-
responding parameters and relays the CAN L-PDU via the appropriate CanDrv to the
3 Related documentation
References
[1] Specification of CAN Driver
AUTOSAR_SWS_CANDriver
[2] Specification of CAN Transceiver Driver
AUTOSAR_SWS_CANTransceiverDriver
[3] Specification of CAN State Manager
AUTOSAR_SWS_CANStateManager
[4] Specification of CAN Network Management
AUTOSAR_SWS_CANNetworkManagement
[5] Specification of CAN Transport Layer
AUTOSAR_SWS_CANTransportLayer
[6] Specification of PDU Router
AUTOSAR_SWS_PDURouter
[7] Layered Software Architecture
AUTOSAR_EXP_LayeredSoftwareArchitecture
[8] Glossary
AUTOSAR_TR_Glossary
[9] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[10] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral
[11] Requirements on CAN
AUTOSAR_SRS_CAN
[12] ISO 11898-1:2015 – Road vehicles – Controller area network (CAN)
[13] Specification of ECU State Manager
AUTOSAR_SWS_ECUStateManager
[14] Specification of ECU Configuration
AUTOSAR_TPS_ECUConfiguration
4.1 Limitations
The CAN Interface can be used for CAN communication only and is specifically de-
signed to operate with one or multiple underlying CAN Drivers and CAN Transceiver
Drivers. Several CAN Driver modules covering different CAN Hardware Units are rep-
resented by just one generic interface as specified in the CAN Driver specification [1].
As well in the same manner several CAN Transceiver Driver modules covering different
CAN Transceiver devices are represented by just one generic interface as specified in
the CAN Transceiver Driver specification [2, Specification of CAN Transceiver Driver].
Other protocols than CAN (i.e. LIN or FlexRay) are not supported.
Please be aware that an active PnTxFilter ensures that the first messages on bus
is CanIfTxPduPnFilterPdu. In case that CanIfTxPduPnFilterPdu is the NM-PDU the
COM-Stack start up takes care that the PduGroups are disabled until successful trans-
mission of that PDU. However, transmit requests for other PDUs (i.e. initially started
PDUs, TP-PDUs, XCP-PDUs) will be rejected until the configured PDU was sent. Only
the very first PDU which initiates the Wake-up of the Network has to be the CanIfTx-
PduPnFilterPdu. In case communication is ongoing and there is an successful recep-
tion of frame with PnTxFilter enabled, PnTxFilter shall be disabled. The PnTxFilter is
in this case not needed since an Ack will be provided by an already active Node.
The CanDrv detects and processes events of the CAN Controllers and notifies those
to the CanIf.
The CanIf passes operation mode requests of the CanSm to the corresponding under-
lying CAN Controllers.
CanDrv provides a normalized L-PDU to ensure hardware independence of CanIf.
The pointer to this normalized L-PDU points either to a temporary buffer (for e.g. data
normalizing) or to the CAN hardware dependent CanDrv. For CanIf the kind of L-PDU
buffer is invisible.
The CanIf provides notification services used by the CanDrv in all notifications sce-
narios, for example: transmit confirmation (subsection 8.4.2 “CanIf_TxConfirmation”,
see [SWS_CANIF_00007]), receive indication (subsection 8.4.3 “CanIf_RxIndication”,
see [SWS_CANIF_00006]) and notification of a controller mode change (subsection
8.4.8, see [SWS_CANIF_00699]).
In case of using multiple CanDrv serving different interrupt vectors these callback ser-
vices mentioned above must be re-entrant, refer to section 7.24 “Multiple CAN Driver
support”. Reentrancy of callback functions is specified in section 8.4.
The callback services called by the CanDrv are declared and implemented inside the
CanIf. The callback services called by the CanIf are declared and placed inside the
appropriate upper communication service layer, for example PduR, CanNm, CanTp.
The CanIf structure is specified in section 5.7 “File structure”.
The number of configured CAN Controllers does not necessarily belong to the number
of used CAN Transceivers. In case multiple CAN Controllers of a different types operate
on the same CAN network, one CAN Transceiver and CanTrcv is sufficient, whereas
dependent to the type of the CAN Controller devices one or two different CanDrv are
needed (see section 7.5 “Physical channel view”).
5.6 Configuration
The CanIf design is optimized to manage CAN protocol specific capabilities and han-
dling of the used underlying CAN Controller.
The CanIf is capable to change the CAN configuration without a re-build. Therefore, the
function CanIf_Init() (see [SWS_CANIF_00001]) retrieves the required CAN con-
figuration information from configuration containers and parameters, which are speci-
fied (linked as references, or additional parameters) in chapter 10, see Figure 10.1.
This section gives a summary of the retrieved information, e.g.:
• Number of CAN Controllers. The number of CAN Controllers is necessary for
dispatching of transmit and receive L-PDUs and for the control of the status of
the available CAN Drivers (see CanIfCtrlDrvCfg).
• Number of Hardware Object Handles. To supervise transmit requests the CAN
Interface needs to know the number of HTHs and the assignments between each
HTH and the corresponding CAN Controller (see CanIfHthCanCtrlIdRef;
CanIfHthIdSymRef).
• Range of received CAN IDs passing hardware acceptance filter for each hard-
ware object. The CAN Interface uses fixed assignments between HRHs and
L-PDUs to be received in the corresponding hardware object to conduct a search
algorithm (see section 7.20 “Software receive filter”, see CanIfHrhSoftware-
Filter, CanIfHrhCanCtrlIdRef, CanIfHrhIdSymRef)
CanIf needs information about all used upper communication service layers and L-
-SDUs to be dispatched. The following information has to be set up at configuration
time for integration of CanIf inside the AUTOSAR COM stack:
• Transmitting upper layer module and transmit I-PDU for each transmit L-SDU.
=> Used for dispatching of transmit confirmation services
(see CanIfTxPduId).
• Receiving upper layer module and receive I-PDU for each receive L-SDU.
=> Used for L-SDU dispatching during receive indication
(see CanIfRxPduId).
The CanIf needs the description of the controller and the own ECU, which is connected
to one or multiple CAN networks. The following information is therefore retrieved from
the CAN communication matrix, part of the AUTOSAR system configuration (see
CanIfTxPduCfg, CanIfRxPduCfg):
[SWS_CANIF_00378] dCanIf shall access the location of the API of all used underly-
ing CanDrvs for link time configuration by a set of function pointers for each CanDrv.c
()
The values for the function pointers for each CanDrv are given at link time.
6 Requirements Tracing
The following tables references the requirements specified in [10] as well as [11] and
links to the fulfillment of these. Please note that if column ’Satisfied by’ is empty for a
specific requirement this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
[RS_Ids_00810] Basic SW security events [SWS_CANIF_00913]
[SWS_CANIF_00915]
[SWS_CANIF_00916]
[SWS_CANIF_00917]
[SWS_CANIF_00918]
[SWS_CANIF_00919]
[SWS_CANIF_00920]
[SWS_CANIF_00921]
[SWS_CANIF_91008]
[SWS_CANIF_91009]
[SWS_CANIF_91010]
[SRS_BSW_00007] All Basic SW Modules written in C language [SWS_CANIF_00999]
shall conform to the MISRA C 2012 Standard.
[SRS_BSW_00010] The memory consumption of all Basic SW [SWS_CANIF_00999]
Modules shall be documented for a defined
configuration for all supported platforms.
[SRS_BSW_00101] The Basic Software Module shall be able to [SWS_CANIF_00001]
initialize variables and hardware in a separate
initialization function
[SRS_BSW_00159] All modules of the AUTOSAR Basic Software [SWS_CANIF_00999]
shall support a tool based configuration
[SRS_BSW_00164] The Implementation of interrupt service routines [SWS_CANIF_00999]
shall be done by the Operating System, complex
drivers or modules
[SRS_BSW_00167] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00999]
provide configuration rules and constraints to
enable plausibility checks
[SRS_BSW_00168] SW components shall be tested by a function [SWS_CANIF_00999]
defined in a common API in the Basis-SW
[SRS_BSW_00170] The AUTOSAR SW Components shall provide [SWS_CANIF_00999]
information about their dependency from faults,
signal qualities, driver demands
[SRS_BSW_00172] The scheduling strategy that is built inside the [SWS_CANIF_00999]
Basic Software Modules shall be compatible
with the strategy used in the system
[SRS_BSW_00306] AUTOSAR Basic Software Modules shall be [SWS_CANIF_00999]
compiler and platform independent
[SRS_BSW_00307] Global variables naming convention [SWS_CANIF_00999]
[SRS_BSW_00308] AUTOSAR Basic Software Modules shall not [SWS_CANIF_00999]
define global data in their header files, but in the
C file
[SRS_BSW_00309] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00999]
indicate all global data with read-only purposes
by explicitly assigning the const keyword
[SRS_BSW_00312] Shared code shall be reentrant [SWS_CANIF_00064]
7 Functional specification
CanIf supports activation and deactivation of all L-PDUs belonging to one CAN Con-
troller for transmission as well as for reception (see 7.19.2, see CanIf_SetPdu-
Mode(), [SWS_CANIF_00008]). For L-PDU mode control refer to section 7.19.
Each L-PDU is associated with an upper layer module in order to ensure correct dis-
patching during reception, transmission confirmation, and data access. Each upper
layer module can use the L-PDUs to serve different CAN Controllers simultane-
ously.
According to the PDU architecture defined for the entire AUTOSAR communication
stack (see [7, Layered Software Architecture]), the usage of L-PDUs is split in two
different ways:
• For transmission request and transmission/reception polling API the upper layer
module uses the L-SDU ID (CanTxPduId/CanRxPduId) defined by CanIf as
parameter.
• For all callback APIs, which are invoked by CanIf at upper layer modules, CanIf
passes the target PduId defined by each upper layer module as parameter.
The principle is that the caller must use the defined target L-PDU/L-SDU Id of the
callee.
If power on initialization is not performed and upper layer performs transmit requests
to CanIf, no L-SDUs are transmitted to lower layer and DET shall be invoked. Thus,
no un-initialized data can be transmitted on the network. Behavior of L-PDU/L-SDU
transmitting function is specified in detail in subsection 8.3.6.
During the notification process the CanIf maps the original CAN Controller or CAN
Transceiver parameter from the Driver module to the CanSm. This mapping is done as
the referenced CAN Controller or CAN Transceiver parameters are configured with the
abstracted CanIf parameters ControllerId or TransceiverId.
The CanIf supports multiple physical CAN channels. These have to be distinguished
by the CanSm for network control. The CanIf API provides request and read control
for multiple underlying physical CAN channels.
Moreover the CanIf does not distinguish between dedicated types of CAN physical
layers (i.e. Low-Speed CAN or High-Speed CAN), to which one or multiple CAN Con-
trollers are connected.
7.8 Initialization
The EcuM calls the CanIf’s function CanIf_Init() for initialization of the entire CanIf
(see [SWS_CANIF_00001]). All global variables and data structures are initialized
including flags and buffers during the initialization process. The EcuM executes initial-
ization of CanDrvs and CanTrcvs separately by call of their corresponding initialization
services (refer to [1] and [2, Specification of CAN Transceiver Driver]).
The CanIf expects that the CAN Controller remains in STOPPED mode like af-
ter power-on reset after the initialization process has been completed. In this
mode the CanIf and CanDrv are neither able to transmit nor receive CAN L-PDUs
(see [SWS_CANIF_00001]).
If re-initialization of the entire CAN modules during runtime is required, the EcuM shall
invoke the CanSm (see [3]) to initiate the required state transitions of the CAN Con-
troller by call of CAN Interface module’s API service CanIf_SetControllerMode
(). The CanIf maps the calls from CanSm to calls of the respective CanDrvs (see
subsection 8.6.3).
Call of Can_Write()
CAN Hardware is
free? [No]
Trigger-transmit
PDU?
[Yes]
[No] [Yes]
CanIf stores information about the available hardware objects configured for trans-
mission purposes. The function CanIf_Transmit() maps the CanTxPduId to the
corresponding HTH and calls the function Can_Write() (see [SWS_CANIF_00318]).
[SWS_CANIF_00904] dIf Bus Mirroring is enabled globally (see CanIfBusMirror-
ingSupport) and has been activated with a call to CanIf_EnableBusMirroring
() for a CAN Controller, the CanIf shall store the content of each frame before it
is transmitted on that controller with Can_Write().c(SRS_Can_01172)
Note: The frame content should only be provided to the Bus Mirroring module when it
was actually sent. Therefore, the content has to be stored so that it can be provided to
the Bus Mirroring module from within the CanIf_TxConfirmation().
At the scope of CanIf the transmit process starts with the call of CanIf_Transmit()
and it ends with invocation of upper layer module’s callback service <User_TxCon-
firmation>(). During the transmit process CanIf, CanDrv and the CAN Mailbox
altogether shall store the L-PDU to be transmitted only once at a single location. De-
pending on the transmit method, these are:
• The CAN hardware transmit object or
• The Transmit L-PDU Buffer inside CanIf, if transmit buffering is enabled.
For triggered transmission, CanIf only has to store the transmit request for the given
L-PDU but not its data. The data is fetched just in time by means of the trigger transmit
function when the HTH is free (again). A single Tx L-PDU, requested for transmission,
shall never be stored twice. This behavior corresponds to the usual way of periodic
communication on the CAN network.
If transmit buffering is enabled, CanIf will store a Tx L-PDU in a CanIf Trans-
mit L-PDU Buffer (CanIfBufferCfg), if it is rejected by CanDrv at Transmit
Request.
Basically, the overall buffer in CanIf for buffering Tx L-PDUs consits of one or multi-
ple CanIfBufferCfg (see CanIfBufferCfg). Whereas each CanIfBufferCfg is
assigned to one or multiple dedicated CanIfBufferHthRef (see CanIfBuffer-
HthRef) and can be configured to buffer one or multiple Tx L-PDUs. But as al-
ready mentioned above only one instance per Tx L-PDU can be buffered in the overall
amount of CanIfBufferCfg.
The behavior of CanIf during L-PDU transmission differs whether transmit buffering
is enabled in the configuration setup for the corresponding Tx L-PDU, or not. If trans-
mit buffering is disabled and a transmit request to CanDrv fails (CAN Controller
mailbox is in use, BasicCAN), the L-PDU is not copied to the CAN Controller’s
mailbox and CanIf_Transmit() returns the value E_NOT_OK. If transmit buffering is
enabled and a transmit request to CanDrv fails, depending on the CanIfTxBuffer
configuration the L-PDU can be stored in a CanIfTxBuffer. In this case the API
CanIf_Transmit() returns the value E_OK although the transmission could not be
performed. In this case CanIf takes care of the outstanding transmission of the L-
-PDU via CanIf_TxConfirmation() callback and the upper layer doesn’t have to
retry the transmit request.
The number of available transmit CanIf Tx L-PDU Buffers can be configured
completely independent from the number of used Transmit L-PDUs defined in the
CAN network description file for this ECU.
As per [SWS_CANIF_00835] a Tx L-PDU refers HTHs via the CanIfBufferCfg con-
figuration container (see CanIfBufferCfg). This is valid if transmit buffering is not
needed as well. In this case, the buffer size (see CanIfBufferSize) of the Can-
IfBufferCfg has to be set to 0. Then CanIfBufferCfg configuration container is
only used to refer a HTH.
CanIf tries to store a new Transmit L-PDU or its Transmit Request in the
Transmit L-PDU Buffer only, if CanDrv return CAN_BUSY during a call of Can_-
Write() (see [SWS_CANIF_00381]).
[SWS_CANIF_00063] dThe CanIf shall support buffering of a CAN L-PDU for Ba-
sicCAN transmission in the CanIf, if parameter CanIfPublicTxBuffering (see
CanIfPublicTxBuffering) is enabled.c(SRS_Can_01020)
[SWS_CANIF_00849] dFor dynamic Transmit L-PDUs, also the CanId has to be
stored in the CanIfTxBuffer.c()
[SWS_CANIF_00381] dIf transmit buffering is enabled (see [SWS_CANIF_00063])
and if the call of Can_Write() for a PDU configured for direct transmission returns
with CAN_BUSY, CanIf shall check if it is possible to buffer the CanIf Tx L-PDU,
which was requested to be transmitted via Can_Write() in a CanIfTxBuffer.c
(SRS_Can_01126)
When the call of Can_Write() returns with CAN_BUSY, CanDrv has rejected the
requested transmission of the L-PDU (see [1]) because there is no free hardware object
available at time of the transmit request (Tx request).
[SWS_CANIF_00895] dIf the rejected data length exceeds the configured size, CanIf
shall:
• buffer the configured amount of data and discard the rest
• and report runtime error code CANIF_E_DATA_LENGTH_MISMATCH to the
Det_ReportRuntimeError() service of the DET.
c()
[SWS_CANIF_00881] dIf transmit buffering is enabled (see [SWS_CANIF_00063])
and if the call of Can_Write() for a PDU configured for triggered transmission returns
with CAN_BUSY, CanIf shall check if it is possible to buffer the Transmit Request,
which was requested to be transmitted via Can_Write() in a CanIfTxBuffer.c
(SRS_Can_01126)
Requests are stored within the CanIfTxBuffers, which are assigned to the new
free Hardware Transmit Object (see [SWS_CANIF_00466]).c()
[SWS_CANIF_00668] dIf pending CanIf Tx L-PDUs or Transmit Requests are
available in the CanIfTxBuffers as per [SWS_CANIF_00386], then CanIf shall
call Can_Write() for that pending CanIf Tx L-PDU or Transmit Requests (of
the one assigned to the new Hardware Transmit Object) with the highest priority
(see [SWS_CANIF_00070]).c()
[SWS_CANIF_00070] dCanIf shall transmit L-PDUs or Transmit Requests stored
in the Transmit L-PDU Buffers in priority order (see [12, ISO 11898-1:2015]) per
each HTH. CanIf shall not differentiate between L-PDUs and Transmit Requests.c
()
[SWS_CANIF_00183] dWhen CanIf calls the function Can_Write() for prioritized
L-PDUs and Transmit Requests stored in CanIfTxBuffer and the return value of
Can_Write() is E_OK, then CanIf shall remove this L-PDU or Transmit Request
from the Transmit L-PDU Buffer immediately, before the transmit confirmation re-
turns.c()
The behavior specified in [SWS_CANIF_00183] simplifies the choice of the new trans-
mit L-PDU stored in the Transmit L-PDU Buffer.
Receive Interrupt
[No]
Rx L-PDU [Yes]
received in Software filtering
BasicCAN ?
[No]
[Yes]
Data Length
Check enabled? [L-PDU passed]
[No]
Data Length [No]
Check failed ?
[Yes]
[L-PDU not
Call Det_ReportRuntimeError() with passed]
error code
CANIF_E_INVALID_DATA_LENGTH
Call <User_RxIndication>() to
upper layers
«datastore»
Copy data to L-PDU
buffer
<User_RxIndication>() returns
CanIf_RxIndication() returns
called, the CanIf evaluates the CAN L-PDU for acceptance and prepares the L-SDU
for later access by the upper communication layers. The CanIf notifies upper layer
modules about this asynchronous event using <User_RxIndication>() (see sub-
subsection 8.6.3.3 “<User_RxIndication>”, [SWS_CANIF_00012]), if configured and if
this CAN L-PDU is successfully detected and accepted for further processing. The
detailed requirements for this behavior follow here.
[SWS_CANIF_00906] dIf Bus Mirroring is enabled globally (see CanIfBusMirror-
ingSupport) and has been activated with a call to CanIf_EnableBusMirroring
() for a CAN Controller, the CanIf shall call Mirror_ReportCanFrame() for
each frame reception on that controller that is indicated with CanIf_RxIndication
().c(SRS_Can_01172)
[SWS_CANIF_00389] dIf the function CanIf_RxIndication() is called, the CanIf
shall process the Software Filtering on the received L-PDU, if configured (see multi-
plicity of CanIfHrhRangeCfg equals 0..∗). If Software Filtering rejects the received
L-PDU, the CanIf shall end the receive indication for that call of CanIf_RxIndica-
tion().c()
Note for [SWS_CANIF_00389]: See 7.20.
[SWS_CANIF_00390] dIf CanIf accepts an L-PDU received via CanIf_RxIndica-
tion() during Software Filtering (see [SWS_CANIF_00389]), CanIf shall process
the Data Length check afterwards, if configured (see CanIfPrivateDataLength-
Check and CanIfRxPduDataLengthCheck).c()
For further details, please refer to section 7.21 “Data Length Check”.
[SWS_CANIF_00297] dIf CanIf has accepted a L-PDU received via CanIf_-
RxIndication() during Data Length Check (see [SWS_CANIF_00390]), CanIf
shall copy the number of bytes according to the configured Data Length (see
ECUC_CanIf_00599) to the static receive buffer, if configured for that L-PDU
(see [SWS_CANIF_00198], ECUC_CanIf_00600).c()
[SWS_CANIF_00851] dIf MetaData is configured for a received L-SDU, CanIf shall
copy the PDU payload to the static receive buffer and the CAN ID to the Meta-
DataItem of type CAN_ID_32.c()
[SWS_CANIF_00056] dIf CanIf accepts a L-PDU received via CanIf_-
RxIndication() during Data Length Check (see [SWS_CANIF_00390],
[SWS_CANIF_00026]), CanIf shall identify if a target upper layer module was
configured (see configuration descrption of [SWS_CANIF_00012], CanIfRxPdu-
UserRxIndicationUL, CanIfRxPduUserRxIndicationName) to be called with
its providing receive indication service for the received L-SDU.c()
[SWS_CANIF_00135] dIf a target upper layer module was configured to be called with
its providing receive indication service (see [SWS_CANIF_00056]), the CanIf shall call
this configured receive indication callback service (see CanIfRxPduUserRxIndi-
cationName) and shall provide the parameters required for upper layer notification
CanIf provides services for controlling the communication mode of all supported
CAN Controllers represented by the underlying CanDrv. This means that all CAN
Controllers are controlled by the corresponding provided API services to request
and read the current controller mode.
The CAN Controller status may be changed at request of the upper layer by the
calling of CanIf_SetControllerMode() service. The request is passed by CanIf
via the CanDrv API to the addressed CAN Controller.
The consistent management of all CAN Controllers connected at one CAN network
is the task of CanSm. By this way CanSm is responsible to set all CAN Controllers
of one CAN network sequentially to sleep mode or to wake them up.
CanIf accepts every state transition request by calling the function CanIf_SetCon-
trollerMode() or CanIf_ControllerBusOff(). CanIf does not decide if a re-
quested mode transition of the CAN Controller is valid or not. CanIf only interacts
with CanDrv by fetching the current mode and execution of requested mode transi-
tions.
This network related state machine is implemented in CanSm. Refer to [3]. CanIf only
stores the requested mode and executes the requested transition.
Hint: As optimisation to avoid frequent requests to CanDrv for internal use the
last state indicated by CanIf_ControllerModeIndication() and Can_GetCon-
trollerMode() could be stored per controller.
Hint: It has to be regarded that not only CanSm is able to request CAN Controller Mode
changes.
According to the requested operation mode by CanSm, CanIf forwards request Can-
Drvs.
[SWS_CANIF_00677] dIf a controller mode referenced by ControllerId is in state
CAN_CS_STOPPED and if the PduIdType parameter in a call of CanIf_Transmit()
is assigned to that CAN Controller, then the call of CanIf_Transmit() does not
result in a call of Can_Write() (see [SWS_CANIF_00317]) and returns E_NOT_OK.c
()
[SWS_CANIF_00485] dIf a controller mode referenced by ControllerId enters state
CAN_CS_STOPPED, then CanIf shall clear the CanIf transmit buffers assigned to the
CAN Controller corresponding.c()
[SWS_CANIF_00739] dIf a controller mode referenced by ControllerId enters state
CAN_CS_STOPPED, then CanIf shall inform corresponding upper layer modules about
failed transmission by calling <User_TxConfirmation>(id, E_NOT_OK) for every
outstanding TxConfirmation assigned to that CAN Controller. If CanIfPublicTx-
ConfirmPollingSupport is enabled, CanIf shall also clear the information about
a TxConfirmation (see [SWS_CANIF_00740]).c()
Note: This ensures, that for each PDU, which shall be transmitted via CanIf_Trans-
mit(), either a positive or negative <User_TxConfirmation>() is called.
[SWS_CANIF_00724] dWhen callback CanIf_ControllerBusOff(Control-
lerId) is called, the CanIf shall call CanSM_ControllerBusOff(Control-
lerId) of the CanSm or a CDD (see [SWS_CANIF_00559], [SWS_CANIF_00560]).c
()
Note for [SWS_CANIF_00724]: See subsubsection 8.6.3.9 “<User_ControllerMod-
eIndication>”.
[SWS_CANIF_00711] dWhen callback CanIf_ControllerModeIndication
(ControllerId, ControllerMode) is called, CanIf shall call CanSm_Con-
trollerModeIndication(ControllerId, ControllerMode) of the CanSm or
a CDD (see [SWS_CANIF_00691], [SWS_CANIF_00692]).c()
Note for [SWS_CANIF_00711]: See subsubsection 8.6.3.9 “<User_ControllerMod-
eIndication>”.
[SWS_CANIF_00712] dWhen callback CanIf_TrcvModeIndication
(Transceiver, TransceiverMode) is called, CanIf shall call CanSM_-
TransceiverModeIndication(TransceiverId, TransceiverMode) of the
CanSm or a CDD (see [SWS_CANIF_00697], [SWS_CANIF_00698]).c()
Note for [SWS_CANIF_00712]: See subsubsection 8.6.3.9 “<User_ControllerMod-
eIndication>”.
The API for state change requests to the CAN Controller behaves in an asyn-
chronous manner with asynchronous notification via callback services.
The real transition to the requested mode occurs asynchronously based on setting of
transition requests in the CAN controller hardware, e.g. request for sleep transition
CAN_CS_SLEEP. After successful change to e.g. CAN_CS_SLEEP mode CanDrv calls
function CanIf_ControllerModeIndication() and CanIf in turn calls function
<User_ControllerModeIndication>(). If CAN transitions very fast, CanIf_-
ControllerModeIndication() can be called during CanIf_SetController-
Mode(). This is implementation specific.
Unsuccessful or no mode transitions of the CAN Controllers have to be tracked by
upper layer modules. Mode transitions CAN_CS_STARTED and CAN_CS_STOPPED are
treated similar.
Upper layer modules of CanIf can poll the current Controller Mode by CanIf_Get-
ControllerMode().
Not all types of CAN Controllers support Sleep and Wake-Up Mode. These
modes are then encapsulated by CanDrv by providing hardware independent oper-
ation modes via its interface, which has to be managed by CanIf.
Note: It is possible that during transition from CAN_CS_STOPPED to CAN_CS_SLEEP
CAN Controller may indicate a wake-up interrupt to the ECU Integration Code.
CanIf distinguishes between internal initiated CAN controller wake-up request (inter-
nal request) and network wake-up request (external request). The internal request is
initiated by call of CanIf’s function CanIf_SetControllerMode(ControllerId,
CAN_CS_STARTED) and it is an internal asynchronous request. The external request
is a CAN controller event, which is notified by CanDrv or CanTrcv to the ECU Inte-
gration Code. For details see respective UML diagram in the chapter "CAN Wakeup
Sequences" of document [13].
7.18.4 Wake-up
The ECU supports wake-up over CAN network, regardless of the used wake-up
method (directly about CAN Controller or CAN Transceiver), only if the CAN
Controller and CAN Transceiver are set to some kind of "listen for wake-up"
mode. This is usually a Sleep Mode, where the usual communication is disabled. Only
this mode ensures that the CAN Controller is stopped. Thus, the wake-up interrupt
can be enabled.
Note: When a CAN Controller / CAN Transceiver detects a bus wake-up event,
then this will be notified to the ECU State Manager directly. If such a wake-up event
needs to be validated, the EcuM (or a CDD) switches on the corresponding CAN Con-
troller (CanIf_SetControllerMode()) and CAN Transceiver (CanIf_Set-
TrcvMode()) (For more details see chapter 9 of [13]).
Attention: CanIf notifies the upper layer modules about received messages after the
PDU Channel Mode has been set to CANIF_ONLINE or CANIF_TX_OFFLINE. Thus,
it is necessary that the PDU Channel Mode is not set to CANIF_ONLINE or CANIF_-
TX_OFFLINE if wake-up validation is required.
Note: As per [SWS_CAN_00411] and CAN Controller State Diagram (see [1]) a direct
transition from mode CAN_CS_SLEEP to CAN_CS_STARTED is not allowed.
Each L-PDU is assigned to one dedicated physical CAN channel connected to one
CAN Controller and one CAN network. By this way all L-PDUs belonging to one
Physical Channel can be controlled on the view of handling logically single L-PDU
channel groups. Those logical groups represent all L-PDUs of one ECU connected to
one underlying CAN network.
Figure 7.7 below shows one possible usage of L-PDU channel group and its relation to
the upper layers and/or networks.
An L-PDU can only be assigned to one channel group.
Typical users like PduR or the Network Management are responsible for controlling the
PDU operation modes.
Figure 7.8 shows a diagram with possible PDU channel modes. Each L-PDU chan-
nel can be in CANIF_OFFLINE (no communication), CANIF_TX_OFFLINE (passive
mode => listen without sending), CANIF_TX_OFFLINE_ACTIVE (simulated transmis-
sion with listening), and CANIF_ONLINE (full communication). The default state is the
CANIF_OFFLINE mode.
7.19.2.1 CANIF_OFFLINE
shall set the PDU channel mode of the corresponding channel to CANIF_TX_OF-
FLINE.c()
[SWS_CANIF_00489] dFor Physical Channels switching to CANIF_TX_OFFLINE
mode CanIf shall:
• prevent forwarding of transmit requests CanIf_Transmit() of associated L-
-PDUs to CanDrv (return E_NOT_OK to the calling upper layer modules),
• clear the corresponding CanIf transmit buffers,
• prevent invocation of transmit confirmation callback services of the upper layer
modules.
• enable invocation of receive indication callback services of the upper layer mod-
ules.
c()
The BusOff notification is implicitly suppressed in case of CANIF_OFFLINE and
CANIF_TX_OFFLINE due to the fact, that no L-PDUs can be transmitted and thus
the CAN Controller is not able to go in BusOff mode by newly requested L-PDUs
for transmission.
[SWS_CANIF_00118] dIf those Transmit L-PDUs, which are already waiting for
transmission in the CAN Transmit Hardware Object, will be transmitted imme-
diately after change to CANIF_TX_OFFLINE or CANIF_OFFLINE mode and a subse-
quent BusOff event occurs, CanIf does not prohibit execution of the BusOff notifica-
tion <User_ControllerBusOff>(ControllerId).c()
The wake-up notification is not affected concerning PDU channel mode changes.
7.19.2.2 CANIF_ONLINE
7.19.2.3 CANIF_OFFLINE_ACTIVE
The configuration tool handles the information about hardware acceptance filter set-
tings. The most important settings are the number of the L-PDU hardware objects
and their range. The outlet range defines, which Receive L-PDUs belongs to each
Hardware Receive Object. The following definitions are possible:
• a single Receive L-PDU (FullCAN reception),
• a list of Receive L-PDUs or
• one or multiple ranges of Receive L-PDUs can be linked to a Hardware Re-
ceive Object (BasicCAN reception).
For definition of range reception it is necessary to define at least one Rx L-PDU where
the CanId or the complete ID range is inside the defined range.
[SWS_CANIF_00645] dA range of CanIds which shall pass the software receive filter
shall either be defined by its upper limit (see CanIfHrhRangeRxPduUpperCanId)
and lower limit (see CanIfHrhRangeRxPduLowerCanId) CanId, or by a base ID
(see CanIfHrhRangeBaseId) and a mask that defines the relevant bits of the base
ID (see CanIfHrhRangeMask).c()
Note: Software receive filtering is optional (see multiplicity of 0..∗ in Can-
IfHrhRangeCfg).
[SWS_CANIF_00646] dEach configurable range of CanIds
(see [SWS_CANIF_00645]), which shall pass the software receive filter, shall
be configurable either for Standard CAN IDs or Extended CAN IDs via Can-
IfHrhRangeRxPduRangeCanIdType.c()
Receive L-PDUs are provided as constant structures statically generated from the
communication matrix. They are arranged according to the corresponding hardware
acceptance filter, so that there is one single list of receive CanIds for every Hardware
Receive Object (HRH). The corresponding list can be derived by the HRH, if multiple
BasicCAN objects are used. The subsequent filtering is the search through one list of
multiple CanIds by comparing them with the new received CanId. In case of a hit the
Receive L-PDU is derived from the found CanId.
[SWS_CANIF_00030] dIf the CanId of the received L-PDU in the HRH is configured to
be received, then CanIf shall accept this L-PDU and the software filtering algorithm
shall derive the corresponding Receive L-PDU from the found CanId.c(SRS_Can_-
01018)
assigned statically at configuration time. The task of the L-SDU dispatcher inside of
CanIf is to find out the customer for a received L-SDU and to dispatch the indica-
tions towards the found upper layer. These transmit confirmation as well as receive
indication notification services may exist several times with different names defined in
the notified upper layer modules. Those notification services are statically configured,
depending on the layers that have to be served.
Each Transmit L-PDU enables CanIf to derive the corresponding CAN Con-
troller and implicitly CanDrv serving the affected Hardware Unit. Resolving of
these dependencies is possible because of the construction of the CAN Controller
Handle: it combines CanDrv Handle and the corresponding CAN Controller in the
Hardware Unit.
At configuration time a CAN Controller Handle will be mapped to each CAN Con-
troller. The sequence diagram Figure 7.10 below demonstrates two transmit re-
quests directed to different CanDrvs. CanIf needs only to select the corresponding
CanDrv in order to call the correct API service.
Note: Figure 7.10 and the following table serve only as an example. Finally, it is up to
the implementation to access the correct APIs of underlying CanDrvs.
CanIf User «mod... Can_99_Ext1: «Peripheral» Can_99_Ext2: «Peripheral»
CanIf Can CanController A: Can CanController B:
CanController CanController
Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
Copy L-PDU in CAN
Hardware A()
Can_Write()
CanIf_Transmit()
Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
Copy L-PDU in CAN
Hardware B()
CanIf_Transmit()
Even if multiple CanDrvs are used in a single ECU Every notification callback service
invoked by CanDrvs at the CanIf exists only once. This means, that CanIf has to
identify calling CanDrv using the passed parameters. CanIf identifies the calling
CanDrv from the ControllerId within the Mailbox (Can_HwType) structure.
Receive
Interrupt()
CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)
Received L-PDU
validation check (SW
Filtering, Data Length
<User_RxIndication>(PduIdType, Check)
const PduInfoType*)
Copy
Data()
Copy
Data()
<User_RxIndication>()
CanIf_RxIndication()
Receive
Interrupt()
Receive
Interrupt()
CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)
Copy
data()
<User_RxIndication>()
CanIf_RxIndication()
Receive
Interrupt()
c(RS_Ids_00810)
[SWS_CANIF_00913] dIf security event reporting has been enabled for the CanIf
module (CanIfEnableSecurityEventReporting = true) the respective security
events shall bereported to the IdsM via the interfaces defined in AUTOSAR_SWS_-
BSWGeneral.c(RS_Ids_00810)
[SWS_CANIF_00915] dIf CanIf_ErrorNotification() is called by CanDrv, the
function shall evaluate whether a Tx related error was detected. If this is the case the
CanIfshall report the security event CANIF_SEV_TX_ERROR_DETECTED.
The context data is structured as follows:
Context Data (2 Byte)
• ControllerID (1 Byte)
• CanError (1 Byte)
– CAN_ERROR_BIT_MONITORING1 (0x1)
– CAN_ERROR_BIT_MONITORING0 (0x2)
– CAN_ERROR_BIT (0x3)
– CAN_ERROR_CHECK_ACK_FAILED (0x4)
– CAN_ERROR_ACK_DELIMITER (0x5)
– CAN_ERROR_ARBITRATION_LOST (0x6)
– CAN_ERROR_OVERLOAD (0x7)
c(RS_Ids_00810)
[SWS_CANIF_00916] dIf CanIf_ErrorNotification() is called by CanDrv, the
function shall evaluate whether a Rx related error was detected. If this is the case the
CanIf shall report the security event CANIF_SEV_RX_ERROR_DETECTED.
The context data is structured as follows:
Context Data (2 Byte)
• ControllerID (1 Byte)
• CanError (1 Byte)
– CAN_ERROR_CHECK_FORM_FAILED (0x8)
– CAN_ERROR_CHECK_STUFFING_FAILED (0x9)
– CAN_ERROR_CHECK_CRC_FAILED (0xA)
– CAN_ERROR_BUS_LOCK (0xB)
c(RS_Ids_00810)
[SWS_CANIF_00917] dIf CanIf_ControllerErrorStatePassive() is called by
CanDrv, the CanIf shall report the security event CANIF_SEV_ERRORSTATE_PAS-
SIVE in following cases:
• TxErrorCounter > 127 and TxErrorCounter <= 255
• RxErrorCounter > 127 and TxErrorCounter <= 255
The context data is structured as follows:
Context Data (2 Byte)
• ControllerID (1 Byte)
• ErrorCounterThreshold (1 Byte)
– TxErrorCounter > 127 AND RxErrorCounter > 127(0x0)
– TxErrorCounter > 127 AND RxErrorCounter < 127 (0x1)
– RxErrorCounter > 127 AND TxErrorCounter < 127 (0x2)
c(RS_Ids_00810)
[SWS_CANIF_00918] dIf CanIf_ControllerBusOff is called by CanDrv, the CanIf shall
report the security event CANIF_SEV_ERRORSTATE_BUSOFF. The context data is
structured as follows:
Context Data (1 Byte)
• Controller ID (1 Byte)
c(RS_Ids_00810)
[SWS_CANIF_91006] d
c()
[SWS_CANIF_91007] d
Type of error Related error code Error value
Failed Data Length Check CANIF_E_INVALID_DATA_LENGTH 61
Data Length CANIF_E_DATA_LENGTH_MISMATCH 62
Transmit requested on offline PDU channel CANIF_E_STOPPED 70
Message length was exceeding the maximum CANIF_E_TXPDU_LENGTH_EXCEEDED 90
length
c()
8 API specification
8.2.1 CanIf_ConfigType
[SWS_CANIF_00144] d
Name CanIf_ConfigType
Kind Structure
Elements implementation specific
Type –
Comment The contents of the initialization data structure are CAN interface
specific
5
4
Description 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.
Available via CanIf.h
c()
[SWS_CANIF_00523] dThe initialization data structure for a specific CanIf_Config-
Type shall include the definition of CanIf public parameters and the definition for each
L-PDU/L-SDU.c()
Note: The definition of CanIf public parameters and the definition for each L-PDU/
L-SDU are specified in chapter 10.
8.2.2 CanIf_PduModeType
[SWS_CANIF_00137] d
Name CanIf_PduModeType
Kind Enumeration
Range CANIF_OFFLINE 0x00 = 0 Transmit and receive path of the
corresponding channel are disabled => no
communication mode
CANIF_TX_OFFLINE 0x01 Transmit path of the corresponding channel is
disabled. The receive path is enabled.
CANIF_TX_OFFLINE_ 0x02 Transmit path of the corresponding channel is
ACTIVE in offline active mode (see SWS_
CANIF_00072). The receive path is enabled.
This mode requires CanIfTxOfflineActive
Support = TRUE.
CANIF_ONLINE 0x03 Transmit and receive path of the
corresponding channel are enabled => full
operation mode
Description 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.
Available via CanIf.h
c()
8.2.3 CanIf_NotifStatusType
[SWS_CANIF_00201] d
Name CanIf_NotifStatusType
Kind Enumeration
5
4
Range CANIF_TX_RX_ – The requested Rx/Tx CAN L-PDU was
NOTIFICATION successfully transmitted or received.
CANIF_NO_NOTIFICATION 0x00 No transmit or receive event occurred for the
requested L-PDU.
Description Return value of CAN L-PDU notification status.
Available via CanIf.h
c()
8.3.1 CanIf_Init
[SWS_CANIF_00001] d
Service Name CanIf_Init
Syntax void CanIf_Init (
const CanIf_ConfigType* ConfigPtr
)
8.3.2 CanIf_DeInit
[SWS_CANIF_91002] d
Service Name CanIf_DeInit
Syntax void CanIf_DeInit (
void
)
c(SRS_Can_01168, SRS_BSW_00336)
Note: General behavior and constraints on de-initialization functions are specified by
[SWS_BSW_00152], [SWS_BSW_00072], [SWS_BSW_00232], [SWS_BSW_00233].
Caveat: Caller of the CanIf_DeInit() function has to be sure there are no on-going
transmissions/receptions, nor any pending transmission confirmations.
8.3.3 CanIf_SetControllerMode
[SWS_CANIF_00003] d
Service Name CanIf_SetControllerMode
Syntax Std_ReturnType CanIf_SetControllerMode (
uint8 ControllerId,
Can_ControllerStateType ControllerMode
)
4
Available via CanIf.h
c(SRS_Can_01027)
Note: The service CanIf_SetControllerMode() initiates a transition to the re-
quested CAN controller mode ControllerMode of the CAN controller which is as-
signed by parameter ControllerId.
[SWS_CANIF_00308] dThe service CanIf_SetControllerMode() shall call
Can_SetControllerMode(Controller, Transition) for the requested CAN
controller.c()
[SWS_CANIF_00311] dIf parameter ControllerId of CanIf_SetController-
Mode() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET module,
when CanIf_SetControllerMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00774] dIf parameter ControllerMode of CanIf_SetController-
Mode() has an invalid value (not CAN_CS_STARTED, CAN_CS_SLEEP or CAN_CS_-
STOPPED), the CanIfshall report development error code CANIF_E_PARAM_CTRLMODE
to the Det_ReportError service of the DET module, when CanIf_SetCon-
trollerMode() is called.c(SRS_BSW_00323)
Note: The ID of the CAN controller is published inside the configuration description of
the CanIf.
8.3.4 CanIf_GetControllerMode
[SWS_CANIF_00229] d
Service Name CanIf_GetControllerMode
Syntax Std_ReturnType CanIf_GetControllerMode (
uint8 ControllerId,
Can_ControllerStateType* ControllerModePtr
)
4
Available via CanIf.h
c(SRS_Can_01028)
[SWS_CANIF_00313] dIf parameter ControllerId of CanIf_GetController-
Mode() has an invalid, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET, when
CanIf_GetControllerMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00656] dIf parameter ControllerModePtr of CanIf_GetCon-
trollerMode() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_POINTER to the Det_ReportError service of the DET, when
CanIf_GetControllerMode() is called.c(SRS_BSW_00323)
Note: The ID of the CAN controller module is published inside the configuration de-
scription of the CanIf.
8.3.5 CanIf_GetControllerErrorState
[SWS_CANIF_91001] d
Service Name CanIf_GetControllerErrorState
Syntax Std_ReturnType CanIf_GetControllerErrorState (
uint8 ControllerId,
Can_ErrorStateType* ErrorStatePtr
)
c(SRS_Can_01169)
[SWS_CANIF_00898] dIf parameter ControllerId of CanIf_GetCon-
trollerErrorState() has an invalid value, the CanIf shall report develop-
ment error code CANIF_E_PARAM_CONTROLLERID to the Det_ReportError
service of the DET, when CanIf_GetControllerErrorState() is called.c
(SRS_BSW_00323)
8.3.6 CanIf_Transmit
[SWS_CANIF_00005] d
Service Name CanIf_Transmit
Syntax Std_ReturnType CanIf_Transmit (
PduIdType TxPduId,
const PduInfoType* PduInfoPtr
)
c(SRS_Can_01008)
Note: The corresponding CAN Controller and HTH have to be resolved by the Tx-
PduId.
[SWS_CANIF_00317] dThe service CanIf_Transmit() shall not accept a transmit
request, if the controller mode referenced by ControllerId is different to CAN_CS_-
STARTED and the channel mode at least for the transmit path is not online or offline
active.c()
[SWS_CANIF_00318] dCanIf_Transmit() shall call Can_Write() with the hard-
ware transmit handle corresponding to the provided TxPduId and a Can_PduType
structure where:
• swPduHandle is set to the CanTxPduId used in the corresponding CanIf_-
TxConfirmation() call
• length is set to the value provided as PduInfoPtr->SduLength, possibly
reduced according to [SWS_CANIF_00894]
• id is set to the CAN ID associated with the TxPduId
• sdu is set to the pointer provided as PduInfoPtr->SduDataPtr
c()
Note: PduInfoPtr is a pointer to a L-SDU user memory, CAN Identifier, L-SDU han-
dle and Data Length (see [1, Specification of CAN Driver]).
[SWS_CANIF_00243] dCanIf shall set the two most significant bits (’IDentifier Ex-
tension flag’ (see [12, ISO 11898-1:2015]) and ’CAN FD flag’) of the CanId (
PduInfoPtr->id) before CanIf passes the predefined CanId to CanDrv at call
of Can_Write() (see [1, Specification of CAN Driver], definition of Can_IdType
[SWS_Can_00416]). The CanId format type of each CAN L-PDU can be configured
by CanIfTxPduCanIdType, refer to CanIfTxPduCanIdType.c(SRS_Can_01141)
[SWS_CANIF_00882] dCanIf_Transmit() shall accept a NULL pointer as PduIn-
foPtr->SduDataPtr, if the PDU is configured for triggered transmission: CanIfTx-
PduTriggerTransmit = TRUE.c()
[SWS_CANIF_00162] dIf the call of Can_Write() returns E_OK the transmit request
service CanIf_Transmit() shall return E_OK.c()
Note: If the call of Can_Write() returns E_NOT_OK, then the transmit request service
CanIf_Transmit() shall return E_NOT_OK. If the transmit request service CanIf_-
Transmit() returns E_NOT_OK, then the upper layer module is responsible to repeat
the transmit request.
[SWS_CANIF_00319] dIf parameter TxPduId of CanIf_Transmit() has an invalid
value, CanIf shall report development error code CANIF_E_INVALID_TXPDUID to
the Det_ReportError service of the DET, when CanIf_Transmit() is called.c
(SRS_BSW_00323)
[SWS_CANIF_00320] dIf parameter PduInfoPtr of CanIf_Transmit() has an in-
valid value, CanIf shall report development error code CANIF_E_PARAM_POINTER to
the Det_ReportError service of the DET module, when CanIf_Transmit() is
called.c(SRS_BSW_00323)
[SWS_CANIF_00893] dWhen CanIf_Transmit() is called with PduInfoPtr->Sd-
uLength exceeding the maximum length of the PDU referenced by TxPduId:
• SduLength > 8 if the Can_IdType indicates a classic CAN frame
• SduLength > 64 if the Can_IdType indicates a CAN FD frame
CanIf shall report runtime error code CANIF_E_DATA_LENGTH_MISMATCH to the
Det_ReportRuntimeError() service of the DET.c()
Note: Besides static configured transmissions there are dynamic transmissions, too.
Therefore, the valid data length is always passed by PduInfoPtr->SduLength.
Furthermore, even the frame type might change via CanIf_SetDynamicTxId().
[SWS_CANIF_00893] ensures that not matching transmit requests can be detected
via DET.
8.3.7 CanIf_ReadRxPduData
[SWS_CANIF_00194] d
Service Name CanIf_ReadRxPduData
Syntax Std_ReturnType CanIf_ReadRxPduData (
PduIdType CanIfRxSduId,
PduInfoType* CanIfRxInfoPtr
)
c(SRS_Can_01125, SRS_Can_01129)
[SWS_CANIF_00324] dThe function CanIf_ReadRxPduData() shall not accept a
request and return E_NOT_OK, if the corresponding controller mode refrenced by Con-
trollerId is different to CAN_CS_STARTED and the channel mode is in the receive
path online.c()
8.3.8 CanIf_ReadTxNotifStatus
[SWS_CANIF_00202] d
Service Name CanIf_ReadTxNotifStatus
Syntax CanIf_NotifStatusType CanIf_ReadTxNotifStatus (
PduIdType CanIfTxSduId
)
c(SRS_Can_01130)
Note: This function notifies the upper layer about any transmit confirmation event to
the corresponding requested L-SDU.
8.3.9 CanIf_ReadRxNotifStatus
[SWS_CANIF_00230] d
Service Name CanIf_ReadRxNotifStatus
Syntax CanIf_NotifStatusType CanIf_ReadRxNotifStatus (
PduIdType CanIfRxSduId
)
c(SRS_Can_01130, SRS_Can_01131)
Note: This function notifies the upper layer about any receive indication event to the
corresponding requested L-SDU.
[SWS_CANIF_00394] dIf configuration parameters CanIfPublicReadRxPduNoti-
fyStatusApi and CanIfRxPduReadNotifyStatus are set to TRUE, and if
CanIf_ReadRxNotifStatus() is called, then CanIf shall reset the notification sta-
tus for the received L-SDU.c()
[SWS_CANIF_00336] dIf parameter CanIfRxSduId of CanIf_ReadRxNotifSta-
tus() is out of range or if status for CanRxPduId was requested whereas CanIfRx-
PduReadData is disabled or if no status information was configured for this CAN Rx
8.3.10 CanIf_SetPduMode
[SWS_CANIF_00008] d
Service Name CanIf_SetPduMode
Syntax Std_ReturnType CanIf_SetPduMode (
uint8 ControllerId,
CanIf_PduModeType PduModeRequest
)
c()
Note: The channel parameter denoting the predefined logical PDU channel can be
derived from parameter ControllerId of function CanIf_SetPduMode().
[SWS_CANIF_00341] dIf CanIf_SetPduMode() is called with invalid Control-
lerId, CanIf shall report development error code CANIF_E_PARAM_CONTROL-
LERID to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
[SWS_CANIF_00860] dIf CanIf_SetPduMode() is called with invalid PduMod-
eRequest, CanIf shall report development error code CANIF_E_PARAM_PDU_MODE
to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
8.3.11 CanIf_GetPduMode
[SWS_CANIF_00009] d
Service Name CanIf_GetPduMode
Syntax Std_ReturnType CanIf_GetPduMode (
uint8 ControllerId,
CanIf_PduModeType* PduModePtr
)
c()
[SWS_CANIF_00346] dIf CanIf_GetPduMode() is called with invalid Control-
lerId, CanIf shall report development error code CANIF_E_PARAM_CONTROL-
LERID to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
[SWS_CANIF_00657] dIf CanIf_GetPduMode() is called with invalid PduModePtr,
CanIf shall report development error code CANIF_E_PARAM_POINTER to the Det_-
ReportError service of the DET module.c(SRS_BSW_00323)
8.3.12 CanIf_GetVersionInfo
[SWS_CANIF_00158] d
Service Name CanIf_GetVersionInfo
Syntax void CanIf_GetVersionInfo (
Std_VersionInfoType* VersionInfo
)
5
4
Service ID [hex] 0x0b
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) VersionInfo Pointer to where to store the version information of this module.
Return value None
Description This service returns the version information of the called CAN Interface module.
Available via CanIf.h
c(SRS_BSW_00407, SRS_BSW_00411)
8.3.13 CanIf_SetDynamicTxId
[SWS_CANIF_00189] d
Service Name CanIf_SetDynamicTxId
Syntax void CanIf_SetDynamicTxId (
PduIdType CanIfTxSduId,
Can_IdType CanId
)
c()
Note: CanIf_SetDynamicTxId() may be interrupted by CanIf_Transmit()
called by several modules in the communication stack. Therefore precautions for
preventing inconsistency need to be considered.
[SWS_CANIF_00352] dIf parameter CanIfTxSduId of CanIf_SetDynamicTxId
() has an invalid value, CanIf shall report development error code CANIF_E_IN-
VALID_TXPDUID to the Det_ReportError service of the DET module, when
CanIf_SetDynamicTxId() is called.c(SRS_BSW_00323)
8.3.14 CanIf_SetTrcvMode
[SWS_CANIF_00287] d
Service Name CanIf_SetTrcvMode
Syntax Std_ReturnType CanIf_SetTrcvMode (
uint8 TransceiverId,
CanTrcv_TrcvModeType TransceiverMode
)
c()
Note: For more details, please refer to the [2, Specification of CAN Transceiver Driver].
[SWS_CANIF_00358] dThe function CanIf_SetTrcvMode() shall call the function
CanTrcv_SetOpMode(Transceiver, OpMode) on the corresponding requested
CAN Transceiver Driver module.c()
Note: The parameters of the service CanTrcv_SetOpMode() are of type:
• OpMode: CanTrcv_TrcvModeType(desired operation mode)
• Transceiver: uint8 (Transceiver to which function call has to be applied)
8.3.15 CanIf_GetTrcvMode
[SWS_CANIF_00288] d
Service Name CanIf_GetTrcvMode
Syntax Std_ReturnType CanIf_GetTrcvMode (
uint8 TransceiverId,
CanTrcv_TrcvModeType* TransceiverModePtr
)
4
Parameters (out) TransceiverModePtr Requested mode of requested network the Transceiver is
connected to.
Return value Std_ReturnType E_OK: Transceiver mode request has been accepted.
E_NOT_OK: Transceiver mode request has not been accepted.
Description This function invokes CanTrcv_GetOpMode and updates the parameter TransceiverModePtr
with the value OpMode provided by CanTrcv.
Available via CanIf.h
c()
Note: For more details, please refer to the [2, Specification of CAN Transceiver Driver].
[SWS_CANIF_00363] dThe function CanIf_GetTrcvMode() shall call the function
CanTrcv_GetOpMode(Transceiver, OpMode) on the corresponding requested
CAN Transceiver Driver module.c()
Note: The parameters of the function CanTrcv_GetOpMode are of type:
• OpMode: CanTrcv_TrcvModeType (desired operation mode)
• Transceiver: uint8 (Transceiver to which API call has to be applied)
(see [2, Specification of CAN Transceiver Driver])
[SWS_CANIF_00364] dIf parameter TransceiverId of CanIf_GetTrcvMode()
has an invalid value, the CanIf shall report development error code CANIF_E_PARAM_-
TRCV to the Det_ReportError service of the DET module, when CanIf_GetTr-
cvMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00650] dIf parameter TransceiverModePtr of CanIf_GetTrcv-
Mode() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_POINTER to the Det_ReportError service of the DET module, when
CanIf_GetTrcvMode() was called.c(SRS_BSW_00323)
[SWS_CANIF_00367] dConfiguration of CanIf_GetTrcvMode(): The number of
supported transceiver types for each network is set up in the configuration phase (see
CanIfTrcvCfg and CanIfTrcvDrvCfg). If no transceiver is used, this function may
be omitted. Therefore, if no transceiver is configured in LT or PB class the API shall
return with E_NOT_OK.c()
8.3.16 CanIf_GetTrcvWakeupReason
[SWS_CANIF_00289] d
Service Name CanIf_GetTrcvWakeupReason
5
4
Syntax Std_ReturnType CanIf_GetTrcvWakeupReason (
uint8 TransceiverId,
CanTrcv_TrcvWakeupReasonType* TrcvWuReasonPtr
)
c()
Note: The ability to detect and differentiate the possible wake up reasons depends
strongly on the CAN transceiver hardware. For more details, please refer to the [2,
Specification of CAN Transceiver Driver].
[SWS_CANIF_00368] dThe function CanIf_GetTrcvWakeupReason() shall call
CanTrcv_GetBusWuReason(Transceiver, Reason) on the corresponding re-
quested CanTrcv.c()
Note: The parameters of the function CanTrcv_GetBusWuReason() are of type:
• Reason: CanTrcv_TrcvWakeupReasonType
• Transceiver: uint8 (Transceiver to which API call has to be applied)
(see [2, Specification of CAN Transceiver Driver])
[SWS_CANIF_00537] dIf parameter TransceiverId of CanIf_GetTrcvWake-
upReason() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module,
when CanIf_GetTrcvWakeupReason() is called.c(SRS_BSW_00323)
[SWS_CANIF_00649] dIf parameter TrcvWuReasonPtr of CanIf_GetTrcvWake-
upReason() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_POINTER to the Det_ReportError service of the DET mod-
ule, when CanIf_GetTrcvWakeupReason() is called.c(SRS_BSW_00323)
Note: Please be aware, that if more than one network is available, each network may
report a different wake-up reason. E.g. if an ECU uses CAN, a wake-up by CAN may
occur and the incoming data may cause an internal wake-up for another CAN network.
8.3.17 CanIf_SetTrcvWakeupMode
[SWS_CANIF_00290] d
Service Name CanIf_SetTrcvWakeupMode
Syntax Std_ReturnType CanIf_SetTrcvWakeupMode (
uint8 TransceiverId,
CanTrcv_TrcvWakeupModeType TrcvWakeupMode
)
c()
Note: For more details, please refer to [2, Specification of CAN Transceiver Driver].
[SWS_CANIF_00372] dThe function CanIf_SetTrcvWakeupMode() shall call
CanTrcv_SetWakeupMode(Transceiver, TrcvWakeupMode) on the corre-
sponding requested CanTrcv.c()
Info: The parameters of the function CanTrcv_SetWakeupMode() are of type:
8.3.18 CanIf_CheckWakeup
[SWS_CANIF_00219] d
c()
Note: Integration Code calls this function
[SWS_CANIF_00398] dIf parameter WakeupSource of CanIf_CheckWakeup() has
an invalid value, CanIf shall report development error code CANIF_E_PARAM_WAKE-
UPSOURCE to the Det_ReportError service of the DET, when CanIf_Check-
Wakeup() is called.c(SRS_BSW_00323)
Note: The call context of CanIf_CheckWakeup() is either on interrupt level (interrupt
mode) or on task level (polling mode).
8.3.19 CanIf_CheckValidation
[SWS_CANIF_00178] d
Service Name CanIf_CheckValidation
Syntax Std_ReturnType CanIf_CheckValidation (
EcuM_WakeupSourceType WakeupSource
)
4
Return value Std_ReturnType E_OK: Will be returned, if the check validation request has been
accepted.
E_NOT_OK: Will be returned, if the check validation request has
not been accepted.
Description This service is performed to validate a previous wakeup event.
Available via CanIf.h
c()
Note: Integration Code calls this function
[SWS_CANIF_00404] dIf parameter WakeupSource of CanIf_CheckValidation
() has an invalid value, the CanIf shall report development error code CANIF_E_-
PARAM_WAKEUPSOURCE to the Det_ReportError service of the DET module,
when CanIf_CheckValidation() is called.c(SRS_BSW_00323)
Note: The call context of CanIf_CheckValidation() is either on interrupt level
(interrupt mode) or on task level (polling mode).
Caveat: The corresponding CAN controller and transceiver must be switched
on via CanTrcv_SetOpMode(Transceiver, CANTRCV_TRCVMODE_NORMAL) and
Can_SetControllerMode(Controller, CAN_CS_STARTED) and the corre-
sponding mode indications must have been called.
[SWS_CANIF_00408] dConfiguration of CanIf_CheckValidation(): If no valida-
tion is needed, this API can be omitted by disabling of CanIfPublicWakeupCheck-
ValidSupport.c()
8.3.20 CanIf_GetTxConfirmationState
[SWS_CANIF_00734] d
Service Name CanIf_GetTxConfirmationState
Syntax CanIf_NotifStatusType CanIf_GetTxConfirmationState (
uint8 ControllerId
)
4
Available via CanIf.h
c()
[SWS_CANIF_00736] dIf parameter ControllerId of CanIf_GetTxConfirma-
tionState() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET
module, when CanIf_GetTxConfirmationState() is called.c()
Note: The call context of CanIf_GetTxConfirmationState() is on task level
(polling mode).
[SWS_CANIF_00738] dConfiguration of CanIf_GetTxConfirmationState(): If
BusOff Recovery of CanSm doesn’t need the status of the Tx confirmations
(see [SWS_CANIF_00740]), this API can be omitted by disabling of CanIfPublic-
TxConfirmPollingSupport.c()
8.3.21 CanIf_ClearTrcvWufFlag
[SWS_CANIF_00760] d
Service Name CanIf_ClearTrcvWufFlag
Syntax Std_ReturnType CanIf_ClearTrcvWufFlag (
uint8 TransceiverId
)
c()
[SWS_CANIF_00766] dWithin CanIf_ClearTrcvWufFlag() the function
CanTrcv_ClearTrcvWufFlag() shall be called.c()
[SWS_CANIF_00769] dIf parameter TransceiverId of CanIf_ClearTrcvWuf-
Flag() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_ClearTrcvWufFlag() is caled.c()
8.3.22 CanIf_CheckTrcvWakeFlag
[SWS_CANIF_00761] d
Service Name CanIf_CheckTrcvWakeFlag
Syntax Std_ReturnType CanIf_CheckTrcvWakeFlag (
uint8 TransceiverId
)
c()
[SWS_CANIF_00765] dWithin CanIf_CheckTrcvWakeFlag() the function
CanTrcv_CheckWakeFlag() shall be called.c()
[SWS_CANIF_00770] dIf parameter TransceiverId of CanIf_CheckTrcvWake-
Flag() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_CheckTrcvWakeFlag() is caled.c()
[SWS_CANIF_00813] dConfiguration of CanIf_CheckTrcvWakeFlag(): Whether
the CanIf supports this function shall be pre compile time configurable On/Off by the
configuration parameter CanIfPublicPnSupport.c()
8.3.23 CanIf_SetBaudrate
[SWS_CANIF_00867] d
Service Name CanIf_SetBaudrate
5
4
Syntax Std_ReturnType CanIf_SetBaudrate (
uint8 ControllerId,
uint16 BaudRateConfigID
)
c()
[SWS_CANIF_00868] dThe service CanIf_SetBaudrate() shall call Can_-
SetBaudrate(Controller, BaudRateConfigID) for the requested CAN Con-
troller.c()
[SWS_CANIF_00869] dIf CanIf_SetBaudrate() is called with invalid Control-
lerId, CanIf shall report development error code CANIF_E_PARAM_CONTROL-
LERID to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
Note: The parameter BaudRateConfigID of CanIf_SetBaudrate() is not
checked by CanIf. This has to be done by responsible CanDrv.
Note: The call context of CanIf_SetBaudrate() is on task level (polling mode).
[SWS_CANIF_00871] dIf CanIf supports changing baud rate and thus CanIf_Set-
Baudrate(), shall be configurable via CanIfSetBaudrateApi.c()
8.3.24 CanIf_GetControllerRxErrorCounter
[SWS_CANIF_91003] d
Service Name CanIf_GetControllerRxErrorCounter
Syntax Std_ReturnType CanIf_GetControllerRxErrorCounter (
uint8 ControllerId,
uint8* RxErrorCounterPtr
)
5
4
Service ID [hex] 0x4d
Sync/Async Synchronous
Reentrancy Non Reentrant for the same ControllerId
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller.
Parameters (inout) None
Parameters (out) RxErrorCounterPtr Pointer to a memory location, where the current Rx error counter
of the CAN controller will be stored.
Return value Std_ReturnType E_OK: Rx error counter available.
E_NOT_OK: Wrong ControllerId, or Rx error counter not
available.
Description This service calls the corresponding CAN Driver service for obtaining the Rx error counter of
the CAN controller.
Available via CanIf.h
c()
[SWS_CANIF_00907] dIf parameter ControllerId of CanIf_GetControllerRx-
ErrorCounter() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET,
when CanIf_GetControllerRxErrorCounter() is called.c(SRS_BSW_00323)
[SWS_CANIF_00908] dIf parameter RxErrorCounterPtr of CanIf_GetCon-
trollerRxErrorCounter() is a null pointer, the CanIf shall report development
error code CANIF_E_PARAM_POINTER to the Det_ReportError service of the
DET, when CanIf_GetControllerRxErrorCounter() is called.c(SRS_BSW_-
00323)
8.3.25 CanIf_GetControllerTxErrorCounter
[SWS_CANIF_91004] d
Service Name CanIf_GetControllerTxErrorCounter
Syntax Std_ReturnType CanIf_GetControllerTxErrorCounter (
uint8 ControllerId,
uint8* TxErrorCounterPtr
)
4
Description This service calls the corresponding CAN Driver service for obtaining the Tx error counter of
the CAN controller.
Available via CanIf.h
c()
[SWS_CANIF_00909] dIf parameter ControllerId of CanIf_GetControllerTx-
ErrorCounter() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET,
when CanIf_GetControllerTxErrorCounter() is called.c(SRS_BSW_00323)
[SWS_CANIF_00910] dIf parameter TxErrorCounterPtr of CanIf_GetCon-
trollerTxErrorCounter() is a null pointer, the CanIf shall report development
error code CANIF_E_PARAM_POINTER to the Det_ReportError service of the
DET, when CanIf_GetControllerTxErrorCounter() is called.c(SRS_BSW_-
00323)
8.3.26 CanIf_EnableBusMirroring
[SWS_CANIF_91005] d
Service Name CanIf_EnableBusMirroring
Syntax Std_ReturnType CanIf_EnableBusMirroring (
uint8 ControllerId,
boolean MirroringActive
)
c()
[SWS_CANIF_00911] dIf Bus Mirroring is not enabled (see CanIfBusMirroring-
Support), the API CanIf_EnableBusMirroring() can be omitted.c(SRS_Can_-
01172)
8.3.27 CanIf_GetCurrentTime
[SWS_CANIF_91014]{DRAFT} d
Service Name CanIf_GetCurrentTime (draft)
Syntax Std_ReturnType CanIf_GetCurrentTime (
uint8 Controller,
Can_TimeStampType* timeStampPtr
)
c(SRS_Can_01181)
[SWS_CANIF_00922]{DRAFT} dIf development error detection is enabled: the func-
tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00923]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter Controller for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_CONTROLLERID.c()
[SWS_CANIF_00924]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter timeStampPtr for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_POINTER.c()
[SWS_CANIF_00925]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()
8.3.28 CanIf_EnableEgressTimeStamp
[SWS_CANIF_91011]{DRAFT} d
c(SRS_Can_01181)
[SWS_CANIF_00926]{DRAFT} dIf development error detection is enabled: the func-
tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00927]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter TxPduId for being valid. If the check fails, the function
shall raise the development error CANIF_E_PARAM_LPDU.c()
[SWS_CANIF_00928]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()
8.3.29 CanIf_GetEgressTimeStamp
[SWS_CANIF_91012]{DRAFT} d
Service Name CanIf_GetEgressTimeStamp (draft)
Syntax Std_ReturnType CanIf_GetEgressTimeStamp (
PduIdType TxPduId,
Can_TimeStampType* timeStampPtr
)
4
Return value Std_ReturnType E_OK: successful
E_NOT_OK: failed
Description This service calls the corresponding CAN Driver service to read back the egress time stamp on
a dedicated message object. It needs to be called within the TxConfirmation() function.
Tags: atp.Status=draft
Available via CanIf.h
c(SRS_Can_01181)
[SWS_CANIF_00929]{DRAFT} dIf development error detection is enabled: the func-
tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00930]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter TxPduId for being valid. If the check fails, the function
shall raise the development error CANIF_E_PARAM_LPDU.c()
[SWS_CANIF_00931]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter timeStampPtr for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_POINTER.c()
[SWS_CANIF_00932]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()
8.3.30 CanIf_GetIngressTimeStamp
[SWS_CANIF_91013]{DRAFT} d
Service Name CanIf_GetIngressTimeStamp (draft)
Syntax Std_ReturnType CanIf_GetIngressTimeStamp (
PduIdType RxPduId,
Can_TimeStampType* timeStampPtr
)
c(SRS_Can_01181)
8.4.1 CanIf_TriggerTransmit
[SWS_CANIF_00883] d
Service Name CanIf_TriggerTransmit
Syntax Std_ReturnType CanIf_TriggerTransmit (
PduIdType TxPduId,
PduInfoType* PduInfoPtr
)
c()
8.4.2 CanIf_TxConfirmation
[SWS_CANIF_00007] d
Service Name CanIf_TxConfirmation
Syntax void CanIf_TxConfirmation (
PduIdType CanTxPduId
)
c(SRS_Can_01009)
Note: The service CanIf_TxConfirmation() is implemented in CanIf and called
by the CanDrv after the CAN L-PDU has been transmitted on the CAN network.
Note: Due to the fact CanDrv does not support the HandleId concept as described
in [14, Specification of ECU Configuration]: Within the service CanIf_TxConfirma-
tion(), CanDrv uses PduInfo->swPduHandle as CanTxPduId, which was pre-
served from Can_Write(Hth, *PduInfo).
[SWS_CANIF_00391] dIf configuration parameters CanIfPublicReadTxPduNoti-
fyStatusApi and CanIfTxPduReadNotifyStatus for the Transmitted L-PDU
are set to TRUE, and if CanIf_TxConfirmation() is called, CanIf shall set the
notification status for the Transmitted L-PDU.c()
8.4.3 CanIf_RxIndication
[SWS_CANIF_00006] d
Service Name CanIf_RxIndication
Syntax void CanIf_RxIndication (
const Can_HwType* Mailbox,
const PduInfoType* PduInfoPtr
)
c()
Note: The service CanIf_RxIndication() is implemented in CanIf and called by
CanDrv after a CAN L-PDU has been received.
[SWS_CANIF_00415] dWithin the service CanIf_RxIndication() the CanIf
routes this indication to the configured upper layer target service(s).c()
[SWS_CANIF_00392] dIf configuration parameters CanIfPublicReadRxPduNoti-
fyStatusApi and CanIfRxPduReadNotifyStatus for the Received L-PDU are
set to TRUE, and if CanIf_RxIndication() is called, the CanIf shall set the notifi-
cation status for the Received L-PDU.c()
[SWS_CANIF_00416] dIf parameter Mailbox->Hoh of CanIf_RxIndication()
has an invalid value, CanIf shall report development error code CANIF_E_PARAM_-
HOH to the Det_ReportError service of the DET module, when CanIf_RxIndica-
tion() is called.c(SRS_BSW_00323)
[SWS_CANIF_00417] dIf parameter Mailbox->CanId of CanIf_RxIndication()
has an invalid value, CanIf shall report development error code CANIF_E_PARAM_-
CANID to the Det_ReportError service of the DET module, when CanIf_RxIndi-
cation() is called.c(SRS_BSW_00323)
Note: If CanIf_RxIndication() is called with invalid PduInfoPtr->
SduLength, runtime error CANIF_E_INVALID_DATA_LENGTH is reported
(see [SWS_CANIF_00168]).
[SWS_CANIF_00419] dIf parameter PduInfoPtr or Mailbox of CanIf_RxIndi-
cation() has an invalid value, CanIf shall report development error code CANIF_-
E_PARAM_POINTER to the Det_ReportError service of the DET module, when
CanIf_RxIndication() is called.c(SRS_BSW_00323)
[SWS_CANIF_00421] dIf CanIf was not initialized before calling CanIf_RxIndica-
tion(), CanIf shall not execute Rx indication handling, when CanIf_RxIndica-
tion(), is called.c()
Note: The call context of CanIf_RxIndication() is either on interrupt level (inter-
rupt mode) or on task level (polling mode).
[SWS_CANIF_00423] dConfiguration of CanIf_RxIndication(): Each Rx L-PDU
(see CanIfRxPduCfg) has to be configured with a corresponding receive indica-
tion service of an upper layer module (see [SWS_CANIF_00012]) which is called in
CanIf_RxIndication().c()
8.4.4 CanIf_ControllerBusOff
[SWS_CANIF_00218] d
Service Name CanIf_ControllerBusOff
Syntax void CanIf_ControllerBusOff (
uint8 ControllerId
)
4
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a Controller BusOff event referring to the corresponding CAN Controller
with the abstract CanIf ControllerId.
Available via CanIf_Can.h
c()
Note: The callback service CanIf_ControllerBusOff() is called by CanDrv and
implemented in CanIf. It is called in case of a mode change notification of the CanDrv.
[SWS_CANIF_00429] dIf parameter ControllerId of CanIf_ControllerBusOff
() has an invalid value, CanIf shall report development error code CANIF_E_-
PARAM_CONTROLLERID to the Det_ReportError service of the DET module, when
CanIf_ControllerBusOff() is called.c(SRS_BSW_00323)
[SWS_CANIF_00431] dIf CanIf was not initialized before calling CanIf_Con-
trollerBusOff(), CanIf shall not execute BusOff notification, when CanIf_Con-
trollerBusOff(), is called.c()
Note: The call context of CanIf_ControllerBusOff() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00433] dConfiguration of CanIf_ControllerBusOff(): ID of the
CAN Controller is published inside the configuration description of the CanIf (see
CanIfCtrlCfg).c()
Note: This service always has to be available, so there does not exist an appropriate
configuration parameter.
8.4.5 CanIf_ConfirmPnAvailability
[SWS_CANIF_00815] d
Service Name CanIf_ConfirmPnAvailability
Syntax void CanIf_ConfirmPnAvailability (
uint8 TransceiverId
)
4
Return value None
Description This service indicates that the transceiver is running in PN communication mode referring to the
corresponding CAN transceiver with the abstract CanIf TransceiverId.
Available via CanIf_CanTrcv.h
c()
[SWS_CANIF_00753] dIf CanIf_ConfirmPnAvailability() is called, CanIf
calls <User_ConfirmPnAvailability>().c()
Note: CanIf passes the delivered parameter TransceiverId to the upper layer mod-
ule.
[SWS_CANIF_00816] dIf parameter TransceiverId of CanIf_ConfirmPnAvail-
ability() has an invalid value, CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_ConfirmPnAvailability() is called.c()
[SWS_CANIF_00817] dIf CanIf was not initialized before calling CanIf_ConfirmP-
nAvailability(), CanIf shall not execute notification, when CanIf_ConfirmP-
nAvailability() is called.c()
Note: The call context of CanIf_ConfirmPnAvailability() is either on interrupt
level (interrupt mode) or on task level (polling mode).
[SWS_CANIF_00754] dConfiguration of CanIf_ConfirmPnAvailability(): This
function shall be pre compile time configurable ON/OFF by the configuration parameter
CanIfPublicPnSupport.c()
8.4.6 CanIf_ClearTrcvWufFlagIndication
[SWS_CANIF_00762] d
Service Name CanIf_ClearTrcvWufFlagIndication
Syntax void CanIf_ClearTrcvWufFlagIndication (
uint8 TransceiverId
)
4
Description This service indicates that the transceiver has cleared the WufFlag referring to the
corresponding CAN transceiver with the abstract CanIf TransceiverId.
Available via CanIf_CanTrcv.h
c()
[SWS_CANIF_00757] dIf CanIf_ClearTrcvWufFlagIndication() is called,
CanIf calls <User_ClearTrcvWufFlagIndication>().c()
Note: CanIf passes the delivered parameter TransceiverId to the upper layer mod-
ule.
[SWS_CANIF_00805] dIf parameter TransceiverId of CanIf_ClearTrcvWuf-
FlagIndication() has an invalid value, CanIf shall report development error code
CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_ClearTrcvWufFlagIndication() is called.c()
[SWS_CANIF_00806] dIf CanIf was not initialized before calling CanIf_ClearTr-
cvWufFlagIndication(), CanIf shall not execute notification, when CanIf_-
ClearTrcvWufFlagIndication() is called.c()
Note: The call context of CanIf_ClearTrcvWufFlagIndication() is either on
interrupt level (interrupt mode) or on task level (polling mode).
[SWS_CANIF_00808] dConfiguration of CanIf_ClearTrcvWufFlagIndication
(): This function shall be pre compile time configurable ON/OFF by the configuration
parameter CanIfPublicPnSupport.c()
8.4.7 CanIf_CheckTrcvWakeFlagIndication
[SWS_CANIF_00763] d
Service Name CanIf_CheckTrcvWakeFlagIndication
Syntax void CanIf_CheckTrcvWakeFlagIndication (
uint8 TransceiverId
)
4
Description 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.
Available via CanIf_CanTrcv.h
c()
[SWS_CANIF_00759] dIf CanIf_CheckTrcvWakeFlagIndication() is called,
CanIf calls <User_CheckTrcvWakeFlagIndication>().c()
Note: CanIf passes the delivered parameter TransceiverId to the upper layer mod-
ule.
[SWS_CANIF_00809] dIf parameter TransceiverId of CanIf_CheckTrcvWake-
FlagIndication() has an invalid value, CanIf shall report development error code
CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_CheckTrcvWakeFlagIndication() is called.c()
[SWS_CANIF_00810] dIf the CanIf was not initialized before calling CanIf_Check-
TrcvWakeFlagIndication(), CanIf shall not execute notification, when CanIf_-
CheckTrcvWakeFlagIndication() is called.c()
Note: The call context of CanIf_CheckTrcvWakeFlagIndication() is either on
interrupt level (interrupt mode) or on task level (polling mode).
[SWS_CANIF_00812] dConfiguration of CanIf_CheckTrcvWakeFlagIndication
(): This function shall be pre compile time configurable ON/OFF by the configuration
parameter CanIfPublicPnSupport.c()
8.4.8 CanIf_ControllerModeIndication
[SWS_CANIF_00699] d
Service Name CanIf_ControllerModeIndication
Syntax void CanIf_ControllerModeIndication (
uint8 ControllerId,
Can_ControllerStateType ControllerMode
)
4
Return value None
Description This service indicates a controller state transition referring to the corresponding CAN controller
with the abstract CanIf ControllerId.
Available via CanIf_Can.h
c()
Note: The callback service CanIf_ControllerModeIndication() is called by
CanDrv and implemented in CanIf. It is called in case of a state transition notification
of the CanDrv.
[SWS_CANIF_00700] dIf parameter ControllerId of CanIf_ControllerMod-
eIndication() has an invalid value, CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET
module, when CanIf_ControllerModeIndication() is called.c()
[SWS_CANIF_00702] dIf CanIf was not initialized before calling CanIf_Con-
trollerModeIndication(), CanIf shall not execute state transition notification,
when CanIf_ControllerModeIndication() is called.c()
Note: The call context of CanIf_ControllerModeIndication() is either on inter-
rupt level (interrupt mode) or on task level (polling mode).
8.4.9 CanIf_TrcvModeIndication
[SWS_CANIF_00764] d
Service Name CanIf_TrcvModeIndication
Syntax void CanIf_TrcvModeIndication (
uint8 TransceiverId,
CanTrcv_TrcvModeType TransceiverMode
)
c()
8.4.10 CanIf_ControllerErrorStatePassive
[SWS_CANIF_91008] d
Service Name CanIf_ControllerErrorStatePassive
Syntax void CanIf_ControllerErrorStatePassive (
uint8 ControllerId,
uint16 RxErrorCounter,
uint16 TxErrorCounter
)
c(RS_Ids_00810)
8.4.11 CanIf_ErrorNotification
[SWS_CANIF_91009] d
Service Name CanIf_ErrorNotification
Syntax void CanIf_ErrorNotification (
uint8 ControllerId,
Can_ErrorType Can_ErrorType
)
c(RS_Ids_00810)
[SWS_CANIF_00920] dIf parameter ControllerId of CanIf_ErrorNotifica-
tion() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET module,
when CanIf_ErrorNotification() is called.c(RS_Ids_00810)
[SWS_CANIF_00921] dIf parameter CanError of CanIf_ErrorNotification()
has an invalid value, the CanIf shall report development error code CANIF_E_-
PARAM_CAN_ERROR to the Det_ReportError service of the DET module, when
CanIf_ErrorNotification() is called.c(RS_Ids_00810)
Note: This section defines all interfaces, which are required to fulfill the core function-
ality of the module.
[SWS_CANIF_00040] d
API Function Header File Description
Can_GetControllerErrorState Can.h This service obtains the error state of the CAN
controller.
Can_GetControllerRxErrorCounter Can.h Returns the Rx error counter for a CAN controller.
This value might not be available for all CAN
controllers, in which case E_NOT_OK would be
returned.
Please note that the value of the counter might not
be correct at the moment the API returns it, because
the Rx counter is handled asynchronously in
hardware. Applications should not trust this value for
any assumption about the current bus state.
Can_GetControllerTxErrorCounter Can.h Returns the Tx error counter for a CAN controller.
This value might not be available for all CAN
controllers, in which case E_NOT_OK would be
returned.
Please note that the value of the counter might not
be correct at the moment the API returns it, because
the Tx counter is handled asynchronously in
hardware. Applications should not trust this value for
any assumption about the current bus state.
Can_SetControllerMode Can.h This function performs software triggered state
transitions of the CAN controller State machine.
Can_Write Can.h This function is called by CanIf to pass a CAN
message to CanDrv for transmission.
Det_ReportRuntimeError Det.h Service to report runtime errors. If a callout has
been configured then this callout shall be called.
SchM_Enter_CanIf_<ExclusiveArea> SchM_<Mip>.h Invokes the SchM_Enter function to enter a module
local exclusive area.
SchM_Exit_CanIf_<ExclusiveArea> SchM_<Mip>.h Invokes the SchM_Exit function to exit an exclusive
area.
c()
This section defines all interfaces, which are required to fulfill an optional functionality
of the module.
[SWS_CANIF_00294] d
4
API Function Header File Description
IdsM_SetSecurityEventWithContext IdsM.h This API is the application interface to report
Data security events with context data to the IdsM.
J1939Nm_RxIndication J1939Nm.h Indication of a received PDU from a lower layer
communication interface module.
J1939Nm_TxConfirmation J1939Nm.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
J1939Tp_RxIndication J1939Tp.h Indication of a received PDU from a lower layer
communication interface module.
J1939Tp_TxConfirmation J1939Tp.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
Mirror_ReportCanFrame Mirror.h Reports a received or transmitted CAN frame. All
received CAN frames that pass the hardware
acceptance filter are reported, independent of the
software filter configuration. Transmitted CAN
frames are reported when the transmission is
confirmed.
PduR_CanIfRxIndication PduR_CanIf.h Indication of a received PDU from a lower layer
communication interface module.
PduR_CanIfTxConfirmation PduR_CanIf.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
Xcp_CanIfRxIndication Xcp.h Indication of a received PDU from a lower layer
communication interface module.
Xcp_CanIfTxConfirmation Xcp.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
c()
In this section all interfaces are listed, where the target function of any upper layer
to be called has to be set up by configuration. These callback services are specified
and implemented in the upper communication modules, which use CanIf according to
the AUTOSAR BSW architecture. The specific callback notification is specified in the
corresponding SWS document (see chapter 3 “Related documentation”).
As far the interface name is not specified to be mandatory, no callback is performed,
if no API name is configured. This section describes only the content of notification of
the callback, the call context inside CanIf and exact time by the call event.
<User_NotificationName> - This condition is applied for such interface services
which will be implemented in the upper layer and called by CanIf. This condition
displays the symbolic name of the functional group in a callback service in the corre-
sponding upper layer module. Each upper layer module can define no, one or several
callback services for the same functionality (i.e. transmit confirmation). The dispatch
is ensured by the L-SDU ID.
The upper layer module provides the Service ID of the following functions.
8.6.3.1 <User_TriggerTransmit>
[SWS_CANIF_00886] d
Service Name <User_TriggerTransmit>
Syntax Std_ReturnType <User_TriggerTransmit> (
PduIdType TxPduId,
PduInfoType* PduInfoPtr
)
Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) TxPduId ID of the SDU that is requested to be transmitted.
Parameters (inout) PduInfoPtr Contains a pointer to a buffer (SduDataPtr) to where the SDU
data shall be copied, and the available buffer size in SduLengh.
On return, the service will indicate the length of the copied SDU
data in SduLength.
Parameters (out) None
Return value Std_ReturnType E_OK: SDU has been copied and SduLength indicates the
number of copied bytes.
E_NOT_OK: No SDU data has been copied. PduInfoPtr must not
be used since it may contain a NULL pointer or point to invalid
data.
Description 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.
Available via configurable
c()
Note: This callback service is called by CanIf and implemented in the corresponding
upper layer module. It is called in case of a Trigger Transmit request of CanDrv.
Note: The call context of <User_TriggerTransmit>() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00888] dConfiguration of <User_TriggerTransmit>(): The upper
layer module, which provides the TriggerTransmit callback service, has to be con-
figured by CanIfTxPduUserTxConfirmationUL (see CanIfTxPduUserTxCon-
firmationUL). If no upper layer modules are configured, no TriggerTransmit call-
back service is executed and therefore Trigger Transmit functionality is not supported
for that PDU.c()
[SWS_CANIF_00889] dConfiguration of <User_TriggerTransmit>(): The name
of the API <User_TriggerTransmit>() which is called by CanIf shall be con-
figured for CanIf by parameter CanIfTxPduUserTriggerTransmitName (see
CanIfTxPduUserTriggerTransmitName).c()
Note: If CanIfTxPduTriggerTransmit is not specified or FALSE, no upper layer
modules have to be configured for Trigger Transmit. Therefore, <User_Trigger-
Transmit>() will not be called and CanIfTxPduUserTxConfirmationUL as well
as CanIfTxPduUserTriggerTransmitName need not to be configured.
8.6.3.2 <User_TxConfirmation>
[SWS_CANIF_00011] d
Service Name <User_TxConfirmation>
Syntax void <User_TxConfirmation> (
PduIdType TxPduId,
Std_ReturnType result
)
Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) TxPduId ID of the PDU that has been transmitted.
result E_OK: The PDU was transmitted. E_NOT_OK: Transmission of
the PDU failed.
Parameters (inout) None
Parameters (out) None
Return value None
Description The lower layer communication interface module confirms the transmission of a PDU, or the
failure to transmit a PDU.
Available via configurable
c()
Note: This callback service is called by CanIf and implemented in the corresponding
upper layer module. It is called in case of a transmit confirmation of CanDrv.
Note: This type of confirmation callback service is mainly designed for PduR, CanNm,
and CanTp, but not exclusive.
Note: Parameter TxPduId is derived from <User> configuration.
Note: The call context of <User_TxConfirmation>() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00438] dConfiguration of <User_TxConfirmation>(): The upper
layer module, which provides this callback service, has to be configured by CanI-
fTxPduUserTxConfirmationUL. If no upper layer modules are configured for trans-
mit confirmation using <User_TxConfirmation>(), no transmit confirmation is ex-
ecuted.c()
8.6.3.3 <User_RxIndication>
[SWS_CANIF_00012] d
Service Name <User_RxIndication>
Syntax void <User_RxIndication> (
PduIdType RxPduId,
const PduInfoType* PduInfoPtr
)
Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) RxPduId ID of the received PDU.
PduInfoPtr Contains the length (SduLength) of the received PDU, a pointer
to a buffer (SduDataPtr) containing the PDU, and the MetaData
related to this PDU.
Parameters (inout) None
Parameters (out) None
Return value None
Description Indication of a received PDU from a lower layer communication interface module.
Available via configurable
c(SRS_Can_01003)
Note: This service indicates a successful reception of an L-SDU to the upper layer
module after passing all filters and validation checks.
Note: This callback service is called by CanIf and implemented in the configured
upper layer module (e.g. PduR, CanNm, CanTp, etc.) if configured accordingly (see
CanIfRxPduUserRxIndicationUL).
Note: Until <User_RxIndication>() returns, CanIf will not access <PduIn-
foPtr>. The <PduInfoPtr> is only valid and can be used by upper layers, until
the indication returns. CanIf guarantees that the number of configured bytes for this
<PduInfoPtr> is valid.
Note: The call context of <User_RxIndication>() is either on interrupt level (inter-
rupt mode) or on task level (polling mode).
[SWS_CANIF_00441] dConfiguration of <User_RxIndication>(): The upper layer
module, which provides this callback service, has to be configured by CanIfRxPdu-
UserRxIndicationUL.c()
[SWS_CANIF_00552] dConfiguration of <User_RxIndication>(): The name of
the API <User_RxIndication>() which will be called by CanIf shall be configured
for CanIf by parameter CanIfRxPduUserRxIndicationName.c()
Note: If receive indications are not necessary or no upper layer modules are configured
for receive indications and thus <User_RxIndication>() shall not be called, Can-
IfRxPduUserRxIndicationUL and CanIfRxPduUserRxIndicationName need
not to be configured.
8.6.3.4 <User_ValidateWakeupEvent>
[SWS_CANIF_00532] d
Service Name <User_ValidateWakeupEvent>
Syntax void <User_ValidateWakeupEvent> (
EcuM_WakeupSourceType sources
)
Sync/Async Synchronous
Reentrancy Non Reentrant (defined within providing upper layer module)
5
4
Parameters (in) sources Validated CAN wakeup events. Every CAN controller or CAN
transceiver can be a separate wakeup source.
Parameters (inout) None
Parameters (out) None
Return value None
Description 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.
Available via configurable
c()
Note: This callback service is mainly implemented in and used by the ECU State Man-
ager module (see [13, Specification of ECU State Manager]).
Note: The CanIf calls this callback service. It is implemented by the configured up-
per layer module. It is called only during the call of CanIf_CheckValidation() if
a first CAN L-PDU reception event after a wake up event has been occurred at the
corresponding CAN Controller.
Note: The call context of <User_ValidateWakeupEvent>() is either on interrupt
level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_ValidateWakeupEvent>() is in general re-
entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00659] dConfiguration of <User_ValidateWakeupEvent>(): If no
validation is needed, this API can be omitted by disabling CanIfPublicWake-
upCheckValidSupport.c()
[SWS_CANIF_00456] dConfiguration of <User_ValidateWakeupEvent>(): The
upper layer module which provides this callback service has to be configured by Can-
IfDispatchUserValidateWakeupEventUL, but:
• If no upper layer modules are configured for wake up notification using <User_-
ValidateWakeupEvent>(), no wake up notification needs to be configured.
CanIfDispatchUserValidateWakeupEventUL needs not to be configured.
• If wake up is not supported (CanIfCtrlWakeupSupport and CanIfTr-
cvWakeupSupport equal FALSE, CanIfDispatchUserValidateWakeu-
pEventUL is not configurable.
c()
[SWS_CANIF_00563] dConfiguration of <User_ValidateWakeupEvent>(): If
CanIfDispatchUserValidateWakeupEventUL is set to ECUM, CanIfDis-
patchUserValidateWakeupEventName must be EcuM_ValidateWakeu-
pEvent.c()
[SWS_CANIF_00564] dConfiguration of <User_ValidateWakeupEvent>(): If
CanIfDispatchUserValidateWakeupEventUL is set to CDD the name of the API
8.6.3.5 <User_ControllerBusOff>
[SWS_CANIF_00014] d
Service Name <User_ControllerBusOff>
Syntax void <User_ControllerBusOff> (
uint8 ControllerId
)
Sync/Async Synchronous
Reentrancy Non Reentrant (defined within providing upper layer module)
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, at which a BusOff occurred.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a bus-off event to the corresponding upper layer module (mainly the CAN
State Manager module).
Available via configurable
c(SRS_Can_01029)
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: This callback service is called by CanIf and implemented by the configured up-
per layer module. It is called in case of a BusOff notification via CanIf_Controller-
BusOff() of the CanDrv. The delivered parameter ControllerId of the service
CanIf_ControllerBusOff() is passed to the upper layer module.
Note: The call context of <User_ControllerBusOff>() is either on interrupt level
(interrupt mode) or on task level (polling mode).
Note: The callback service <User_ControllerBusOff>() is in general re-entrant
for multiple CAN Controller usage, but not for the same CAN Controller.
Note: Before re-initialization/restart during BusOff recovery is executed <User_Con-
trollerBusOff>() is performed only once in case of multiple BusOff events at CAN
Controller.
Configuration of <User_ControllerBusOff>()
8.6.3.6 <User_ConfirmPnAvailability>
[SWS_CANIF_00821] d
Service Name <User_ConfirmPnAvailability>
Syntax void <User_ConfirmPnAvailability> (
uint8 TransceiverId
)
Sync/Async Synchronous
Reentrancy Non Reentrant (defined within providing upper layer module)
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to a CAN
transceiver, which was checked for PN availability.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates that the CAN transceiver is running in PN communication mode.
Available via configurable
c()
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The call context of <User_ConfirmPnAvailability>() is either on interrupt
level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_ConfirmPnAvailability>() is in general re-
entrant for multiple CAN Controller usage, but not for the same CAN Controller
8.6.3.7 <User_ClearTrcvWufFlagIndication>
[SWS_CANIF_00788] d
Service Name <User_ClearTrcvWufFlagIndication>
Syntax void <User_ClearTrcvWufFlagIndication> (
uint8 TransceiverId
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, for which this function was called.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates that the CAN transceiver has cleared the WufFlag. This function is called
in CanIf_ClearTrcvWufFlagIndication.
Available via configurable
c()
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
8.6.3.8 <User_CheckTrcvWakeFlagIndication>
[SWS_CANIF_00814] d
Service Name <User_CheckTrcvWakeFlagIndication>
Syntax void <User_CheckTrcvWakeFlagIndication> (
uint8 TransceiverId
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, for which this function was called.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates that the wake up flag in the CAN transceiver is set. This function is called
in CanIf_CheckTrcvWakeFlagIndication.
Available via configurable
c()
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The call context of <User_CheckTrcvWakeFlagIndication>() is either on
interrupt level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_CheckTrcvWakeFlagIndication>() is in gen-
eral re-entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00800] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): The upper layer module, which is called (see [SWS_CANIF_00759]), has
to be configurable by CanIfDispatchUserCheckTrcvWakeFlagIndicationUL if
CanIfPublicPnSupport equals True.c()
[SWS_CANIF_00801] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): The name of <User_CheckTrcvWakeFlagIndication>() shall be con-
figurable by CanIfDispatchUserCheckTrcvWakeFlagIndicationName if Can-
IfPublicPnSupport equals True.c()
[SWS_CANIF_00802] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): It shall be configurable by CanIfPublicPnSupport, if CanIf supports
this service (False: not supported, True: supported)c()
[SWS_CANIF_00803] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): If CanIfDispatchUserCheckTrcvWakeFlagIndicationUL is set to
CAN_SM, CanIfDispatchUserCheckTrcvWakeFlagIndicationName must be
CanSM_CheckTransceiverWakeFlagIndication.c()
[SWS_CANIF_00804] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): If CanIfDispatchUserCheckTrcvWakeFlagIndicationUL is set to
CDD, the name of the service has to be configurable via parameter CanIfDis-
patchUserCheckTrcvWakeFlagIndicationName.c()
8.6.3.9 <User_ControllerModeIndication>
[SWS_CANIF_00687] d
Service Name <User_ControllerModeIndication>
Syntax void <User_ControllerModeIndication> (
uint8 ControllerId,
Can_ControllerStateType ControllerMode
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, at which a controller state transition occurred.
5
4
ControllerMode Notified CAN controller mode
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a CAN controller state transition to the corresponding upper layer module
(mainly the CAN State Manager module).
Available via configurable
c()
Note: The upper layer module provides the Service ID.
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The CanIf calls this callback service. It is implemented by the configured up-
per layer module. It is called in case of a state transition notification via CanIf_-
ControllerModeIndication() of the CanDrv. The delivered parameter Con-
trollerId of the service CanIf_ControllerModeIndication() is passed to
the upper layer module. The delivered parameter ControllerMode of the service
CanIf_ControllerModeIndication() is mapped to the appropriate parameter
ControllerMode of <User_ControllerModeIndication>().
Note: For different upper layer users different service names shall be used.
Note: The call context of <User_ControllerModeIndication>() is on task level
(polling mode).
Note: The callback service <User_ControllerModeIndication>() is in general
re-entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00689] dConfiguration of <User_ControllerModeIndication>()
: The upper layer module which provides this callback service has to be configured by
CanIfDispatchUserCtrlModeIndicationUL.c()
[SWS_CANIF_00690] dConfiguration of <User_ControllerModeIndication>()
: The name of <User_ControllerModeIndication>() which is called by CanIf
shall be configured for CanIf by parameter CanIfDispatchUserCtrlModeIndi-
cationName. This is only necessary if state transition notifications are configured via
CanIfDispatchUserCtrlModeIndicationUL.c()
[SWS_CANIF_00691] dConfiguration of <User_ControllerModeIndication>()
: If CanIfDispatchUserCtrlModeIndicationUL is set to CAN_SM, CanIfDis-
patchUserCtrlModeIndicationName must be CanSM_ControllerModeIndi-
cation.c()
[SWS_CANIF_00692] dConfiguration of <User_ControllerModeIndication>()
: If CanIfDispatchUserCtrlModeIndicationUL is set to CDD the name of the
function has to be configured via parameter CanIfDispatchUserCtrlModeIndi-
cationName.c()
8.6.3.10 <User_TrcvModeIndication>
[SWS_CANIF_00693] d
Service Name <User_TrcvModeIndication>
Syntax void <User_TrcvModeIndication> (
uint8 TransceiverId,
CanTrcv_TrcvModeType TransceiverMode
)
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId which is assigned to a CAN
transceiver, at which a transceiver state transition occurred.
TransceiverMode Notified CAN transceiver mode
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a CAN transceiver state transition to the corresponding upper layer
module (mainly the CAN State Manager module).
Available via configurable
c()
Note: The upper layer module provides the Service ID.
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The CanIf calls this callback service. It is implemented by the configured upper
layer module. It is called in case of a state transition notification via CanIf_TrcvMod-
eIndication() of the CanTrcv. The delivered parameter Transceiver of the ser-
vice CanIf_TrcvModeIndication() is mapped (as configured) to the appropriate
parameter TransceiverId which will be passed to the upper layer module. The de-
livered parameter TransceiverMode of the service CanIf_TrcvModeIndication
() is mapped to the appropriate parameter TransceiverMode of <User_TrcvMod-
eIndication>().
Note: For different upper layer users different service names shall be used.
[SWS_CANIF_00694] dCaveats of <User_TrcvModeIndication>():
• The CanTrcv must be initialized after Power ON.
• The call context is either on task level (polling mode).
• This callback service is in general re-entrant for multiple CAN Transceiver us-
age, but not for the same CAN Transceiver.
c()
9 Sequence diagrams
The following sequence diagrams show the interactions between CanIf and CanDrv.
Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
Can_Write()
CanIf_Transmit()
Activity Description
Transmission request The upper layer initiates a transmit request via the service
CanIf_Transmit(). The parameter CanTxPduId identifies the
requested L-SDU. The service performs following steps:
• validation of the input parameter
• definition of the CAN Controller to be used
The second parameter *PduInfoPtr is a pointer on the structure
with transmit L-SDU related data such as SduLength and
*SduDataPtr.
Start transmission CanIf_Transmit() requests a transmission and calls the
CanDrv service Can_Write() with corresponding processing of
the HTH.
Hardware request Can_Write() writes all L-PDU data in the CAN Hardware (if it is
free) and sets the hardware request for transmission.
E_OK from Can_Write Can_Write() returns E_OK to CanIf_Transmit().
service
CAN_BUSY from Can_Write If CanDrv detects, there are no free hardware objects available, it
service returns CAN_BUSY to CanIf.
Copying into the buffer The L-PDU of the rejected transmit request will be inserted in the
transmit buffer of CanIf until the next transmit confirmation.
E_OK from CanIf CanIf_Transmit() returns E_OK to the upper layer.
Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
CanIf_Transmit()
Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
Insert L-PDU in
transmit buffer()
CanIf_Transmit()
Transmit Interrupt
()
CanIf_TxConfirmation(PduIdType)
<User_TxConfirmation>(PduIdType, Std_ReturnType)
<User_TxConfirmation>()
CanIf_TxConfirmation()
Transmit Interrupt()
Activity Description
Transmit interrupt The acknowledged CAN frame signals a successful transmission to
the receiving CAN Controller and triggers the transmit interrupt.
Confirmation to CanIf CanDrv calls the service CanIf_TxConfirmation(). The
parameter CanTxPduId specifies the L-PDU previously sent by
Can_Write().
CanDrv must store the all in HTHs pending L-PDU Ids in an array
organized per HTH to avoid new search of the L-PDU ID for call of
CanIf_TxConfirmation().
Confirmation to upper layer Calling of the corresponding upper layer confirmation service
<User_TxConfirmation>(id, E_OK). It signals a successful
L-SDU transmission to the upper layer.
BSW Scheduler
<User_TxConfirmation>(PduIdType, Std_ReturnType)
<User_TxConfirmation>()
CanIf_TxConfirmation()
Can_MainFunction_Write()
Activity Description
Cyclic Task CanDrv The service Can_MainFunction_Write() is called by the BSW
Scheduler.
Check for pending transmit Can_MainFunction_Write() checks the underlying CAN
confirmations Controller(s) about pending transmit confirmations of
previously succeeded transmit events.
Transmit Confirmation The acknowledged CAN frame signals a successful transmission
to the sending CAN Controller.
Confirmation to CanIf CanDrv calls the service CanIf_TxConfirmation(). The
parameter CanTxPduId specifies the L-PDU previously sent by
Can_Write().
CanDrv must store the all in HTHs pending L-PDU Ids in an array
organized per HTH to avoid new search of the L-PDU ID for call of
CanIf_TxConfirmation().
Confirmation to upper layer Calling of the corresponding upper layer confirmation service
<User_TxConfirmation>(id, E_OK). It signals a successful
L-SDU transmission to the upper layer.
CanIf_TxConfirmation(PduIdType)
check transmit
buffers for other
pending L-PDU()
[Buffer is empty]
<User_TxConfirmation>(PduIdType, Std_ReturnType)
<User_TxConfirmation>()
CanIf_TxConfirmation()
Transmit Confirmation Interrupt()
Activity Description
Transmit interrupt Acknowledged CAN frame signals successful transmission to
receiving CAN Controller and triggers transmit interrupt.
Confirmation to CanIf CanDrv calls service CanIf_TxConfirmation(). Parameter
CanTxPduId specifies the L-PDU previously transmitted by
Can_Write(). CanDrv must store the all in HTHs pending L-PDU
Ids in an array organized per HTH to avoid new search of the
L-PDU ID for call of CanIf_TxConfirmation().
Check of transmit buffers The transmit buffers of CanIf checked, whether a pending L-PDU
is stored or not.
Transmit request passed to In case of pending L-PDUs in the transmit buffers the highest
CanDrv priority order the latest L-PDU is requested for transmission by
Can_Write(). It signals a successful L-PDU transmission to the
upper layer. Thus Can_Write() can be called re-entrant.
Remove transmitted L-PDU The L-PDU pending for transmission is removed from the
from transmit buffers transmission buffers by CanIf.
Confirmation to the upper Calling of the corresponding upper layer confirmation service
layer <User_TxConfirmation>(id, E_OK). It signals a successful
L-SDU transmission to the upper layer.
CanIf_Transmit(Std_ReturnType,
PduIdType, const PduInfoType*)
Can_Write(Std_ReturnType,
Can_HwHandleType, const Can_PduType*)
<CanIfUser>_CanIfTriggerTransmit(Std_ReturnType,
PduIdType, PduInfoType*)
Copy L-Pdu into CAN hardware
CanIf_TriggerTransmit()
Can_Write()
CanIf_Transmit()
Activity Description
Transmission request The upper layer initiates a transmit request via the service
CanIf_Transmit(). The parameter CanTxPduId identifies the
requested L-SDU. The service performs following steps:
• validation of the input parameter
• definition of the CAN Controller to be used
The second parameter *PduInfoPtr is a pointer to the structure
with the size (SduLength) of the L-SDU to be transmitted. The
actual SDU data has not been passed by the upper layer. Hence,
the pointer *SduDataPtr points to NULL.
Start transmission CanIf_Transmit() requests a transmission and calls the
CanDrv service Can_Write() with corresponding processing of
the HTH.
Trigger transmission If the CAN hardware is free Can_Write() requests the SDU data
from CanIf by its service CanIf_TriggerTransmit() passing
the L-SDUs corresponding ID and a pointer to the CAN hardware’s
buffer. CanIf forwards the trigger transmit request to the
corresponding upper layer (CanIfUser). CanIf passes the buffer
pointer received by CanDrv. The CanIfUser finally copies the
SDU data to the buffer provided by CanIf (the CAN hardware
buffer) and returns status and number of bytes effectively written.
E_OK from Can_Write() Can_Write() returns E_OK to CanIf_Transmit().
service
CAN_BUSY from If CanDrv detects, there are no free hardware objects available, it
Can_Write() service returns CAN_BUSY to CanIf.
Queuing of transmission The Transmit Request for the L-PDU, which has been rejected
request by CanDrv, is queued by CanIf until the next transmit
confirmation.
E_OK from CanIf CanIf_Transmit() returns E_OK to the upper layer.
Receive Interrupt()
CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)
Copy Data()
[Temp. buffer not used = Data normalization not necessary] Copy Data()
Copy Data()
<User_RxIndication>()
CanIf_RxIndication()
Receive
Interrupt()
Activity Description
Receive Interrupt The CAN Controller indicates a successful reception and
triggers a receive interrupt.
Invalidation of CAN The CPU (CanDrv) get exclusive access rights to the CAN mailbox
hardware object, provide or at least to the corresponding hardware object, where new data
CPU access to CAN were received.
mailbox
Buffering, normalizing The L-PDU is normalized and is buffered in the temporary buffer
located in CanDrv. Each CanDrv owns such a temporary buffer
for every Physical Channel only if normalizing of the data is
necessary.
Indication to CanIf The reception is indicated to CanIf by calling of
CanIf_RxIndication(). The HRH specifies the CAN RAM
Hardware Object and the corresponding CAN Controller,
which contains the received L-PDU. The temporary buffer is
referenced to CanIf by PduInfoPtr->SduDataPtr.
Software Filtering The Software Filtering checks, whether the received L-PDU will be
processed on a local ECU. If not, the received L-PDU is not
indicated to upper layers. Further processing is suppressed.
Data Length Check If the L-PDU is found, the Data Length of the received L-PDU is
compared with the expected, statically configured one for the
received L-PDU.
Receive Indication to the The corresponding receive indication service of the upper layer is
upper layer called. This signals a successful reception to the target upper
layer. The parameter RxPduId specifies the L-SDU, the second
parameter is the reference on the temporary buffer within the
L-SDU.
During is execution of this service the CAN hardware buffers must
be unlocked for CPU access/locked for CAN Controller access.
Validation of CAN hardware The CAN Controller get back exclusive access rights to the
object, allow access of CAN CAN mailbox or at least to the corresponding hardware object,
Controller to CAN where new data were already being copied into the upper layer
mailbox buffer.
BSW Scheduler
CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)
<User_RxIndication>(PduIdType,
const PduInfoType*)
! "
<User_RxIndication>()
CanIf_RxIndication()
Validation of hardware
object()
Can_MainFunction_Read()
Activity Description
Cyclic Task CanDrv The service Can_MainFunction_Read() is called by the BSW
Scheduler.
Check for new received Can_MainFunction_Read() checks the underlying CAN
L-PDU Controller(s) about new received L-PDUs.
Invalidation of CAN In case of a new receive event the CPU (CanDrv) get exclusive
hardware object, provide access rights to the CAN mailbox or at least to the corresponding
CPU access to CAN hardware object, where new data were received.
mailbox
Buffering, normalizing In case of a new receive event the L-PDU is normalized and is
buffered in the temporary buffer located in CanDrv. Each CanDrv
owns such a temporary buffer for every Physical Channel only
if normalizing of the data is necessary.
Indication to CanIf The reception is indicated to CanIf by calling of
CanIf_RxIndication(). The HRH specifies the CAN RAM
Hardware Object and the corresponding CAN Controller,
which contains the received L-PDU. The temporary buffer is
referenced to CanIf by PduInfoPtr->SduDataPtr.
Software Filtering The Software Filtering checks, whether the received L-PDU will be
processed on a local ECU. If not, the received L-PDU is not
indicated to upper layers. Further processing is suppressed.
Data Length Check If the L-PDU is found, the Data Length of the received L-PDU is
compared with the expected, statically configured one for the
received L-PDU.
Receive Indication to the If configured, the corresponding receive indication service of the
upper layer upper layer is called. This signals a successful reception to the
target upper layer. The parameter RxPduId specifies the L-SDU,
the second parameter is the reference on the temporary buffer
within the L-SDU.
During is execution of this service the CAN hardware buffers must
be unlocked for CPU access/locked for CAN Controller access.
Validation of CAN hardware The CAN Controller get back exclusive access rights to the
object, allow access of CAN CAN mailbox or at least to the corresponding hardware object,
Controller to CAN where new data were already being copied into the upper layer
mailbox buffer.
Receive
Interrupt()
Invalidation of hardware
object()
Invalidation of hardware
object()
CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)
&
[L-PDU reception in BasicCAN]:
! Software filtering and L-PDU
' assignment()
Set Indication
Flag()
<User_RxIndication>(PduIdType,
const PduInfoType*)
<User_RxIndication>()
CanIf_RxIndication()
Validation of hardware
object()
Validation of hardware
object()
Receive
Interrupt()
CanIf_ReadRxNotifStatus(CanIf_NotifStatusType, PduIdType)
Read Indication
! flag()
"#$%
Reset Indication
flag()
CanIf_ReadRxNotifStatus()
CanIf_ReadRxPduData(Std_ReturnType, PduIdType,
PduInfoType**)
Activity Description
Receive Interrupt The CAN Controller indicates a successful reception and
triggers a receive interrupt.
Invalidation of CAN The CPU (CanDrv) get exclusive access rights to the CAN mailbox
hardware object, provide or at least to the corresponding hardware object, where new data
CPU access to CAN were received.
mailbox
Buffering, normalizing The L-PDU is normalized and is buffered in the temporary buffer
located in CanDrv. Each CanDrv owns such a temporary buffer
for every Physical Channel only if normalizing of the data is
necessary.
Indication to CanIf The reception is indicated to CanIf by calling of
CanIf_RxIndication(). The HRH specifies the CAN RAM
Hardware Object and the corresponding CAN Controller,
which contains the received L-PDU. The temporary buffer is
referenced to CanIf by PduInfoPtr->SduDataPtr.
Software Filtering The Software Filtering checks, whether the received L-PDU will be
processed on a local ECU. If not, the received L-PDU is not
indicated to upper layers. Further processing is suppressed.
Data Length Check If the L-PDU is found, the Data Length of the received L-PDU is
compared with the expected, statically configured one for the
received L-PDU.
Copy data The data is copied out of the CAN hardware into the receive CAN
L-PDU buffers in CanIf. During access the CAN hardware buffers
must be unlocked for CPU access/locked for CAN Controller
access.
Indication Flag Set indication status flag for the received L-PDU in CanIf.
Receive Indication to the The corresponding receive indication service of the upper layer is
upper layer called. This signals a successful reception to the target upper
layer. The parameter RxPduId specifies the L-SDU, the second
parameter is the reference on the temporary buffer within the
L-SDU.
Validation of CAN hardware The CAN Controller get back exclusive access rights to the
object, allow access of CAN CAN mailbox or at least to the corresponding hardware object,
Controller to CAN where new data were already being copied into the upper layer
mailbox buffer.
Read indication status Times later the upper layer can read the indication status by call of
CanIf_ReadRxNotifStatus(). This service can also be used
for transmit L-PDUs. Then it return the confirmation status.
Reset indication status Before CanIf_ReadRxNotifStatus() returns, the indication
status is reset.
Read received data Times later the upper layer can read the received data by call of
CanIf_ReadRxPduData().
Read CanIf Rx buffer CanIf_ReadRxPduData() reads the data from CanIf Rx buffer.
E_OK from CanIf If CanIf_ReadRxPduData() was successful, the request returns
E_OK with valid PduInfoPtr.
loop Requesting CAN controller mode consecutively. If mode changed -> CanIf_ControllerModeIndication()
Can_MainFunction_Mode()
CanIf_SetControllerMode(Std_ReturnType, uint8,
Can_ControllerStateType)
Can_SetControllerMode(Std_ReturnType, uint8,
Can_ControllerStateType)
Disable Wakeup
interrupt, if supported()
<User_ControllerModeIndication>(uint8,
Can_ControllerStateType)
<User_ControllerModeIndication>() !! "
CanIf_ControllerModeIndication()
Can_SetControllerMode returns with E_OK()
CanIf_ControllerMode returns with E_OK()
[STARTED] CanIf_ControllerModeIndication(uint8,
Can_ControllerStateType)
<User_ControllerModeIndication>(uint8,
Can_ControllerStateType)
<User_ControllerModeIndication>()
CanIf_ControllerModeIndication()
[SLEEP]
Can_SetControllerMode returns with E_NOT_OK()
CanIf_SetControllerMode returns with E_NOT_OK() " # # $ "
This sequence diagram resembles "Stop CAN network" or "Sleep CAN network".
Activity Description
Loop requesting CAN The Can_MainFunction_Mode() is triggered consecutively. It
controller mode checks the HW if a controller mode has changed. If so, it is notified
consecutively. via a function call of CanIf_ControllerModeIndication
(Controller, ControllerMode).
The upper layer requests " The upper layer calls CanIf_SetControllerMode
STARTED" mode of the (ControllerId, CAN_CS_STARTED) to request STARTED
desired CAN controller mode for the requested CAN controller.
CanDrv disables wake up This is only done in case of requesting "STARTED" mode. If "
interrupts, if supported SLEEP" mode of CAN controller is requested, here the wake up
interrupts are enabled. In case of "STOPPED", nothing happens.
CanDrv requests the CAN During function call Can_SetControllerMode(Controller,
controller to transition into Can_ControllerStateType), the CanDrv enters the request
the requested mode ( into the hardware of the CAN controller. This may mean that the
CAN_CS_STARTED). controller mode transitions directly, but it could mean that it takes a
few milliseconds until the controller changes its state. It depends
on the controllers.
The following reaction depends on the controller and its current operation mode
CAN controller was in The former request Can_SetControllerMode() returns and
STOPPED mode informs CanIf about a successful request which in turn returns the
upper layer request CanIf_SetControllerMode(). The
Can_MainFunction_Mode() detects the successful mode
transition of the CAN controller and inform the CanIf
asynchronously via CanIf_ControllerModeIndication
(Controller, CAN_CS_STARTED).
CAN controller was in During the former request Can_SetControllerMode() the
STOPPED mode and the function CanIf_ControllerModeIndication(Controller,
CAN controller transitions CAN_CS_STARTED) is called to inform the CanIf directly about the
very fast so that mode successful mode transition. When
indication is called during CanIf_ControllerModeIndication(Controller,
transition request CAN_CS_STARTED) returned, the request
Can_SetControllerMode() returns and informs CanIf about a
successful request which in turn returns the upper layer request
CanIf_SetControllerMode().
CAN controller was in During the former request Can_SetControllerMode() the
STARTED mode function CanIf_ControllerModeIndication(Controller,
CAN_CS_STARTED) is called to inform the CanIf directly about the
successful mode transition (because the mode was already
started). When CanIf_ControllerModeIndication
(Controller, CAN_CS_STARTED) returned, the request
Can_SetControllerMode() returns and informs CanIf about a
successful request which in turn returns the upper layer request
CanIf_SetControllerMode().
CAN controller was in This transition is not allowed -> E_NOT_OK.
SLEEP mode
BusOff Detection()
CanIf_ControllerBusOff(uint8)
Reset
transmit
<User_ControllerBusOff>(uint8)
queue()
<User_ControllerBusOff>()
CanIf_ControllerBusOff()
BusOff Detection()
Activity Description
BusOff detection interrupt The CAN controller signals a BusOff event.
Stop CAN controller CAN controller is set to STOPPED mode by the CAN Driver, if
necessary.
BusOff indication to CAN BusOff is notified to the CanIf by calling of
Interface CanIf_ControllerBusOff()
BusOff indication to upper BusOff is notified to the upper layer by calling of
layer (CanSM) <User_ControllerBusOff>()
loop Requesting CAN controller mode consecutively. If mode changed -> CanIf_ControllerModeIndication().
Can_MainFunction_Mode()
[STOPPED]
CanIf_ControllerBusOff(uint8)
<User_ControllerBusOff>()
CanIf_ControllerBusOff()
BusOff Detection()
Can_SetContollerMode()
CanIf_SetControllerMode()
CanIf_ControllerModeIndication(uint8,
Can_ControllerStateType)
<User_ControllerModeIndication>(uint8,
Can_ControllerStateType)
<User_ControllerModeIndication>()
CanIf_ControllerModeIndication()
Activity Description
BusOff detection interrupt The CAN controller signals a BusOff event.
Stop CAN controller CAN controller is set to STOPPED mode by the CanDrv, if
necessary
BusOff indication to CanIf BusOff is notified to the CanIf by calling of
CanIf_ControllerBusOff(). The transmit buffers inside
CanIf will be reset.
BusOff indication to upper BusOff is notified to the upper layer by calling of
layer <User_ControllerBusOff>()
Upper Layer (CanSM) After a time specified by the BusOff Recovery algorithm the
initiates BusOff Recovery Recovery process itself in initiated by
CanIf_SetControllerMode(ControllerId,
CAN_CS_STARTED).
Restart of CAN controller The driver restarts the CAN controller by call of
Can_SetControllerMode(Controller, CAN_CS_STARTED)
.
CAN controller started CanDrv informs CanIf about the successful start by calling
CanIf_ControllerModeIndication(). CanIf informs in turn
upper layers about the mode change.
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into
containers. For general information about the definition of containers and param-
eters, refer to the [9, chapter 10.1 "Introduction to configuration specification" in
SWS_BSWGeneral].
section 10.1 specifies the structure (containers) and the parameters of the CanIf.
CanIfHthCfg:
EcucParamConfContainerDef
CanIfPublicCfg:
+container EcucParamConfContainerDef CanIfInitHohCfg: +subContainer lowerMultiplicity = 0
EcucParamConfContainerDef upperMultiplicity = *
upperMultiplicity = 1
lowerMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = *
+subContainer +subContainer
CanIfInitCfg: EcucParamConfContainerDef
CanIfHrhCfg:
lowerMultiplicity = 1 EcucParamConfContainerDef
upperMultiplicity = 1 CanIfRxPduCfg:
+container EcucParamConfContainerDef lowerMultiplicity = 0
+subContainer
upperMultiplicity = *
lowerMultiplicity = 0
upperMultiplicity = *
+subContainer +subContainer
CanIfTxPduCfg:
EcucParamConfContainerDef CanIfHrhRangeCfg:
EcucParamConfContainerDef
CanIfDispatchCfg: lowerMultiplicity = 0
+container EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = *
upperMultiplicity = *
CanIfCtrlCfg: EcucParamConfContainerDef
CanIfCtrlDrvCfg:
EcucParamConfContainerDef +subContainer upperMultiplicity = *
+container
lowerMultiplicity = 1
lowerMultiplicity = 1
upperMultiplicity = *
CanIfTrcvDrvCfg: CanIfTrcvCfg:
EcucParamConfContainerDef EcucParamConfContainerDef
+container +subContainer
lowerMultiplicity = 0 lowerMultiplicity = 1
upperMultiplicity = * upperMultiplicity = *
10.1.1 CanIf
CanIf: EcucModuleDef
CanIfPublicCfg:
upperMultiplicity = 1 +container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
lowerMultiplicity = 1
CanIfPrivateCfg:
+container
EcucParamConfContainerDef
CanIfDispatchCfg:
+container EcucParamConfContainerDef
CanIfTrcvDrvCfg:
EcucParamConfContainerDef
+container
lowerMultiplicity = 0
upperMultiplicity = *
CanIfCtrlDrvCfg: CanIfCtrlCfg:
EcucParamConfContainerDef EcucParamConfContainerDef
+container +subContainer
lowerMultiplicity = 1 upperMultiplicity = *
upperMultiplicity = * lowerMultiplicity = 1
CanIfInitCfg: EcucParamConfContainerDef
CanIfInitHohCfg:
lowerMultiplicity = 1 EcucParamConfContainerDef
upperMultiplicity = 1 +subContainer
lowerMultiplicity = 0
upperMultiplicity = *
CanIfTxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
+container
CanIfRxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
CanIfBufferCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
10.1.2 CanIfPrivateCfg
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfTTGeneral 0..1 CanIfTTGeneral is specified in the SWS TTCAN
Interface and defines if and in which way TTCAN is
supported.
CanIf: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
CanIfPrivateDataLengthCheck:
CanIfPrivateCfg: +parameter EcucBooleanParamDef
EcucParamConfContainerDef
defaultValue = True
+parameter CanIfPrivateSoftwareFilterType:
EcucEnumerationParamDef
+literal +literal
LINEAR: BINARY:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
+literal +literal
TABLE: INDEX:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
CanIfFixedBuffer:
+parameter EcucBooleanParamDef
defaultValue = false
lowerMultiplicity = 1
upperMultiplicity = 1
10.1.3 CanIfPublicCfg
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
Tags:
atp.Status=draft
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU
Tags:
atp.Status=draft
Multiplicity 1
Type EcucBooleanParamDef
Default Value
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfSecurityEventRefs 0..1 Container for the references to IdsMEvent elements
representing the security events that the CanIf module
shall report to the IdsM in case the coresponding
security related event occurs (and if
CanIfEnableSecurityEventReporting is set to "true").
The standardized security events in this container can
be extended by vendor-specific security events.
Tags:
atp.Status=draft
CanIfPublicCfg: CanIfPublicReadRxPduDataApi:
+parameter
EcucParamConfContainerDef EcucBooleanParamDef
upperMultiplicity = 1 defaultValue = false
lowerMultiplicity = 1 +parameter CanIfPublicReadRxPduNotifyStatusApi:
EcucBooleanParamDef
defaultValue = False
+parameter CanIfPublicReadTxPduNotifyStatusApi:
EcucBooleanParamDef
defaultValue = False
+parameter CanIfPublicWakeupCheckValidSupport:
EcucBooleanParamDef
CanIfPublicMultipleDrvSupport:
defaultValue = False EcucBooleanParamDef
+parameter
defaultValue = True
+parameter CanIfVersionInfoApi:
EcucBooleanParamDef
CanIfDevErrorDetect:
defaultValue = false EcucBooleanParamDef
+parameter
defaultValue = false
+parameter CanIfPublicTxConfirmPollingSupport:
EcucBooleanParamDef CanIfPublicTxBuffering:
+parameter EcucBooleanParamDef
defaultValue = False
+parameter CanIfTriggerTransmitSupport:
EcucBooleanParamDef
CanIfTxOfflineActiveSupport:
defaultValue = true EcucBooleanParamDef
+parameter
defaultValue = False
CanIfSetBaudrateApi:
EcucBooleanParamDef CanIfPublicWakeupCheckValidByNM:
+parameter
defaultValue = False EcucBooleanParamDef
lowerMultiplicity = 0 defaultValue = false
upperMultiplicity = 1 lowerMultiplicity = 0
+parameter
upperMultiplicity = 1
+parameter CanIfBusMirroringSupport:
EcucBooleanParamDef CanIfPublicCddHeaderFile:
EcucStringParamDef
defaultValue = false
+parameter
minLength = 1
maxLength = 32
CanIfPublicPnSupport: lowerMultiplicity = 0
+parameter
EcucBooleanParamDef upperMultiplicity = *
defaultValue = false
+parameter CanIfWakeupSupport:
EcucBooleanParamDef
CanIfMetaDataSupport:
defaultValue = true
+parameter EcucBooleanParamDef
defaultValue = false
lowerMultiplicity = 0
upperMultiplicity = 1
+literal
CanIfPublicHandleTypeEnum: UINT8: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
+literal
UINT16: EcucEnumerationLiteralDef
+parameter CanIfEnableSecurityEventReporting:
EcucBooleanParamDef
defaultValue = false
CanIfGlobalTimeSupport:
+parameter
EcucBooleanParamDef
CanIfSecurityEventRefs:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.1.4 CanIfInitCfg
constant to CanIf_ConfigType
Multiplicity 1
Type EcucStringParamDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfBufferCfg 0..* This container contains the Txbuffer configuration.
Multiple buffers with different sizes could be configured.
If CanIfBufferSize (ECUC_CanIf_00834) equals 0, the
CanIf Tx L-PDU only refers via this CanIfBufferCfg the
corresponding CanIfHthCfg.
CanIfInitHohCfg 0..* This container contains the references to the
configuration setup of each underlying CAN Driver.
CanIfRxPduCfg 0..* This container contains the configuration (parameters)
of each receive CAN L-PDU.
CanIf: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
CanIfRxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
CanIfInitHohCfg:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
CanIfTxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
CanIfMaxBufferSize:
+parameter EcucIntegerParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
CanIfMaxTxPduCfg:
+parameter EcucIntegerParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
CanIfMaxRxPduCfg:
+parameter EcucIntegerParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.1.5 CanIfTxPduCfg
Multiplicity 0..1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This parameter shall only be configurable if
CanIfPublicPnSupport equals True.
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfTTTxFrame 0..1 CanIfTTTxFrameTriggering is specified in the SWS
Triggering TTCAN Interface and defines Frame trigger for TTCAN
transmission.
CanIfTxPduCfg: CanIfTxPduReadNotifyStatus:
+parameter
EcucParamConfContainerDef EcucBooleanParamDef Pdu:
EcucParamConfContainerDef
lowerMultiplicity = 0 defaultValue = false CanIfTxPduRef: +destination
upperMultiplicity = * EcucReferenceDef lowerMultiplicity = 0
+reference upperMultiplicity = *
+literal
CanIfTxPduUserTxConfirmationUL: CAN_TP: EcucEnumerationLiteralDef
EcucEnumerationParamDef +literal
PDUR: EcucEnumerationLiteralDef
lowerMultiplicity = 0
upperMultiplicity = 1 +literal
CAN_NM: EcucEnumerationLiteralDef
+literal
J1939TP: EcucEnumerationLiteralDef
+parameter +literal
XCP: EcucEnumerationLiteralDef
+literal
CDD: EcucEnumerationLiteralDef
+literal
J1939NM: EcucEnumerationLiteralDef
+literal
CAN_TSYN: EcucEnumerationLiteralDef
+literal
CanIfTxPduCanIdType: STANDARD_CAN: EcucEnumerationLiteralDef
EcucEnumerationParamDef +literal
+parameter EXTENDED_CAN: EcucEnumerationLiteralDef
+literal
STANDARD_FD_CAN: EcucEnumerationLiteralDef
+literal
EXTENDED_FD_CAN: EcucEnumerationLiteralDef
CanIfTxPduId: CanIfTxPduUserTxConfirmationName:
EcucIntegerParamDef EcucFunctionNameDef
+parameter
symbolicNameValue = true lowerMultiplicity = 0
min = 0 upperMultiplicity = 1
max = 4294967295 minLength = 1
+parameter maxLength = 32
+parameter CanIfTxPduTruncation:
CanIfTxPduCanIdMask:
EcucBooleanParamDef
EcucIntegerParamDef
+literal
CanIfTxPduType: DYNAMIC: EcucEnumerationLiteralDef
+parameter
EcucEnumerationParamDef
+literal
STATIC: EcucEnumerationLiteralDef
CanIfTxPduTriggerTransmit:
CanIfTxPduUserTriggerTransmitName:
EcucBooleanParamDef
+parameter EcucFunctionNameDef
defaultValue = false
lowerMultiplicity = 0
lowerMultiplicity = 0
upperMultiplicity = 1
upperMultiplicity = 1
minLength = 1
+parameter maxLength = 32
10.1.6 CanIfRxPduCfg
Range: 11 Bit For Standard CAN Identifier ... 29 Bit For Extended CAN
identifier
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
The data area size of a CAN L-PDU can have a range from 0 to 64
bytes.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 64
Default Value
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
dependency: If CanIfRxPduDataLength > 8 then
CanIfRxPduCanIdType must not be STANDARD_NO_FD_CAN or
EXTENDED_NO_FD_CAN
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfRxPduCanIdRange 0..1 Optional container that allows to map a range of CAN
Ids to one PduId.
CanIfTTRxFrame 0..1 CanIfTTRxFrameTriggering is specified in the SWS
Triggering TTCAN Interface and defines Frame trigger for TTCAN
reception.
CanIfInitCfg: EcucParamConfContainerDef
+subContainer
CanIfHrhCfg: +reference
CanIfRxPduCfg: +reference CanIfRxPduHrhIdRef: +destination EcucParamConfContainerDef
EcucParamConfContainerDef EcucReferenceDef CanIfHrhIdSymRef: EcucReferenceDef
lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = * requiresSymbolicNameValue = true
upperMultiplicity = *
CanIfRxPduReadNotifyStatus:
+parameter
EcucBooleanParamDef
defaultValue = False
+parameter
CanIfRxPduUserRxIndicationName:
EcucFunctionNameDef
Pdu:
EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = 1
+reference lowerMultiplicity = 0 minLength = 1
CanIfRxPduRef: +destination upperMultiplicity = * maxLength = 32
EcucReferenceDef
+literal
CanIfRxPduUserRxIndicationUL: CAN_TP: EcucEnumerationLiteralDef
EcucEnumerationParamDef +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
lowerMultiplicity = 0 +literal
CAN_NM: EcucEnumerationLiteralDef
+literal
J1939TP: EcucEnumerationLiteralDef
+parameter +literal
PDUR: EcucEnumerationLiteralDef
+literal
XCP: EcucEnumerationLiteralDef
+literal
J1939NM: EcucEnumerationLiteralDef
+literal
CAN_TSYN: EcucEnumerationLiteralDef
+literal
CanIfRxPduCanIdType: EXTENDED_CAN: EcucEnumerationLiteralDef
EcucEnumerationParamDef
+literal
STANDARD_CAN: EcucEnumerationLiteralDef
+literal
EXTENDED_FD_CAN: EcucEnumerationLiteralDef
+parameter
+literal
STANDARD_FD_CAN: EcucEnumerationLiteralDef
+literal
EXTENDED_NO_FD_CAN: EcucEnumerationLiteralDef
+literal
STANDARD_NO_FD_CAN: EcucEnumerationLiteralDef
+parameter
CanIfRxPduDataLengthCheck:
EcucBooleanParamDef
CanIfRxPduId:
EcucIntegerParamDef defaultValue = true
+parameter symbolicNameValue = true
upperMultiplicity = 1
lowerMultiplicity = 1
min = 0
max = 4294967295 CanIfRxPduDataLength:
+parameter EcucIntegerParamDef
min = 0
CanIfRxPduReadData: max = 64
+parameter
EcucBooleanParamDef
CanIfRxPduCanIdRange: CanIfRxPduCanIdRangeUpperCanId:
EcucParamConfContainerDef
10.1.7 CanIfRxPduCanIdRange
No Included Containers
10.1.8 CanIfDispatchCfg
Description Callback functions provided by upper layer modules of the CanIf. The
callback functions defined in this container are common to all
configured CAN Driver / CAN Transceiver Driver modules.
Configuration Parameters
Name CanIfDispatchUserCheckTrcvWakeFlagIndicationName
[ECUC_CanIf_00791]
Parent Container CanIfDispatchCfg
Description This parameter defines the name of
<User_CheckTrcvWakeFlagIndication>. If
CanIfDispatchUserCheckTrcvWakeFlagIndicationUL equals CAN_SM
the name of <User_CheckTrcvWakeFlagIndication> is fixed. If it equals
CDD, the name is selectable. If CanIfPublicPnSupport equals False,
this parameter shall not be configurable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserCheckTrcvWakeFlagIndicationUL,
CanIfPublicPnSupport
Name CanIfDispatchUserCheckTrcvWakeFlagIndicationUL
[ECUC_CanIf_00792]
Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer module to which the
CheckTrcvWakeFlagIndication from the Driver modules have to be
routed. If CanIfPublicPnSupport equals False, this parameter shall not
be configurable.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Multiplicity
Name CanIfDispatchUserClearTrcvWufFlagIndicationName
[ECUC_CanIf_00789]
Parent Container CanIfDispatchCfg
Description This parameter defines the name of
<User_ClearTrcvWufFlagIndication>. If
CanIfDispatchUserClearTrcvWufFlagIndicationUL equals CAN_SM the
name of <User_ClearTrcvWufFlagIndication> is fixed. If it equals CDD,
the name is selectable. If CanIfPublicPnSupport equals False, this
parameter shall not be configurable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserClearTrcvWufFlagIndicationUL,
CanIfPublicPnSupport
Name CanIfDispatchUserClearTrcvWufFlagIndicationUL
[ECUC_CanIf_00790]
Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer module to which the
ClearTrcvWufFlagIndication from the Driver modules have to be routed.
If CanIfPublicPnSupport equals False, this parameter shall not be
configurable.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfPublicPnSupport
No Included Containers
CanIfDispatchUserCtrlBusOffName:
CanIfDispatchCfg:
EcucFunctionNameDef
EcucParamConfContainerDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
minLength = 1 CanIfDispatchUserValidateWakeupEventName:
maxLength = 32 EcucFunctionNameDef
+parameter lowerMultiplicity = 0
upperMultiplicity = 1
minLength = 1
maxLength = 32
+literal
+parameter CanIfDispatchUserCtrlBusOffUL: CAN_SM: EcucEnumerationLiteralDef
EcucEnumerationParamDef
+literal
CDD: EcucEnumerationLiteralDef
CanIfDispatchUserValidateWakeupEventUL: +literal
+parameter EcucEnumerationParamDef ECUM: EcucEnumerationLiteralDef
lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
CanIfDispatchUserCtrlModeIndicationName:
EcucFunctionNameDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
minLength = 1 CanIfDispatchUserTrcvModeIndicationName:
maxLength = 32 EcucFunctionNameDef
lowerMultiplicity = 0
+parameter
upperMultiplicity = 1
minLength = 1
maxLength = 32
+literal
CanIfDispatchUserCtrlModeIndicationUL:
CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
lowerMultiplicity = 1 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
+literal
CanIfDispatchUserTrcvModeIndicationUL: CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
+literal
lowerMultiplicity = 0 CDD: EcucEnumerationLiteralDef
upperMultiplicity = 1
+parameter CanIfDispatchUserConfirmPnAvailabilityName:
EcucFunctionNameDef
CanIfDispatchUserClearTrcvWufFlagIndicationName:
lowerMultiplicity = 0
+parameter EcucFunctionNameDef
upperMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = 1
CanIfDispatchUserCheckTrcvWakeFlagIndicationName:
EcucFunctionNameDef
+parameter lowerMultiplicity = 0
upperMultiplicity = 1
CanIfDispatchUserClearTrcvWufFlagIndicationUL: +literal
+parameter EcucEnumerationParamDef CAN_SM: EcucEnumerationLiteralDef
lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
CanIfDispatchUserCheckTrcvWakeFlagIndicationUL: +literal
CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
+literal
CanIfDispatchUserConfirmPnAvailabilityUL: CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
10.1.9 CanIfCtrlCfg
No Included Containers
CanIf: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
CanIfCtrlDrvCfg:
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
+subContainer
CanIfCtrlId: EcucIntegerParamDef
+parameter +parameter
min = 0
max = 255
CanControllerId:
symbolicNameValue = true
EcucIntegerParamDef
upperMultiplicity = 1
lowerMultiplicity = 1
symbolicNameValue = true
min = 0
max = 255
+parameter CanIfCtrlWakeupSupport:
EcucBooleanParamDef
defaultValue = False
10.1.10 CanIfCtrlDrvCfg
This reference can be used to get any information (Ex. Driver Name,
Vendor ID) from the CAN driver.
The CAN Driver name can be derived from the ShortName of the CAN
driver module.
Multiplicity 1
Type Reference to CanGeneral
false
Post-Build Variant
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfCtrlCfg 1..* This container contains the configuration (parameters)
of an adressed CAN controller by an underlying CAN
Driver module. This container is configurable per CAN
controller.
CanIf: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
CanGeneral:
CanIfCtrlDrvCfg: +reference +destination EcucParamConfContainerDef
CanIfCtrlDrvNameRef:
EcucParamConfContainerDef
EcucReferenceDef upperMultiplicity = 1
lowerMultiplicity = 1 lowerMultiplicity = 1
upperMultiplicity = *
CanIfInitHohCfg:
EcucParamConfContainerDef
+reference CanIfCtrlDrvInitHohConfigRef: +destination
EcucReferenceDef lowerMultiplicity = 0
upperMultiplicity = *
10.1.11 CanIfTrcvDrvCfg
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfTrcvCfg 1..* This container contains the configuration (parameters) of
one addressed CAN transceiver by the underlying CAN
Transceiver Driver module. For each CAN transceiver a
seperate instance of this container has to be provided.
CanIf: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
CanIfTrcvDrvCfg:
EcucParamConfContainerDef CanIfTrcvCfg:
EcucParamConfContainerDef
lowerMultiplicity = 0 +subContainer
upperMultiplicity = * lowerMultiplicity = 1
upperMultiplicity = *
10.1.12 CanIfTrcvCfg
No Included Containers
CanIf: EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
CanIfTrcvDrvCfg:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
+subContainer
CanIfTrcvCfg: CanIfTrcvWakeupSupport:
EcucParamConfContainerDef +parameter
EcucBooleanParamDef
lowerMultiplicity = 1 defaultValue = false
upperMultiplicity = *
CanIfTrcvId: EcucIntegerParamDef
+parameter
min = 0
max = 255
symbolicNameValue = true
+reference +parameter
CanTrcvWakeupSourceRef: CanTrcvChannelId:
EcucReferenceDef EcucIntegerParamDef
10.1.13 CanIfInitHohCfg
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfHrhCfg 0..* This container contains configuration parameters for
each hardware receive object (HRH).
CanIfHthCfg 0..* This container contains parameters related to each HTH.
CanIfInitCfg: EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = 1
+subContainer
CanIfInitHohCfg: CanIfHrhCfg:
EcucParamConfContainerDef EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = * upperMultiplicity = *
CanIfHthCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
10.1.14 CanIfHthCfg
Multiplicity 1
Type Symbolic name reference to CanHardwareObject
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
No Included Containers
CanIfInitHohCfg:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
+subContainer
CanIfHthCfg: CanIfCtrlCfg:
EcucParamConfContainerDef +reference CanIfHthCanCtrlIdRef: +destination
EcucParamConfContainerDef
EcucReferenceDef
lowerMultiplicity = 0 upperMultiplicity = *
upperMultiplicity = * lowerMultiplicity = 1
+parameter +parameter
10.1.15 CanIfHrhCfg
Multiplicity 1
Type Symbolic name reference to CanHardwareObject
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfHrhRangeCfg 0..* Defines the parameters required for configurating
multiple CANID ranges for a given same HRH.
CanIfInitHohCfg:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
+subContainer CanIfCtrlCfg:
+reference CanIfHrhCanCtrlIdRef: +destination EcucParamConfContainerDef
CanIfHrhCfg:
EcucReferenceDef
EcucParamConfContainerDef upperMultiplicity = *
lowerMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = *
CanHardwareObject:
+reference CanIfHrhIdSymRef: EcucReferenceDef +destination EcucParamConfContainerDef
requiresSymbolicNameValue = true upperMultiplicity = *
lowerMultiplicity = 1
CanIfHrhSoftwareFilter:
+parameter EcucBooleanParamDef
defaultValue = True
CanIfHrhRangeCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = * +parameter
CanHandleType:
EcucEnumerationParamDef
+parameter
CanObjectId: EcucIntegerParamDef
upperMultiplicity = 1
lowerMultiplicity = 1
symbolicNameValue = true
min = 0
max = 65535
10.1.16 CanIfHrhRangeCfg
No Included Containers
CanIfHrhCfg:
EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
CanIfHrhRangeRxPduUpperCanId:
EcucIntegerParamDef
+subContainer
min = 0
CanIfHrhRangeCfg: +parameter max = 536870911
EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = *
CanIfHrhRangeRxPduLowerCanId:
EcucIntegerParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = 536870911
STANDARD:
+literal EcucEnumerationLiteralDef
CanIfHrhRangeRxPduRangeCanIdType:
EcucEnumerationParamDef
+parameter
+literal EXTENDED:
EcucEnumerationLiteralDef
CanIfHrhRangeBaseId:
EcucIntegerParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = 536870911
CanIfHrhRangeMask:
EcucIntegerParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = 536870911
10.1.17 CanIfBufferCfg
Description This container contains the Txbuffer configuration. Multiple buffers with
different sizes could be configured. If CanIfBufferSize
(ECUC_CanIf_00834) equals 0, the CanIf Tx L-PDU only refers via this
CanIfBufferCfg the corresponding CanIfHthCfg.
Post-Build Variant true
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters
No Included Containers
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = * upperMultiplicity = *
CanIfBufferSize:
+parameter EcucIntegerParamDef
min = 0
max = 255
defaultValue = 0
10.1.18 CanIfSecurityEventRefs
Tags:
atp.Status=draft
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Configuration Parameters
Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
No Included Containers
CanIfPublicCfg:
EcucParamConfContainerDef +parameter CanIfEnableSecurityEventReporting:
EcucBooleanParamDef
upperMultiplicity = 1
lowerMultiplicity = 1 defaultValue = false
+subContainer
CANIF_SEV_RX_ERROR_DETECTED:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CANIF_SEV_ERRORSTATE_PASSIVE:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
CANIF_SEV_ERRORSTATE_BUSOFF:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
(from IdsM)