Autosar Sws Busmirroring
Autosar Sws Busmirroring
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 8
3 Related Documentation 10
3.1 Input Documents & Related Standards and Norms . . . . . . . . . . . 10
3.2 Related Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Constraints and Assumptions 11
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Applicability to Car Domains . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Dependencies to Other Modules 13
5.1 File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.1 Code File Structure . . . . . . . . . . . . . . . . . . . . . . . 13
5.1.2 Header File Structure . . . . . . . . . . . . . . . . . . . . . . 13
6 Requirements Tracing 14
7 Functional Specification 19
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.2 Module Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.2.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.2.2 Timing Related Functionality . . . . . . . . . . . . . . . . . . 21
7.2.3 Selection of Active Source Buses . . . . . . . . . . . . . . . 21
7.2.4 Switching the Destination Bus . . . . . . . . . . . . . . . . . 21
7.2.5 Controlling Frame Filters . . . . . . . . . . . . . . . . . . . . 22
7.3 Access to Source Buses . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.3.1 Access to CAN . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.3.1.1 Source Bus Activation . . . . . . . . . . . . . . . . . 23
7.3.1.2 Frame Acquisition . . . . . . . . . . . . . . . . . . . 23
7.3.1.3 Frame Filters . . . . . . . . . . . . . . . . . . . . . . 24
7.3.1.4 Status Acquisition . . . . . . . . . . . . . . . . . . . 24
7.3.2 Access to LIN . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.3.2.1 Source Bus Activation . . . . . . . . . . . . . . . . . 25
7.3.2.2 Frame Acquisition . . . . . . . . . . . . . . . . . . . 25
7.3.2.3 Frame Filters . . . . . . . . . . . . . . . . . . . . . . 26
7.3.2.4 Status Acquisition . . . . . . . . . . . . . . . . . . . 26
7.3.3 Access to FlexRay . . . . . . . . . . . . . . . . . . . . . . . . 26
7.3.3.1 Source Bus Activation . . . . . . . . . . . . . . . . . 27
7.3.3.2 Frame Acquisition . . . . . . . . . . . . . . . . . . . 27
7.3.3.3 Frame Filters . . . . . . . . . . . . . . . . . . . . . . 28
7.3.3.4 Status Acquisition . . . . . . . . . . . . . . . . . . . 28
7.4 Mirroring to FlexRay, IP, and CDD . . . . . . . . . . . . . . . . . . . . . 29
7.4.1 Handling of Destination Frames . . . . . . . . . . . . . . . . 29
7.4.1.1 Creation . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.4.1.2 Queueing . . . . . . . . . . . . . . . . . . . . . . . . 31
7.4.1.3 Transmission . . . . . . . . . . . . . . . . . . . . . . 32
7.4.2 Mirroring Protocol . . . . . . . . . . . . . . . . . . . . . . . . 33
7.4.2.1 Header Layout . . . . . . . . . . . . . . . . . . . . . 33
7.4.2.1.1 ProtocolVersion . . . . . . . . . . . . . . . . . 34
7.4.2.1.2 SequenceNumber . . . . . . . . . . . . . . . . 34
7.4.2.1.3 HeaderTimestamp . . . . . . . . . . . . . . . . 35
7.4.2.1.4 DataLength . . . . . . . . . . . . . . . . . . . . 35
7.4.2.2 Data Item Layout . . . . . . . . . . . . . . . . . . . . 35
7.4.2.2.1 Timestamp . . . . . . . . . . . . . . . . . . . . 36
7.4.2.2.2 NetworkStateAvailable . . . . . . . . . . . . . 37
7.4.2.2.3 FrameIDAvailable . . . . . . . . . . . . . . . . 37
7.4.2.2.4 PayloadAvailable . . . . . . . . . . . . . . . . . 37
7.4.2.2.5 NetworkType . . . . . . . . . . . . . . . . . . . 37
7.4.2.2.6 NetworkID . . . . . . . . . . . . . . . . . . . . 38
7.4.2.2.7 NetworkState . . . . . . . . . . . . . . . . . . 38
7.4.2.2.7.1 CAN . . . . . . . . . . . . . . . . . . . . 39
7.4.2.2.7.2 LIN . . . . . . . . . . . . . . . . . . . . 39
7.4.2.2.7.3 FlexRay . . . . . . . . . . . . . . . . . . 40
7.4.2.2.8 FrameID . . . . . . . . . . . . . . . . . . . . . 42
7.4.2.2.8.1 CAN . . . . . . . . . . . . . . . . . . . . 42
7.4.2.2.8.2 LIN . . . . . . . . . . . . . . . . . . . . 42
7.4.2.2.8.3 FlexRay . . . . . . . . . . . . . . . . . . 43
7.4.2.2.9 PayloadLength . . . . . . . . . . . . . . . . . . 44
7.4.2.2.10 Payload . . . . . . . . . . . . . . . . . . . . . . 44
7.5 Mirroring to CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.5.1 Handling of Source Frames . . . . . . . . . . . . . . . . . . . 45
7.5.1.1 ID Mapping . . . . . . . . . . . . . . . . . . . . . . . 45
7.5.1.1.1 CAN . . . . . . . . . . . . . . . . . . . . . . . . 45
7.5.1.1.2 LIN . . . . . . . . . . . . . . . . . . . . . . . . 45
7.5.1.2 Queuing . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.5.1.3 Transmission . . . . . . . . . . . . . . . . . . . . . . 46
7.5.2 Creation of Status Frames . . . . . . . . . . . . . . . . . . . 47
7.5.3 Status Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.5.3.1 Status Header Layout . . . . . . . . . . . . . . . . . 48
7.5.3.1.1 ProtocolVersion . . . . . . . . . . . . . . . . . 49
7.5.3.2 Status Item Layout . . . . . . . . . . . . . . . . . . . 49
7.5.3.2.1 NetworkStateAvailable . . . . . . . . . . . . . 49
7.5.3.2.2 FrameIDAvailable . . . . . . . . . . . . . . . . 50
7.5.3.2.3 NetworkType . . . . . . . . . . . . . . . . . . . 50
7.5.3.2.4 NetworkID . . . . . . . . . . . . . . . . . . . . 50
7.5.3.2.5 NetworkState . . . . . . . . . . . . . . . . . . 50
7.5.3.2.6 FrameID . . . . . . . . . . . . . . . . . . . . . 50
7.6 Error Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.6.1 Development Errors . . . . . . . . . . . . . . . . . . . . . . . 51
10 Configuration Specification 83
10.1 Containers and Configuration Parameters . . . . . . . . . . . . . . . . 83
10.1.1 Mirror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
10.1.2 MirrorGeneral . . . . . . . . . . . . . . . . . . . . . . . . . . 83
10.1.3 MirrorConfigSet . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.1.4 MirrorSourceNetwork . . . . . . . . . . . . . . . . . . . . . . 86
10.1.5 MirrorSourceNetworkCan . . . . . . . . . . . . . . . . . . . . 86
10.1.6 MirrorSourceCanFilter . . . . . . . . . . . . . . . . . . . . . . 87
10.1.7 MirrorSourceCanFilterRange . . . . . . . . . . . . . . . . . . 88
10.1.8 MirrorSourceCanFilterMask . . . . . . . . . . . . . . . . . . . 89
10.1.9 MirrorSourceCanSingleIdMapping . . . . . . . . . . . . . . . 91
10.1.10 MirrorSourceCanMaskBasedIdMapping . . . . . . . . . . . . 91
10.1.11 MirrorSourceNetworkLin . . . . . . . . . . . . . . . . . . . . 93
10.1.12 MirrorSourceLinFilter . . . . . . . . . . . . . . . . . . . . . . 95
10.1.13 MirrorSourceLinFilterRange . . . . . . . . . . . . . . . . . . . 95
10.1.14 MirrorSourceLinFilterMask . . . . . . . . . . . . . . . . . . . 96
10.1.15 MirrorSourceLinToCanIdMapping . . . . . . . . . . . . . . . 98
10.1.16 MirrorSourceNetworkFlexRay . . . . . . . . . . . . . . . . . . 99
10.1.17 MirrorSourceFlexRayFilter . . . . . . . . . . . . . . . . . . . 100
10.1.18 MirrorDestNetwork . . . . . . . . . . . . . . . . . . . . . . . . 103
10.1.19 MirrorDestNetworkCan . . . . . . . . . . . . . . . . . . . . . 103
10.1.20 MirrorDestNetworkFlexRay . . . . . . . . . . . . . . . . . . . 105
10.1.21 MirrorDestNetworkIp . . . . . . . . . . . . . . . . . . . . . . . 107
10.1.22 MirrorDestNetworkCdd . . . . . . . . . . . . . . . . . . . . . 109
10.1.23 MirrorDestPdu . . . . . . . . . . . . . . . . . . . . . . . . . . 111
10.2 Configuration Constraints . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.2.1 CAN Destination Bus . . . . . . . . . . . . . . . . . . . . . . 113
10.2.2 FlexRay Destination Bus . . . . . . . . . . . . . . . . . . . . 113
10.2.3 Mirroring of Serialized Frames . . . . . . . . . . . . . . . . . 113
10.3 Published Information . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3 Related Documentation
[1] Glossary
AUTOSAR_TR_Glossary
[2] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[3] Requirements on Bus Mirroring
AUTOSAR_SRS_BusMirroring
[4] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral
4.1 Limitations
The Bus Mirroring module cannot be used to influence the traffic on one of the buses
configured as a source bus. To ensure this and to avoid loop-back of messages leading
to bus overload, the generation tool shall ensure that no bus is connected to the Bus
Mirroring module both as source and destination bus (see [SWS_Mirror_00001]).
The Bus Mirroring module is controlled by a diagnostic control application through the
dedicated (service) API listed in chapter 8. The control functionality is made acces-
sible to a diagnostic tester by special diagnostic services, which are handled by the
DCM and implemented by the diagnostic control application. The DCM provides the
necessary security to exclude inadvertent activation of the Bus Mirroring. The Bus
Mirroring module does not provide another control interface, and it does not receive
control messages on the destination bus.
In general, the Bus Mirroring module does not support source buses that have a larger
frame size or more additional information than the destination bus can carry, e.g. CAN-
FD to CAN, CAN to LIN, FlexRay to CAN, Ethernet to CAN, or Ethernet to FlexRay.
The Bus Mirroring module does not fragment mirrored frames.
The Bus Mirroring module will only mirror traffic that is actually received or transmitted
by the bus interface modules. For CAN this means that besides the transmitted frames
only those data frames that pass the hardware filter will be mirrored, and that remote
frames and error frames will not be mirrored. For LIN, slave-to-slave communication
will not be mirrored by a LIN master. And for FlexRay, only transmitted frames and
those received frames for which reception buffers are assigned (possibly as a FIFO)
will be mirrored.
Another limitation of the mirroring from a FlexRay source bus concerns the reported
time stamps and cycles. The Timestamp reported for a FlexRay frame contains the
time when the corresponding job list entry was executed. The actual transmission time
has to be calculated from the slot ID contained in the reported FrameID. The cycle
contained in the reported FrameID is accurate only for received frames and frames
transmitted in the static segment. For frames transmitted in the dynamic segment,
the reported cycle can be inaccurate because it can happen that a frame cannot be
transmitted in the expected cycle, it is then deferred to the next suitable cycle.
A re-serialization of received serialized frames shall not be done by the Bus Mirroring
module, because that would require too much resources. Instead, the serialized PDUs
shall be routed directly to the destination bus.
The Bus Mirroring module will also not support the forwarding from Ethernet to Ether-
net. This use case is already covered by the Port Mirroring feature of the AUTOSAR
Ethernet Switch Driver.
For details, refer to the section 5.1.6 “Code file structure” in [2, SWS BSW General].
Besides the files defined in section 5.1.7 “Header file structure” in [2, SWS BSW Gen-
eral], the Bus Mirroring module needs to include the files defined below.
[SWS_Mirror_00142] d The Bus Mirroring module shall include the header
file CanIf.h if at least one MirrorSourceNetworkCan is configured. c
(SRS_Mirror_00001)
[SWS_Mirror_00143] d The Bus Mirroring module shall include the header
file LinIf.h if at least one MirrorSourceNetworkLin is configured. c
(SRS_Mirror_00001)
[SWS_Mirror_00144] d The Bus Mirroring module shall include the header file FrIf.h
if at least one MirrorSourceNetworkFlexRay is configured. c(SRS_Mirror_00001)
[SWS_Mirror_00147] d The Bus Mirroring module shall include the header file StbM.h
if at least one MirrorDestNetworkFlexRay, MirrorDestNetworkIp, or Mir-
rorDestNetworkCdd is configured. c(SRS_Mirror_00001)
6 Requirements Tracing
The following table references the requirements specified in [3, SRS Bus Mirroring]
and [4, SRS BSW General] and links to the fulfillment of these. Please note that if col-
umn “Satisfied by” is empty for a specific requirement this means that this requirement
is not fulfilled by this document.
Requirement Description Satisfied by
[SRS_BSW_00350] All AUTOSAR Basic Software [SWS_Mirror_00004]
Modules shall allow the [SWS_Mirror_00005]
enabling/disabling of detection
and reporting of development
errors.
[SRS_BSW_00385] List possible error notifications [SWS_Mirror_00007]
[SWS_Mirror_00008]
[SRS_BSW_00406] A static status variable denoting [SWS_Mirror_00002]
if a BSW module is initialized
shall be initialized with value 0
before any APIs of the BSW
module is called
[SRS_BSW_00450] A Main function of a [SWS_Mirror_00004]
un-initialized module shall return
immediately
[SRS_BSW_00478] Timing limits of main functions [SWS_Mirror_00006]
[SRS_Mirror_00001] The source and destination [SWS_Mirror_00001]
buses shall be configurable [SWS_Mirror_00142]
[SWS_Mirror_00143]
[SWS_Mirror_00144]
[SWS_Mirror_00147]
[SWS_Mirror_CONSTR_00001]
[SWS_Mirror_CONSTR_00002]
[SWS_Mirror_CONSTR_00003]
[SWS_Mirror_CONSTR_00004]
[SRS_Mirror_00005] The [SWS_Mirror_00002]
shall provide an interface for [SWS_Mirror_00009]
module initialization [SWS_Mirror_00013]
[SWS_Mirror_00016]
[SRS_Mirror_00006] The [SWS_Mirror_00021]
shall collect incoming frames [SWS_Mirror_00029]
[SWS_Mirror_00038]
7 Functional Specification
This chapter defines the behavior of the Bus Mirroring module. The API of the module
is defined in chapter 8, while the configuration is defined in chapter 10.
7.1 Overview
The Bus Mirroring module’s task is the collection of frames from several source buses,
which are then forwarded to a destination bus. The forwarding is strictly unidirectional
to avoid message loops and to prevent intrusion scenarios.
[SWS_Mirror_00001] d The generation tool shall ensure that no ComMChannel is
referenced both from a MirrorSourceNetwork and a MirrorDestNetwork. c
(SRS_Mirror_00001)
The following figure shows how the Bus Mirroring is integrated in the AUTOSAR BSW
communication stack:
Figure 7.1: AUTOSAR BSW architecture showing the Bus Mirroring module
The following mirroring scenarios are supported by the Bus Mirroring module:
• CAN and LIN ⇒ CAN
• CAN, CAN-FD, and LIN ⇒ CAN-FD
• CAN, CAN-FD, LIN, and FlexRay ⇒ FlexRay
• CAN, CAN-FD, LIN, and FlexRay ⇒ IP
• CAN, CAN-FD, LIN, and FlexRay ⇒ Proprietary (CDD)
To avoid overloading the destination bus, the messages received on each source bus
are filtered. The filters are configured separately for each bus, either by configu-
7.2.1 Initialization
The Bus Mirroring module is initialized via Mirror_Init, and de-initialized via Mir-
ror_DeInit. Except for Mirror_GetVersionInfo and Mirror_Init, the API
functions of the Bus Mirroring module may only be called after the module has been
properly initialized.
[SWS_Mirror_00002] d A call to Mirror_Init initializes all internal variables
and sets the Bus Mirroring module to the initialized state. c(SRS_Mirror_00005,
SRS_BSW_00406)
[SWS_Mirror_00003] d A call to Mirror_DeInit sets the Bus Mirroring module back
to the uninitialized state. c(SRS_Mirror_00012)
[SWS_Mirror_00004] d If development error reporting is enabled via MirrorDe-
vErrorDetect, the Bus Mirroring module shall call Det_ReportError with
the error code MIRROR_E_UNINIT when any API other than Mirror_Init or
Mirror_GetVersionInfo is called in uninitialized state. c(SRS_BSW_00350,
SRS_BSW_00450)
[SWS_Mirror_00005] d When Mirror_Init is called in initialized state, the Bus
Mirroring module shall not re-initialize its internal variables. It shall instead call
Det_ReportError with the error code MIRROR_E_REINIT if development error re-
porting is enabled (see MirrorDevErrorDetect). c(SRS_BSW_00350)
To be able to measure times, the Bus Mirroring module is triggered cyclically via the
Mirror_MainFunction.
[SWS_Mirror_00006] d The Bus Mirroring module shall use the Mir-
ror_MainFunction for timing related purposes. c(SRS_BSW_00478)
The Bus Mirroring module accesses the CAN bus through the CAN Interface module
(CanIf). After the Bus Mirroring module starts the mirroring of a CAN bus, the CAN
Interface module reports received and transmitted CAN frames to the Bus Mirroring
module. The CAN bus state is polled cyclically from the Mirror_MainFunction.
After initialization, the CAN Interface module does not report any frames to the Bus
Mirroring module.
[SWS_Mirror_00019] d When Mirror_StartSourceNetwork is called to start a
CAN source bus, the Bus Mirroring module shall call CanIf_EnableBusMirroring
with MirroringActive set to TRUE to start reporting of received and transmitted
CAN frames from the corresponding CAN controller. c(SRS_Mirror_00010)
Mirror_StartSourceNetwork receives a ComMChannelId as network, while
CanIf_EnableBusMirroring expects a CanIfCtrlId as ControllerId. The
translation of the one to the other can be determined at generation time by follow-
ing the references from the ComMChannelId to the CanIfCtrlId through the ECU
configuration.
[SWS_Mirror_00020] d When Mirror_StopSourceNetwork is called to stop a CAN
source bus, the Bus Mirroring module shall call CanIf_EnableBusMirroring with
MirroringActive set to FALSE to stop reporting of received and transmitted CAN
frames from the corresponding CAN controller. c(SRS_Mirror_00010)
The CAN Interface module reports both received and transmitted CAN frames with a
call to Mirror_ReportCanFrame. Received frames are reported from the reception
interrupt or task, while transmitted frames are reported from the transmission confir-
mation interrupt or task.
For each reported CAN frame, the CAN Interface module provides information about
the receiving CAN controller, about the CAN ID, the CAN ID type (extended or stan-
dard), and the CAN frame type (CAN-FD or CAN 2.0), and the length and the actual
payload of the frame.
[SWS_Mirror_00021] d When Mirror_ReportCanFrame is called to report a re-
ceived or transmitted CAN frame, the Bus Mirroring module shall match the canId
containing the actual CAN ID, the ID type, and the frame type against all active stati-
cally configured and dynamically added filters of the corresponding source bus. If the
CAN frame matches at least one filter, it is accepted by the Bus Mirroring module. c
(SRS_Mirror_00006, SRS_Mirror_00007)
When mirroring to a FlexRay, an IP, or a proprietary destination bus, the source bus
is identified by a network ID, but Mirror_ReportCanFrame reports the control-
lerId. The translation of the one to the other can be determined at generation time
by following the references from the CanIfCtrlId to the MirrorNetworkId through
the ECU configuration via MirrorComMNetworkHandleRef.
[SWS_Mirror_00026] d The Bus Mirroring module shall poll the status of each
active CAN source bus by cyclically calling CanIf_GetControllerMode and
CanIf_GetTrcvMode from the Mirror_MainFunction. If the returned Con-
trollerModePtr is CAN_CS_STARTED and the returned TransceiverModePtr
is CANTRCV_TRCVMODE_NORMAL, the reported CAN source bus state shall be
set to online, otherwise to offline. If the bus is online, the Bus Mirroring
module shall call CanIf_GetControllerErrorState, and if the returned Er-
rorStatePtr is CAN_ERRORSTATE_PASSIVE or CAN_ERRORSTATE_BUSOFF, the
reported CAN source bus state shall be set to error passive or bus-off, re-
spectively. Additionally, if the bus is online, the Bus Mirroring module shall
also call CanIf_GetControllerTxErrorCounter, and add the returned TxEr-
rorCounterPtr to the reported CAN source bus state. c(SRS_Mirror_00008,
SRS_Mirror_00009)
The APIs CanIf_GetControllerMode and CanIf_GetControllerErrorState
expect a ControllerId, and CanIf_GetTrcvMode expects a TransceiverId,
but a network ID is required to report the status to the output bus. The translation of the
ones to the other can be determined at generation time by following the references from
the CanIfCtrlId and CanTrcvChannelId, respectively, to the MirrorNetworkId
through the ECU configuration via MirrorComMNetworkHandleRef.
The Bus Mirroring module accesses the LIN bus through the LIN Interface module
(LinIf). After the Bus Mirroring module starts the mirroring of a LIN bus, the LIN Inter-
face module reports received and transmitted LIN frames to the Bus Mirroring module.
The LIN bus state is partially reported together with the LIN frames, and partially polled
cyclically from the Mirror_MainFunction.
After initialization, the LIN Interface module does not report any frames to the Bus
Mirroring module.
[SWS_Mirror_00027] d When Mirror_StartSourceNetwork is called to start a
LIN source bus, the Bus Mirroring module shall call LinIf_EnableBusMirroring
with MirroringActive set to TRUE to start reporting of received and transmitted
LIN frames from that bus. c(SRS_Mirror_00010)
[SWS_Mirror_00028] d When Mirror_StopSourceNetwork is called to stop a LIN
source bus, the Bus Mirroring module shall call LinIf_EnableBusMirroring with
MirroringActive set to FALSE to stop reporting of received and transmitted LIN
frames from that bus. c(SRS_Mirror_00010)
The LIN Interface module reports both received and transmitted LIN frames with a call
to Mirror_ReportLinFrame. Received and transmitted frames are reported from
the LIN schedule processing after the corresponding status check has been executed.
For each reported LIN frame, the LIN Interface module provides information about the
receiving bus, about the protected ID (PID), the length, and the actual payload of the
frame, and about the reception or transmission status.
[SWS_Mirror_00029] d When Mirror_ReportLinFrame is called to report a re-
ceived or transmitted LIN frame, the Bus Mirroring module shall extract the frame ID
from the reported pid and match it against all active statically configured and dy-
namically added filters of the corresponding source bus. If the LIN frame matches
at least one filter, it is accepted by the Bus Mirroring module. c(SRS_Mirror_00006,
SRS_Mirror_00007)
The frame ID of a LIN frame is calculated from the PID by removing the two most
significant bits.
[SWS_Mirror_00034] d The Bus Mirroring module shall evaluate the status reported
by Mirror_ReportLinFrame. If it is LIN_TX_HEADER_ERROR, LIN_TX_ERROR,
LIN_RX_ERROR, or LIN_RX_NO_RESPONSE, the reported LIN source bus state shall
be set to header transmission error, transmission error, reception error, or no response.
c(SRS_Mirror_00008, SRS_Mirror_00009)
[SWS_Mirror_00035] d The Bus Mirroring module shall poll the status of
each active LIN source bus by cyclically calling LinIf_GetTrcvMode from
the Mirror_MainFunction. If the returned TransceiverModePtr is LIN-
TRCV_TRCV_MODE_NORMAL, the reported LIN source bus state shall be set to online,
otherwise to offline. c(SRS_Mirror_00008, SRS_Mirror_00009)
The Bus Mirroring module accesses the FlexRay bus through the FlexRay Interface
module (FrIf). After the Bus Mirroring module starts the mirroring of a FlexRay bus,
the FlexRay Interface module reports received and transmitted FlexRay frames to
the Bus Mirroring module. The FlexRay bus state is polled cyclically from the Mir-
ror_MainFunction. A FlexRay source bus corresponds to a FlexRay cluster, which
can be connected to several controllers.
After initialization, the FlexRay Interface module does not report any frames to the Bus
Mirroring module.
[SWS_Mirror_00036] d When Mirror_StartSourceNetwork is called
to start a FlexRay source bus, the Bus Mirroring module shall call
FrIf_EnableBusMirroring with FrIf_MirroringActive set to TRUE to
start reporting of received and transmitted FlexRay frames from the corresponding
FlexRay cluster. c(SRS_Mirror_00010)
Mirror_StartSourceNetwork receives a ComMChannelId as network, while
FrIf_EnableBusMirroring expects a FrIfClstIdx as FrIf_ClstIdx. The
translation of the one to the other can be determined at generation time by following
the references from the ComMChannelId to the the related FrIfClstIdx through the
ECU configuration.
[SWS_Mirror_00037] d When Mirror_StopSourceNetwork is called
to stop a FlexRay source bus, the Bus Mirroring module shall call
FrIf_EnableBusMirroring with FrIf_MirroringActive set to FALSE to
stop reporting of received and transmitted FlexRay frames from the corresponding
FlexRay cluster. c(SRS_Mirror_00010)
The FlexRay Interface module reports both received and transmitted FlexRay frames
with a call to Mirror_ReportFlexRayFrame. Received and transmitted frames are
reported from the job list execution function or the transmit function of the FlexRay
Interface.
For each reported FlexRay frame, the FlexRay Interface module provides information
about the receiving FlexRay controller and about the slot ID and cycle, the length and
the actual payload of the frame, and information about transmission conflicts.
[SWS_Mirror_00038] d When Mirror_ReportFlexRayFrame is called to report a
received or transmitted FlexRay frame (txConflict is reported as FALSE), the Bus
Mirroring module shall match the slotId and cycle against all active statically con-
figured and dynamically added filters of the corresponding source bus. If the FlexRay
frame matches at least one filter, it is accepted by the Bus Mirroring module. c
(SRS_Mirror_00006, SRS_Mirror_00007)
On the destination bus, the source bus is identified by a network ID, but Mir-
ror_ReportFlexRayFrame reports the controllerId. The translation of the one
to the other can be determined at generation time by following the references from the
FrIfCtrlIdx to the MirrorNetworkId through the ECU configuration via Mirror-
ComMNetworkHandleRef.
report the status to the output bus. The translation of the one to the other can be de-
termined at generation time by following the references from the FrIfClstIdx to the
MirrorNetworkId through the ECU configuration via MirrorComMNetworkHan-
dleRef.
[SWS_Mirror_00042] d The Bus Mirroring module shall poll the status of each
active FlexRay source bus by cyclically calling FrIf_GetState from the Mir-
ror_MainFunction. If the returned FrIf_StatePtr is FRIF_STATE_ONLINE,
the reported FlexRay source bus state shall be set to online, otherwise to
offline. If the bus is online, the Bus Mirroring module shall also call
FrIf_GetPOCStatus for each controller connected to the FlexRay cluster. If
the returned Fr_POCStateType is FR_POCSTATE_NORMAL_ACTIVE for all con-
trollers, the reported source bus state shall be synchronous and normal active;
if Fr_POCStateType is FR_POCSTATE_NORMAL_PASSIVE for at least one con-
troller, the reported source bus state shall be synchronous but not normal active;
if Fr_POCStateType is in any other state for at least one controller, the reported
source bus state shall be neither synchronous nor normal active. c(SRS_Mirror_00008,
SRS_Mirror_00009)
This section describes how to handle the mirroring protocol, which is defined in sec-
tion 7.4.2.
7.4.1.1 Creation
7.4.1.2 Queueing
[SWS_Mirror_00048] d When a data item does not fit in the remaining space of the cur-
rently active destination frame buffer, the Bus Mirroring module shall place this buffer
in the queue and activate a new destination frame buffer. The data item shall then be
placed in the new buffer. c(SRS_Mirror_00008, SRS_Mirror_00013)
[SWS_Mirror_00049] d When the relative time stamp of a data item exceeds 655.35 ms,
the Bus Mirroring module shall place the currently active destination frame buffer in the
queue and activate a new destination frame buffer. The data item shall then be placed
in the new buffer. c(SRS_Mirror_00008, SRS_Mirror_00013)
[SWS_Mirror_00050] d If the optional configuration parameter MirrorDestTrans-
missionDeadline is configured and the transmission timeout expires, the Bus Mir-
roring module shall place the currently active destination frame buffer in the queue and
active a new destination frame buffer. c(SRS_Mirror_00008, SRS_Mirror_00013)
The size of the queue for the serialized destination frames is determined by the con-
figuration parameter MirrorDestQueueSize, the size of the queue elements by the
PduLength of the Pdu referenced by MirrorDestPduRef.
[SWS_Mirror_00113] d If a destination frame cannot be placed in the queue because
the queue is already full, the Bus Mirroring module shall drop that destination frame,
report the runtime error MIRROR_E_QUEUE_OVERRUN, and shall set (to 1) the Frames
Lost bit of the NetworkState of the next data item created in the currently active
destination frame buffer. c(SRS_Mirror_00013)
7.4.1.3 Transmission
The protocol that is applied by the Bus Mirroring module for IP, FlexRay, and proprietary
destination buses is shown in Figure 7.2, in this example for an Ethernet destination
bus.
The protocol consists of a header (see section 7.4.2.1) followed by several data items
(see section 7.4.2.2).
In the tables and descriptions of this section, the byte numbers increase in the same
sequence as the bytes are transmitted on the destination bus, starting from 0. The bit
numbers decrease, the most significant bit of a byte being bit 7 and the least significant
bit 0.
Every destination frame starts with a header, which is shown in Figure 7.3.
7.4.2.1.1 ProtocolVersion
7.4.2.1.2 SequenceNumber
7.4.2.1.3 HeaderTimestamp
HeaderTimestamp
Byte Byte Byte Byte Byte Byte Byte Byte Byte Byte
0 1 2 3 4 5 6 7 8 9
Seconds (48 bits, MSB first) Nanoseconds (32 bits, MSB first)
Table 7.1: Layout of HeaderTimestamp
7.4.2.1.4 DataLength
Every source frame is placed in a data item, which is shown in Figure 7.4.
7.4.2.2.1 Timestamp
[SWS_Mirror_00065] d The Timestamp shall reflect the temporal offset of the source
frame reception from the HeaderTimestamp, i.e. the time that passed since collection
of data items into the destination frame started. It shall be given in multiples of 10 µs. c
(SRS_Mirror_00008)
[SWS_Mirror_00066] d The width of the Timestamp field shall be 16 bits. It shall be
encoded in network byte order (MSB first). c(SRS_Mirror_00008)
7.4.2.2.2 NetworkStateAvailable
7.4.2.2.3 FrameIDAvailable
7.4.2.2.4 PayloadAvailable
7.4.2.2.5 NetworkType
[SWS_Mirror_00073] d The NetworkType shall indicate the type of the source bus. c
(SRS_Mirror_00008)
[SWS_Mirror_00074] d The width of the NetworkType field shall be 5 bits, the possi-
ble values are shown in Table 7.2. The range [5 . . 15] is reserved for future extensions
of the AUTOSAR defined protocol, the range [16 . . 31] is available for customer specific
bus types. c(SRS_Mirror_00008)
Invalid 0
Network Type Numerical
CAN 1
LIN 2
FlexRay 3
Ethernet 4
Table 7.2: Values of NetworkType
7.4.2.2.6 NetworkID
7.4.2.2.7 NetworkState
7.4.2.2.7.1 CAN
The layout of the NetworkState for a CAN bus is shown in Table 7.3.
NetworkState
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Frames Bus Error- Bus-Off Tx error counter, divided by 8
Lost Online Passive
Table 7.3: Layout of CAN NetworkState
[SWS_Mirror_00081] d Bit 5 of the NetworkState for a CAN bus shall contain the
Error-Passive state. This is a continuous state that is not related to the source frame
that is reported in the same data item, and may also be reported in a data item where
the FrameIDAvailable and PayloadAvailable fields are set to 0.
The Error-Passive state shall be set to 1 when the CAN controller is in the Error-Passive
state, and to 0 when it is in the Error-Active or Bus-Off state. c(SRS_Mirror_00008)
[SWS_Mirror_00082] d Bit 4 of the NetworkState for a CAN bus shall contain the
Bus-Off state. This is a continuous state that is not related to the source frame that
is reported in the same data item, and may also be reported in a data item where the
FrameIDAvailable and PayloadAvailable fields are set to 0.
The Bus-Off state shall be set to 1 when the CAN controller is in the Bus-Off state, and
to 0 when it is in the Error-Active or Error-Passive state. c(SRS_Mirror_00008)
[SWS_Mirror_00083] d Bits 3 – 0 of the NetworkState for a CAN bus shall contain
the Tx error counter of the can controller divided by 8. This is a continuous state that
is not related to the source frame that is reported in the same data item, and may also
be reported in a data item where the FrameIDAvailable and PayloadAvailable
fields are set to 0. c(SRS_Mirror_00008)
7.4.2.2.7.2 LIN
The layout of the NetworkState for a LIN bus is shown in Table 7.4.
NetworkState
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Frames Bus reserved Header Tx Error Rx Error Rx No
Lost Online Tx Error Response
Table 7.4: Layout of LIN NetworkState
[SWS_Mirror_00084] d Bits 5 and 4 of the NetworkState for a LIN bus are currently
reserved. They shall always be set to 0. c(SRS_Mirror_00008)
[SWS_Mirror_00085] d Bit 3 of the NetworkState for a LIN bus shall contain the
Header Tx Error state. This is an error that is related to the source frame that is
reported in the same data item.
The Header Tx Error state shall be set to 1 when the LIN controller detected an
error during transmission of a LIN header. Otherwise it shall be set to 0. c
(SRS_Mirror_00008)
[SWS_Mirror_00086] d Bit 2 of the NetworkState for a LIN bus shall contain the Tx
Error state. This is an error that is related to the source frame that is reported in the
same data item.
The Tx Error state shall be set to 1 when the LIN controller detected an error during
transmission of a LIN frame. Otherwise it shall be set to 0. c(SRS_Mirror_00008)
[SWS_Mirror_00087] d Bit 1 of the NetworkState for a LIN bus shall contain the Rx
Error state. This is an error that is related to the source frame that is reported in the
same data item.
The Rx Error state shall be set to 1 when the LIN controller detected an error during
reception of a LIN frame. Otherwise it shall be set to 0. c(SRS_Mirror_00008)
[SWS_Mirror_00088] d Bit 0 of the NetworkState for a LIN bus shall contain the
Header Rx No Response state. This is an error that is related to the source frame that
is reported in the same data item.
The Rx No Response state shall be set to 1 when the LIN controller did not receive the
expected LIN frame after transmission of a LIN header. Otherwise it shall be set to 0. c
(SRS_Mirror_00008)
7.4.2.2.7.3 FlexRay
The layout of the NetworkState for a FlexRay bus is shown in Table 7.5.
NetworkState
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Frames Bus Bus Syn- Normal Syntax Content Boundary Tx
Lost Online chronous Active Error Error Violation Conflict
Table 7.5: Layout of FlexRay NetworkState
[SWS_Mirror_00090] d Bit 4 of the NetworkState for a FlexRay bus shall contain the
Normal Active state. This is a continuous state that is not related to the source frame
that is reported in the same data item, and may also be reported in a data item where
the FrameIDAvailable and PayloadAvailable fields are set to 0.
The Normal Active state shall be set to 1 when all FlexRay controllers connected to
that bus are synchronous and in the normal active state. Otherwise it shall be set to 0.
c(SRS_Mirror_00008)
[SWS_Mirror_00091] d Bit 3 of the NetworkState for a FlexRay bus shall contain
the Syntax Error state. This is an aggregated error flag of the FlexRay channels that is
related to the channel assignment of the FrameID, but not to a source frame and its
FrameID that is reported in the same data item. It may also be reported in a data item
where the PayloadAvailable field is set to 0 and the FrameIDAvailable is set to
1 with the slot valid flag of the FrameID set to 0.
The Syntax Error state shall be set to 1 once after a FlexRay controller detected a
syntax error. Otherwise it shall be set to 0. c(SRS_Mirror_00008)
[SWS_Mirror_00092] d Bit 2 of the NetworkState for a FlexRay bus shall contain
the Content Error state. This is an aggregated error flag of the FlexRay channels that
is related to the channel assignment of the FrameID, but not to a source frame and its
FrameID that is reported in the same data item. It may also be reported in a data item
where the PayloadAvailable field is set to 0 and the FrameIDAvailable is set to
1 with the slot valid flag of the FrameID set to 0.
The Content Error state shall be set to 1 once after a FlexRay controller detected a
content error. Otherwise it shall be set to 0. c(SRS_Mirror_00008)
[SWS_Mirror_00093] d Bit 1 of the NetworkState for a FlexRay bus shall contain the
Boundary Violation state. This is an aggregated error flag of the FlexRay channels that
is related to the channel assignment of the FrameID, but not to a source frame and its
FrameID that is reported in the same data item. It may also be reported in a data item
where the PayloadAvailable field is set to 0 and the FrameIDAvailable is set to
1 with the slot valid flag of the FrameID set to 0.
The Boundary Violation state shall be set to 1 once after a FlexRay controller detected
a boundary violation. Otherwise it shall be set to 0. c(SRS_Mirror_00008)
[SWS_Mirror_00094] d Bit 0 of the NetworkState for a FlexRay bus shall contain
the Tx Conflict state. This is an error that is related to the previous source frame that
was reported with the same FrameID and is always reported in a data item where the
FrameIDAvailable field is set to 1 and the PayloadAvailable field is set to 0.
The Tx Conflict state shall be set to 1 when a FlexRay controller detected a transmis-
sion conflict. Otherwise it shall be set to 0. c(SRS_Mirror_00008)
7.4.2.2.8 FrameID
7.4.2.2.8.1 CAN
The layout of the FrameID for a CAN bus is shown in Table 7.6.
FrameID
Byte 0 Byte 1 Byte 2 Byte 3
Bit 7 Bit 6 Bit 5 Bits 4 . . 0
Ext.ID/ FD/ res. CAN ID CAN ID CAN ID CAN ID
Std.ID 2.0 (Bits 28 . . 24) (Bits 23 . . 16) (Bits 15 . . 8) (Bits 7 . . 0)
Table 7.6: Layout of CAN FrameID
7.4.2.2.8.2 LIN
The layout of the FrameID for a LIN bus is shown in Table 7.7.
FrameID
Byte 0
LIN PID
Table 7.7: Layout of LIN FrameID
[SWS_Mirror_00102] d The width of the FrameID field for a LIN bus shall be 1 byte. c
(SRS_Mirror_00008)
[SWS_Mirror_00103] d Byte 0 of the FrameID for a LIN bus shall contain the LIN PID
of the reported LIN frame. c(SRS_Mirror_00008)
7.4.2.2.8.3 FlexRay
The layout of the FrameID for a FlexRay bus is shown in Table 7.8.
FrameID
Byte 0 Byte 1 Byte 2
Bit 7 Bit 6 Bit 5 . . 4 Bit 3 Bits 2 . . 0
Channel Channel reserved Slot Slot ID Slot ID Cycle
B A Valid (Bits 10 . . 8) (Bits 7 . . 0)
Table 7.8: Layout of FlexRay FrameID
[SWS_Mirror_00104] d The width of the FrameID field for a FlexRay bus shall be 3
bytes. c(SRS_Mirror_00008)
[SWS_Mirror_00105] d Bits 7 – 6 of Byte 0 of the FrameID for a FlexRay bus shall
contain the channel assignment of the reported FlexRay frame. Bit 7 shall be set to
1 if the reported FlexRay frame is available on channel B of the FlexRay controller,
otherwise it shall be set to 0. Bit 6 shall be set to 1 if the reported FlexRay frame
is available on channel A of the FlexRay controller, otherwise it shall be set to 0. A
reported FlexRay frame is either assigned exclusively to channel A or B or to both
channels. c(SRS_Mirror_00008)
This layout of the channel assignment corresponds to the Fr_ChannelType reported
by Mirror_ReportFlexRayFrame.
[SWS_Mirror_00106] d Bits 5 – 4 of Byte 0 of the FrameID for a FlexRay bus are
currently reserved. They shall always be set 0. c(SRS_Mirror_00008)
[SWS_Mirror_00159] d Bit 3 of Byte 0 of the FrameID for a FlexRay bus shall contain
a flag indicating whether the reported slot ID and cycle are valid (flag is 1) or unused
(flag is 0). It shall only be set to 0 when an aggregated error of the FlexRay channels
is reported independently of a source frame or transmission conflict. Otherwise it shall
always be set to 1. c(SRS_Mirror_00008)
7.4.2.2.9 PayloadLength
7.4.2.2.10 Payload
[SWS_Mirror_00111] d The Payload shall provide the actual payload of the source
frame. It may be omitted when reporting a source bus state change, the presence shall
be indicated by PayloadAvailable. c(SRS_Mirror_00008)
[SWS_Mirror_00112] d The width of the Payload field shall correspond to the re-
ported source frame. The maximum values are 8 bytes for LIN and CAN 2.0, 64 bytes
for CAN-FD, and 254 for FlexRay. c(SRS_Mirror_00008)
This section describes how to process and transmit the source frames that were re-
ceived from the CAN and LIN bus as described in sections 7.3.1.2 and 7.3.2.2, respec-
tively.
7.5.1.1 ID Mapping
Usually, CAN source frames can be transmitted unchanged on the destination bus,
while the PIDs of LIN source frames have to be mapped to a range of CAN ID.
But sometimes, it is hard to find a consecutive sequence of unused CAN IDs for map-
ping of the LIN PIDs, or the same CAN ID is also used by frames that are usually
transmitted on the destination CAN bus.
In these cases, certain CAN IDs and LIN PIDs have to be remapped to special CAN
IDs.
7.5.1.1.1 CAN
7.5.1.1.2 LIN
[SWS_Mirror_00117] d If the frame ID extracted from the pid of a LIN source frame
matches the MirrorSourceLinToCanIdMappingLinId of a MirrorSourceLin-
ToCanIdMapping, the CAN destination frame shall be transmitted with the Mirror-
SourceLinToCanIdMappingCanId of that mapping. c(SRS_Mirror_00015)
[SWS_Mirror_00118] d If the frame ID extracted from the pid of a LIN source frame
matches no MirrorSourceLinToCanIdMapping, the CAN destination frame shall
be transmitted with the LIN frame ID added to the MirrorSourceLinToCanRange-
BaseId. c(SRS_Mirror_00015)
7.5.1.2 Queuing
[SWS_Mirror_00119] d The Bus Mirroring module shall place all CAN destination
frames in the queue. c(SRS_Mirror_00013)
The size of the queue for the CAN destination frames is determined by the config-
uration parameter MirrorDestQueueSize, the size of the queue elements by the
PduLength of the Pdu referenced by MirrorDestPduRef.
[SWS_Mirror_00120] d If a destination frame cannot be placed in the queue because
the queue is already full, the Bus Mirroring module shall drop that destination frame,
report the runtime error MIRROR_E_QUEUE_OVERRUN, and set (to 1) the Frames Lost
bit of the NetworkState in the next status frame. c(SRS_Mirror_00013)
The handling of status frames is defined in section 7.5.2.
7.5.1.3 Transmission
To be able to transmit arbitrary CAN IDs with arbitrary type (Extended / Stan-
dard) in CAN frames of arbitrary type (CAN 2.0 / CAN-FD), the Bus Mir-
roring module uses a MirrorDestPdu with MetaData and open CanIdMask
(see [SWS_Mirror_CONSTR_00001]).
[SWS_Mirror_00121] d To initiate the transmission of a queued CAN destination
frame, the Bus Mirroring module shall call PduR_MirrorTransmit with PduIn-
foPtr->MetaDataPtr set to MetaData containing the CAN ID of the destination
frame and PduInfoPtr->SduLength set to the length of the destination frame. If
MirrorDestPduUsesTriggerTransmit is enabled, PduInfoPtr->SduDataPtr
shall be set to the NULL_PTR, otherwise to the payload of the source frame. c
(SRS_Mirror_00013)
A NULL_PTR for PduInfoPtr->SduDataPtr ensures that the destination
bus interface module (CanIf) fetches the destination frame using Mir-
ror_TriggerTransmit.
[SWS_Mirror_00154] d If the PduR_MirrorTransmit returns E_NOT_OK, the Bus
Mirroring module shall immediately remove the destination frame from the queue,
shall report the runtime error MIRROR_E_TRANSMIT_FAILED, and shall set (to 1) the
Frames Lost bit of the NetworkState of the next status frame. c(SRS_Mirror_00013)
reported source bus, and in the latter case the FrameID shall be omitted. Sec-
tion 7.4.2.2.7 lists the error codes and describes the necessity to provide the frame
ID. c(SRS_Mirror_00009)
[SWS_Mirror_00125] d When a status item does not fit in the remaining space of the
currently active status frame buffer, the Bus Mirroring module shall place this buffer in
the queue with the CAN ID configured in MirrorStatusCanId and activate a new
status frame buffer. c(SRS_Mirror_00009, SRS_Mirror_00013)
[SWS_Mirror_00126] d When status items have been written for all source buses
where the reported state has changed, the Bus Mirroring module shall place the cur-
rently active status frame buffer in the queue with the CAN ID configured in Mir-
rorStatusCanId. c(SRS_Mirror_00009, SRS_Mirror_00013)
The protocol that is applied by the Bus Mirroring module for transmission of status
frames on CAN consists of a header (see section 7.5.3.1) followed by several data
items (see section 7.5.3.2).
In the tables and descriptions of this section, the byte numbers increase in the same
sequence as the bytes are transmitted on the destination bus, starting from 0. The bit
numbers decrease, the most significant bit of a byte being bit 7 and the least significant
bit 0.
Every status frame starts with a header, which is shown in Figure 7.5.
[SWS_Mirror_00127] d The header of a Bus Mirroring status frame shall contain the
ProtocolVersion (see section 7.5.3.1.1). c(SRS_Mirror_00009)
7.5.3.1.1 ProtocolVersion
Every source bus state is placed in a status item, which is shown in Figure 7.6.
[SWS_Mirror_00129] d Status items of a Bus Mirroring status frame shall contain the
following fields in this order:
1. NetworkStateAvailable (see section 7.5.3.2.1)
2. FrameIDAvailable (see section 7.5.3.2.2)
3. reserved
4. NetworkType (see section 7.5.3.2.3)
5. NetworkID (see section 7.5.3.2.4)
6. NetworkState (see section 7.5.3.2.5)
7. FrameID (optional, see section 7.5.3.2.6)
c(SRS_Mirror_00009)
[SWS_Mirror_00132] d Bit 5 of Byte 0 of the status item is currently reserved and shall
always be set to 0. c(SRS_Mirror_00009)
7.5.3.2.1 NetworkStateAvailable
The receiver of a Bus Mirroring status frame can use the NetworkStateAvailable
to check for a valid status item: If this bit is 0, the remainder of the frame can be
ignored, it is probably just padding (see also [SWS_Mirror_CONSTR_00002]).
7.5.3.2.2 FrameIDAvailable
7.5.3.2.3 NetworkType
7.5.3.2.4 NetworkID
7.5.3.2.5 NetworkState
7.5.3.2.6 FrameID
[SWS_Mirror_00136] d The layout and semantics of the FrameID of the status item
shall be identical to the FrameID used in a serialized data item. See section 7.4.2.2.8
for details. c(SRS_Mirror_00009)
c(SRS_BSW_00385)
c(SRS_BSW_00385)
The Bus Mirroring module does not define extended production errors.
8 API Specification
c()
8.2.1 Mirror_ConfigType
[SWS_Mirror_01002] d
Name: Mirror_ConfigType
Type: Structure
Element: Implementation –
specific.
Description: This is the base type for the configuration of the Bus Mirroring module.
Available Mirror.h
via:
c()
8.2.2 MIRROR_INVALID_NETWORK
[SWS_Mirror_00165] d
Name: MIRROR_INVALID_NETWORK
Type: Definition
Range: MIRROR_INVALID_NETWORK 0xFF Invalid network ID.
Description: This type represents a special value of NetworkHandleType, representing an
invalid network handle.
Available via: Mirror.h
c()
8.3.1.1 Mirror_Init
[SWS_Mirror_01003] d
Service name: Mirror_Init
Syntax: void Mirror_Init(
const Mirror_ConfigType* configPtr
)
Service ID[hex]: 0x01
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): configPtr Pointer to selected configuration structure
Parameters (inout): None
Parameters (out): None
Return value: None
Description: This function initializes the Bus Mirroring module.
Available via: Mirror.h
c()
8.3.1.2 Mirror_DeInit
[SWS_Mirror_01004] d
Service name: Mirror_DeInit
Syntax: void Mirror_DeInit(
void
)
Service ID[hex]: 0x02
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): None
Parameters (inout): None
Parameters (out): None
Return value: None
Description: This function resets the Bus Mirroring module to the uninitialized state.
Available via: Mirror.h
c()
8.3.1.3 Mirror_GetVersionInfo
[SWS_Mirror_01005] d
Service name: Mirror_GetVersionInfo
Syntax: void Mirror_GetVersionInfo(
Std_VersionInfoType* versionInfo
)
Service ID[hex]: 0x03
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: Returns the version information of this module.
Available via: Mirror.h
c()
8.3.2.1 Mirror_GetStaticFilterState
[SWS_Mirror_01006] d
Service name: Mirror_GetStaticFilterState
Syntax: Std_ReturnType Mirror_GetStaticFilterState(
NetworkHandleType network,
uint8 filterId,
boolean* isActive
)
Service ID[hex]: 0x23
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): network ComM channel that corresponds to the source bus
to which the filter is attached.
filterId ID of the filter.
Parameters (inout): None
Parameters (out): isActive Pointer to where to store the current filter state.
Return value: Std_ReturnType E_OK: Filter state copied to isActive.
E_NOT_OK: Function was called with invalid pa-
rameters.
Description: Returns the state of a pre-configured filter.
Available via: Mirror.h
c()
8.3.2.2 Mirror_SetStaticFilterState
[SWS_Mirror_01007] d
Service name: Mirror_SetStaticFilterState
Syntax: Std_ReturnType Mirror_SetStaticFilterState(
NetworkHandleType network,
uint8 filterId,
boolean isActive
)
Service ID[hex]: 0x14
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel that corresponds to the source bus
to which the filter is attached.
filterId ID of the filter.
isActive TRUE: Activate filter
FALSE: Deactivate filter
Parameters (inout): None
Parameters (out): None
c()
8.3.2.3 Mirror_AddCanRangeFilter
[SWS_Mirror_01008] d
Service name: Mirror_AddCanRangeFilter
Syntax: Std_ReturnType Mirror_AddCanRangeFilter(
NetworkHandleType network,
uint8* filterId,
Can_IdType lowerId,
Can_IdType upperId
)
Service ID[hex]: 0x15
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel that corresponds to the CAN bus to
which the filter shall be attached.
lowerId Lower CAN ID of the range.
upperId Upper CAN ID of the range.
Parameters (inout): None
Parameters (out): filterId ID of the newly created filter.
Return value: Std_ReturnType E_OK: New filter created.
E_NOT_OK: Creation of filter failed because of in-
valid parameters or because no filter on the given
network was free.
Description: Creates a CAN ID range filter.
Available via: Mirror.h
c()
8.3.2.4 Mirror_AddCanMaskFilter
[SWS_Mirror_01009] d
Service name: Mirror_AddCanMaskFilter
c()
8.3.2.5 Mirror_AddLinRangeFilter
[SWS_Mirror_01010] d
Service name: Mirror_AddLinRangeFilter
Syntax: Std_ReturnType Mirror_AddLinRangeFilter(
NetworkHandleType network,
uint8* filterId,
uint8 lowerId,
uint8 upperId
)
Service ID[hex]: 0x17
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel that corresponds to the LIN bus to
which the filter shall be attached.
lowerId Lower frame ID of the range.
upperId Upper frame ID of the range.
Parameters (inout): None
Parameters (out): filterId ID of the newly created filter.
Return value: Std_ReturnType E_OK: New filter created.
E_NOT_OK: Creation of filter failed because of in-
valid parameters or because no filter on the given
network was free.
c()
8.3.2.6 Mirror_AddLinMaskFilter
[SWS_Mirror_01011] d
Service name: Mirror_AddLinMaskFilter
Syntax: Std_ReturnType Mirror_AddLinMaskFilter(
NetworkHandleType network,
uint8* filterId,
uint8 id,
uint8 mask
)
Service ID[hex]: 0x18
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel that corresponds to the LIN bus to
which the filter shall be attached.
id Frame ID used to match a received or transmitted
frame ID.
mask Mask that defines the bits of ’id’ that are relevant for
comparison with the actual frame ID.
Parameters (inout): None
Parameters (out): filterId ID of the newly created filter.
Return value: Std_ReturnType E_OK: New filter created.
E_NOT_OK: Creation of filter failed because of in-
valid parameters or because no filter on the given
network was free.
Description: Creates a LIN frame ID mask filter.
Available via: Mirror.h
c()
8.3.2.7 Mirror_AddFlexRayFilter
[SWS_Mirror_01012] d
Service name: Mirror_AddFlexRayFilter
c()
8.3.2.8 Mirror_RemoveFilter
[SWS_Mirror_01013] d
Service name: Mirror_RemoveFilter
Syntax: Std_ReturnType Mirror_RemoveFilter(
NetworkHandleType network,
uint8 filterId
)
Service ID[hex]: 0x1a
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel that corresponds to the source bus
to which the filter is attached.
filterId ID of the filter.
Parameters (inout): None
Parameters (out): None
c()
8.3.3.1 Mirror_IsMirrorActive
[SWS_Mirror_01014] d
Service name: Mirror_IsMirrorActive
Syntax: boolean Mirror_IsMirrorActive(
void
)
Service ID[hex]: 0x20
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): None
Parameters (inout): None
Parameters (out): None
Return value: boolean TRUE: Bus Mirroring module is active
FALSE: Bus Mirroring module is inactive
Description: Returns the global mirroring state.
Available via: Mirror.h
c()
8.3.3.2 Mirror_Offline
[SWS_Mirror_01015] d
Service name: Mirror_Offline
Syntax: void Mirror_Offline(
void
)
Service ID[hex]: 0x13
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): None
Parameters (inout): None
c()
8.3.3.3 Mirror_GetDestNetwork
[SWS_Mirror_01016] d
Service name: Mirror_GetDestNetwork
Syntax: NetworkHandleType Mirror_GetDestNetwork(
void
)
Service ID[hex]: 0x21
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): None
Parameters (inout): None
Parameters (out): None
Return value: NetworkHandleType ComM channel that corresponds to the currently ac-
tive destination network.
Description: Returns the currently selected destination bus.
Available via: Mirror.h
c()
8.3.3.4 Mirror_SwitchDestNetwork
[SWS_Mirror_01017] d
Service name: Mirror_SwitchDestNetwork
Syntax: Std_ReturnType Mirror_SwitchDestNetwork(
NetworkHandleType network
)
Service ID[hex]: 0x12
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): network ComM channel corresponding to the destination bus
that shall be enabled.
Parameters (inout): None
c()
8.3.3.5 Mirror_IsSourceNetworkStarted
[SWS_Mirror_01018] d
Service name: Mirror_IsSourceNetworkStarted
Syntax: boolean Mirror_IsSourceNetworkStarted(
NetworkHandleType network
)
Service ID[hex]: 0x22
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): network ComM channel corresponding to the source bus that
shall be checked.
Parameters (inout): None
Parameters (out): None
Return value: boolean TRUE: Source bus is active.
FALSE: Source bus is inactive.
Description: Returns the state of a source bus.
Available via: Mirror.h
c()
8.3.3.6 Mirror_StartSourceNetwork
[SWS_Mirror_01019] d
Service name: Mirror_StartSourceNetwork
Syntax: Std_ReturnType Mirror_StartSourceNetwork(
NetworkHandleType network
)
Service ID[hex]: 0x10
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel corresponding to the source bus that
shall be started.
c()
8.3.3.7 Mirror_StopSourceNetwork
[SWS_Mirror_01020] d
Service name: Mirror_StopSourceNetwork
Syntax: Std_ReturnType Mirror_StopSourceNetwork(
NetworkHandleType network
)
Service ID[hex]: 0x11
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel corresponding to the source bus that
shall be stopped.
Parameters (inout): None
Parameters (out): None
Return value: Std_ReturnType E_OK: Source bus was deactivated.
E_NOT_OK: Function was called with invalid pa-
rameters.
Description: Deactivates a source bus.
Available via: Mirror.h
c()
8.3.4.1 Mirror_GetNetworkType
[SWS_Mirror_01021] d
Service name: Mirror_GetNetworkType
Syntax: Mirror_NetworkType Mirror_GetNetworkType(
NetworkHandleType network
)
Service ID[hex]: 0x24
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): network ComM channel corresponding to one of the buses
configured as source or destination bus.
Parameters (inout): None
Parameters (out): None
Return value: Mirror_NetworkType Network type of the bus identified by ’network’, or
MIRROR_NT_INVALID if the bus is not configured
for Mirror.
Description: Returns the network type of the given network.
Available via: Mirror.h
c()
8.3.4.2 Mirror_GetNetworkId
[SWS_Mirror_01022] d
Service name: Mirror_GetNetworkId
Syntax: uint8 Mirror_GetNetworkId(
NetworkHandleType network
)
Service ID[hex]: 0x25
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): network ComM channel corresponding to one of the buses
configured as source or destination bus.
Parameters (inout): None
Parameters (out): None
Return value: uint8 Network ID of the bus identified by ’network’, or
0xFF if the bus is not configured for Mirror.
Description: Returns the network ID of the given network.
Available via: Mirror.h
c()
8.3.4.3 Mirror_GetNetworkHandle
[SWS_Mirror_01023] d
Service name: Mirror_GetNetworkHandle
Syntax: NetworkHandleType Mirror_GetNetworkHandle(
Mirror_NetworkType networkType,
uint8 networkId
)
c()
8.4.1 Mirror_ReportCanFrame
[SWS_Mirror_01024] d
Service name: Mirror_ReportCanFrame
Syntax: void Mirror_ReportCanFrame(
uint8 controllerId,
Can_IdType canId,
uint8 length,
const uint8* payload
)
Service ID[hex]: 0x50
Sync/Async: Synchronous
Reentrancy: Reentrant for different controllerIds. Non reentrant for the same controller
Id.
Parameters (in): controllerId ID of the CAN controller that received or transmitted
the frame.
canId CAN ID of the CAN frame.
length Length of the CAN frame.
payload Content of the CAN frame.
Parameters (inout): None
Parameters (out): None
Return value: None
Description: 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.
Available via: Mirror.h
c()
8.4.2 Mirror_ReportLinFrame
[SWS_Mirror_01027] d
Service name: Mirror_ReportLinFrame
Syntax: void Mirror_ReportLinFrame(
NetworkHandleType network,
Lin_FramePidType pid,
const PduInfoType* pdu,
Lin_StatusType status
)
Service ID[hex]: 0x51
Sync/Async: Synchronous
Reentrancy: Reentrant for different networks. Non reentrant for the same network.
Parameters (in): network ComM channel associated with the LIN channel on
which the frame was received or transmitted.
pid Protected ID of the LIN frame.
pdu Content of the LIN frame.
status Rx/Tx status of the frame access through the LIN
driver.
Parameters (inout): None
Parameters (out): None
Return value: None
Description: Reports a received or transmitted LIN frame.
Available via: Mirror.h
c()
8.4.3 Mirror_ReportFlexRayFrame
[SWS_Mirror_01026] d
Service name: Mirror_ReportFlexRayFrame
c()
8.4.4 Mirror_ReportFlexRayChannelStatus
[SWS_Mirror_01025] d
Service name: Mirror_ReportFlexRayChannelStatus
Syntax: void Mirror_ReportFlexRayChannelStatus(
uint8 clusterId,
uint16 channelAStatus,
uint16 channelBStatus
)
Service ID[hex]: 0x53
Sync/Async: Synchronous
Reentrancy: Reentrant for different clusterIds. Non reentrant for the same clusterId.
Parameters (in): clusterId FlexRay cluster for which the status is reported.
channelAStatus Status of FlexRay channel A.
channelBStatus Status of FlexRay channel B.
Parameters (inout): None
Parameters (out): None
c()
8.4.5 Mirror_TxConfirmation
[SWS_Mirror_01028] d
Service name: Mirror_TxConfirmation
Syntax: void Mirror_TxConfirmation(
PduIdType TxPduId,
Std_ReturnType result
)
Service ID[hex]: 0x40
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 transmis-
sion of a PDU, or the failure to transmit a PDU.
Available via: Mirror.h
c()
8.4.6 Mirror_TriggerTransmit
[SWS_Mirror_01029] d
Service name: Mirror_TriggerTransmit
Syntax: Std_ReturnType Mirror_TriggerTransmit(
PduIdType TxPduId,
PduInfoType* PduInfoPtr
)
Service ID[hex]: 0x41
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.
c()
8.5.1 Mirror_MainFunction
[SWS_Mirror_01030] d
Service name: Mirror_MainFunction
Syntax: void Mirror_MainFunction(
void
)
Service ID[hex]: 0x04
Description: Main function of the Bus Mirroring module. Used for scheduling purposes
and timeout supervision.
Available via: SchM_Mirror.h
c()
This section defines all interfaces that are required to fulfill the core functionality of the
module.
[SWS_Mirror_01101] d
API function Header File Description
PduR_MirrorTransmit PduR_Mirror.h Requests transmission of a PDU.
c()
This section defines all interfaces that are required to fulfill an optional functionality of
the module.
[SWS_Mirror_01102] d
API function Header File Description
CanIf_EnableBusMirroring CanIf.h Enables or disables mirroring for a
CAN controller.
CanIf_GetControllerErrorState CanIf.h This service calls the corresponding
CAN Driver service for obtaining the
error state of the CAN controller.
CanIf_GetControllerMode CanIf.h This service calls the corresponding
CAN Driver service for obtaining the
current status of the CAN controller.
CanIf_GetControllerTxErrorCounter CanIf.h This service calls the corresponding
CAN Driver service for obtaining the
Tx error counter of the CAN con-
troller.
CanIf_GetTrcvMode CanIf.h This function invokes CanTrcv_
GetOpMode and updates the pa-
rameter TransceiverModePtr with
the value OpMode provided by
CanTrcv.
Det_ReportError Det.h Service to report development er-
rors.
FrIf_EnableBusMirroring FrIf.h Enables or disables mirroring for all
FlexRay controllers connected to the
addressed FlexRay cluster.
FrIf_GetPOCStatus FrIf.h Wraps the FlexRay Driver API func-
tion Fr_GetPOCStatus().
c()
8.7.1.1 Mirror_NetworkType
[SWS_Mirror_01000] d
Name Mirror_NetworkType
Kind Enumeration
Range MIRROR_NT_INVALID 0x00 Invalid network
MIRROR_NT_CAN 0x01 CAN network
MIRROR_NT_LIN 0x02 LIN network
MIRROR_NT_FLEXRAY 0x03 FlexRay network
MIRROR_NT_ETHERNET 0x04 Ethernet network
MIRROR_NT_PROPRIETARY 0x05 Proprietary network
Description This type represents the bus types that are supported as source or
destination buses for the Bus Mirroring module. The invalid type is
used as a return value if a function cannot return a valid type.
Variation --
Available via Rte_Mirror_Type.h
c()
8.7.1.2 Mirror_FlexRayChannelType
[SWS_Mirror_01001] d
Name Mirror_FlexRayChannelType
Kind Enumeration
Range MIRROR_FR_CHANNEL_A 0x01 Frame assigned to channel A
MIRROR_FR_CHANNEL_B 0x02 Frame assigned to channel B
MIRROR_FR_CHANNEL_AB 0x03 Frame assigned to channel A
and B
Description This type represents the assignment of a FlexRay frame to the
channels A and B of a FlexRay network.
Variation --
Available via Rte_Mirror_Type.h
c()
8.7.1.3 Mirror_CanIdType
[SWS_Mirror_01032] d
Name Mirror_CanIdType
Kind Type
Description Local representation for Can_IdType
Range Standard32Bit 0..0x400007FF
--
Extended32Bit 0..0xDFFFFFFF
--
Variation --
Available via Mirror.h
c()
8.7.2.1 MirrorControl
[SWS_Mirror_01033] d
Name MirrorControl
Comment Provides access to the control functions of the Bus Mirroring module.
IsService true
Variation --
Possible Errors 0 E_OK
1 E_NOT_OK
Operations
AddCanMaskFilter
Comments Creates a CAN ID mask filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the CAN bus to which the filter shall
be attached.
Type NetworkHandleType
Variation --
Direction IN
filterId Comment ID of the newly created filter.
Type uint8*
Variation --
Direction OUT
id Comment CAN ID used to match a received or
transmitted CAN ID.
Type Mirror_CanIdType
Variation --
Direction IN
mask Comment Mask that defines the bits of ’id’ that
are relevant for comparison with the
actual CAN ID.
Type Mirror_CanIdType
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
AddCanRangeFilter
Comments Creates a CAN ID range filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the CAN bus to which the filter shall
be attached.
Type NetworkHandleType
Variation --
Direction IN
filterId Comment ID of the newly created filter.
Type uint8*
Variation --
Direction OUT
lowerId Comment Lower CAN ID of the range.
Type Mirror_CanIdType
Variation --
Direction IN
upperId Comment Upper CAN ID of the range.
Type Mirror_CanIdType
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
AddFlexRayFilter
Comments Creates a FlexRay filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the FlexRay bus to which the filter
shall be attached.
Type NetworkHandleType
Variation --
Direction IN
filterId Comment ID of the newly created filter.
Type uint8*
Variation --
Direction OUT
lowerSlotId Comment Lower slot ID of a range of slot IDs.
Type uint16
Variation --
Direction IN
upperSlotId Comment Upper slot ID of a range of slot IDs.
Type uint16
Variation --
Direction IN
lowerBaseCycle Comment Lower base cycle of a range of
cycles.
Type uint8
Variation --
Direction IN
upperBaseCycle Comment Upper base cycle of a range of
cycles.
Type uint8
Variation --
Direction IN
cycleRepetition Comment Repetition pattern of selected
cycles (2ˆ n).
Type uint8
Variation --
Direction IN
frChannel Comment FlexRay channel assignment.
Type Mirror_FlexRayChannelType
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
AddLinMaskFilter
Comments Creates a LIN frame ID mask filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the LIN bus to which the filter shall
be attached.
Type NetworkHandleType
Variation --
Direction IN
AddLinRangeFilter
Comments Creates a LIN frame ID range filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the LIN bus to which the filter shall
be attached.
Type NetworkHandleType
Variation --
Direction IN
filterId Comment ID of the newly created filter.
Type uint8*
Variation --
Direction OUT
lowerId Comment Lower frame ID of the range.
Type uint8
Variation --
Direction IN
upperId Comment Upper frame ID of the range.
Type uint8
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
GetDestNetwork
Comments Returns the currently selected destination bus.
Variation --
Parameters network Comment ComM channel that corresponds to
the currently active destination
network.
Type NetworkHandleType
Variation --
Direction OUT
Possible Errors E_OK Operation successful
GetNetworkHandle
Comments Returns the network handle (ComMChannel) of the bus identified by
the given network type and network ID.
Variation --
Parameters networkType Comment Network type of the bus to be
identified.
Type Mirror_NetworkType
Variation --
Direction IN
networkId Comment Network ID of the bus to be
identified.
Type uint8
Variation --
Direction IN
network Comment ComM channel that corresponds to
the bus identified by the given
network type and network ID.
Type NetworkHandleType
Variation --
Direction OUT
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
GetNetworkId
Comments Returns the network ID of the given network.
Variation --
Parameters network Comment ComM channel corresponding to
one of the buses configured as
source or destination bus.
Type NetworkHandleType
Variation --
Direction IN
networkId Comment Network ID of the bus identified by
’network’.
Type uint8
Variation --
Direction OUT
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
GetNetworkType
Comments Returns the network type of the given network.
Variation --
GetStaticFilterState
Comments Returns the state of a pre-configured filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the source bus to which the filter is
attached.
Type NetworkHandleType
Variation --
Direction IN
filterId Comment ID of the filter.
Type uint8
Variation --
Direction IN
isActive Comment Pointer to where to store the current
filter state.
Type boolean*
Variation --
Direction OUT
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
IsMirrorActive
Comments Returns the global mirroring state.
Variation --
Parameters mirrorActive Comment Global mirroring state.
Type boolean
Variation --
Direction OUT
Possible Errors E_OK Operation successful
IsSourceNetworkStarted
Comments Returns the state of a source bus.
Variation --
Parameters network Comment ComM channel corresponding to
the source bus that shall be
checked.
Type NetworkHandleType
Variation --
Direction IN
sourceNetworkStarted Comment State of a source bus. TRUE:
Source bus is active. FALSE:
Source bus is inactive.
Type boolean
Variation --
Direction OUT
Possible Errors E_OK Operation successful
Offline
Comments Completely disables any mirroring activities. Source buses are reset
to disabled, queued messages are purged, and the destination bus
is reset to the default destination. Pre-configured filters are disabled,
and filters added at runtime are removed.
Variation --
Possible Errors E_OK Operation successful
RemoveFilter
Comments Removes a CAN, LIN, or FlexRay filter that was added at runtime.
Variation --
Parameters network Comment ComM channel that corresponds to
the source bus to which the filter is
attached.
Type NetworkHandleType
Variation --
Direction IN
filterId Comment ID of the filter.
Type uint8
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
SetStaticFilterState
Comments Sets the state of a pre-configured filter.
Variation --
Parameters network Comment ComM channel that corresponds to
the source bus to which the filter is
attached.
Type NetworkHandleType
Variation --
Direction IN
filderId Comment ID of the filter.
Type uint8
Variation --
Direction IN
isActive Comment TRUE: Activate filter
FALSE: Deactivate filter
Type boolean
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
StartSourceNetwork
Comments Activates a source bus.
Variation --
Parameters network Comment ComM channel corresponding to
the source bus that shall be started.
Type NetworkHandleType
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
StopSourceNetwork
Comments Deactivates a source bus.
Variation --
Parameters network Comment ComM channel corresponding to
the source bus that shall be
stopped.
Type NetworkHandleType
Variation --
Direction IN
Possible Errors E_OK Operation successful
E_NOT_OK Operation failed
SwitchDestNetwork
Comments Changes the destination bus to the given ComM channel. The
previously active destination bus and all source buses are disabled.
Variation --
Parameters network Comment ComM channel corresponding to
the destination bus that shall be
enabled.
Type NetworkHandleType
Variation --
Direction IN
c()
8.7.3.1 MirrorControl
[SWS_Mirror_01031] d
Name MirrorControl
Kind ProvidedPort Interface MirrorControl
Description Provided port for the interface MirrorControl.
Variation --
c()
9 Sequence Diagrams
Currently, no sequence diagrams are available.
10 Configuration Specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. For general information about the definition of containers and parameters,
refer to the section 10.1 “Introduction to configuration specification” in [2, SWS BSW
General].
Section 10.1 specifies the structure (containers) and the parameters of the Bus Mirror-
ing module.
Section 10.2 lists constraints on the configuration of the Bus Mirroring module.
Section 10.3 specifies published information of the Bus Mirroring module.
10.1.1 Mirror
10.1.2 MirrorGeneral
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
No Included Containers
10.1.3 MirrorConfigSet
Included Containers
Container Name Multiplicity Scope / Dependency
MirrorDestNetwork 1..* Destination bus to which frames are sent by the Bus
Mirroring module.
MirrorSourceNetwork 1..* Source bus from which frames are received by the Bus
Mirroring module.
10.1.4 MirrorSourceNetwork
Container Choices
Container Name Multiplicity Scope / Dependency
MirrorSourceNetworkCan 0..1 Source bus representing a CAN network.
MirrorSourceNetworkFlex 0..1 Source bus representing a FlexRay network.
Ray
MirrorSourceNetworkLin 0..1 Source bus representing a LIN network.
10.1.5 MirrorSourceNetworkCan
Included Containers
Container Name Multiplicity Scope / Dependency
MirrorSourceCanFilter 0..255 Pre-configured filter for CAN frames.
MirrorSourceCanMask 0..* Rule for remapping a set of CAN IDs.
BasedIdMapping
MirrorSourceCanSingleId 0..* Rule for remapping a single CAN ID.
Mapping
10.1.6 MirrorSourceCanFilter
Container Choices
Container Name Multiplicity Scope / Dependency
MirrorSourceCanFilter 0..1 Pre-configured mask based filter for CAN frames.
Mask
MirrorSourceCanFilter 0..1 Pre-configured range filter for CAN frames.
Range
10.1.7 MirrorSourceCanFilterRange
No Included Containers
10.1.8 MirrorSourceCanFilterMask
No Included Containers
10.1.9 MirrorSourceCanSingleIdMapping
No Included Containers
10.1.10 MirrorSourceCanMaskBasedIdMapping
Name MirrorSourceCanMaskBasedIdMappingDestBaseId
[ECUC_Mirror_00028]
Parent Container MirrorSourceCanMaskBasedIdMapping
Description Base ID merged with the masked parts of the original CAN ID to form
the mapped CAN ID.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 4294967295
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: local
Name MirrorSourceCanMaskBasedIdMappingSourceCanIdCode
[ECUC_Mirror_00026]
Parent Container MirrorSourceCanMaskBasedIdMapping
Description Value to match masked original CAN IDs.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 4294967295
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: local
Name MirrorSourceCanMaskBasedIdMappingSourceCanIdMask
[ECUC_Mirror_00027]
Parent Container MirrorSourceCanMaskBasedIdMapping
Description Mask applied to original CAN IDs before comparison.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 4294967295
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: local
No Included Containers
10.1.11 MirrorSourceNetworkLin
Included Containers
Container Name Multiplicity Scope / Dependency
MirrorSourceLinFilter 0..255 Pre-configured filter for LIN frames.
MirrorSourceLinToCanId 0..* Rule for mapping a LIN frame ID to a special CAN ID.
Mapping
10.1.12 MirrorSourceLinFilter
Container Choices
Container Name Multiplicity Scope / Dependency
MirrorSourceLinFilter 0..1 Pre-configured mask based filter for LIN frames.
Mask
MirrorSourceLinFilter 0..1 Pre-configured range filter for LIN frames.
Range
10.1.13 MirrorSourceLinFilterRange
No Included Containers
10.1.14 MirrorSourceLinFilterMask
No Included Containers
10.1.15 MirrorSourceLinToCanIdMapping
No Included Containers
10.1.16 MirrorSourceNetworkFlexRay
Included Containers
Container Name Multiplicity Scope / Dependency
MirrorSourceFlexRay 0..255 Pre-configured filter for FlexRay frames.
Filter
10.1.17 MirrorSourceFlexRayFilter
No Included Containers
10.1.18 MirrorDestNetwork
Container Choices
Container Name Multiplicity Scope / Dependency
MirrorDestNetworkCan 0..1 Destination bus representing a CAN network.
MirrorDestNetworkCdd 0..1 Destination bus representing a user defined network.
MirrorDestNetworkFlex 0..1 Destination bus representing a FlexRay network.
Ray
MirrorDestNetworkIp 0..1 Destination bus representing an IP network.
10.1.19 MirrorDestNetworkCan
Included Containers
Container Name Multiplicity Scope / Dependency
MirrorDestPdu 1..* I-PDU used for transmission of the mirrored frames on
the destination bus.
10.1.20 MirrorDestNetworkFlexRay
If omitted, destination frames are only sent when full or when the time
stamp overflows after 655.35ms.
Multiplicity 0..1
Type EcucFloatParamDef
Range [0.001 .. 0.655]
Default Value 0.1
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
MirrorDestPdu 1..* I-PDU used for transmission of the mirrored frames on
the destination bus.
10.1.21 MirrorDestNetworkIp
If omitted, destination frames are only sent when full or when the time
stamp overflows after 655.35ms.
Multiplicity 0..1
Type EcucFloatParamDef
Range [0.001 .. 0.655]
Default Value 0.1
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
MirrorDestPdu 1..* I-PDU used for transmission of the mirrored frames on
the destination bus.
10.1.22 MirrorDestNetworkCdd
If omitted, destination frames are only sent when full or when the time
stamp overflows after 655.35ms.
Multiplicity 0..1
Type EcucFloatParamDef
Range [0.001 .. 0.655]
Default Value 0.1
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
MirrorDestPdu 1..* I-PDU used for transmission of the mirrored frames on
the destination bus.
10.1.23 MirrorDestPdu
Multiplicity 1
Type EcucBooleanParamDef
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: local
No Included Containers
To avoid padding, the MirrorDestPdu used for a FlexRay destination bus shall be
placed on dynamic frames.
[SWS_Mirror_CONSTR_00004] d FrIfAllowDynamicLSduLength shall be set to
true for all FrIfFrameStructures that contain FrIfTxPdus referenced by a Mir-
rorDestPdu of a MirrorDestNetworkFlexRay. c(SRS_Mirror_00001)
According to [SWS_FrIf_05092], a FlexRay PDU with dynamic length must be placed
at the end of a FlexRay frame, or must be the only PDU within the frame.
In principal, when a serialized frame is received by an ECU that features Bus Mirroring,
it would be nice to merge it into the stream of serialized messages created by the Bus
Mirroring module. But as declared section 4.1, this would mean that the Bus Mirroring
module would have to first de-serialize the received message and then re-serialize the
elements of the message, which would be quite complicated and expensive regarding
run-time, and it would require an extended configuration because the mirroring could
not discern serialized frames from other frames that accidentally could be interpreted
as serialized frames.
Note that this scenario can only happen on a FlexRay source bus, because IP/Ethernet
and proprietary networks cannot be configured as source buses.
If a MirrorSourceFlexRayFilter accepts the serialized frames, they will therefore
be packed as a single frame into the serialized destination frame, resulting in a nested
serialization. To avoid such a nested serialization, it should be avoided that serialized
frames are accepted by the Bus Mirroring module by setting the FlexRay frame filters
accordingly.