AUTOSAR_SWS_ComStackTypes
AUTOSAR_SWS_ComStackTypes
V2.3.0
R3.1 Rev 5
This specification 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 specification.
The material contained in this specification is protected by copyright and other types
of Intellectual Property Rights. The commercial exploitation of the material contained
in this specification requires a license to such Intellectual Property Rights.
This specification 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 specification may be utilized or reproduced, in
any form or by any means, without permission in writing from the publisher.
The AUTOSAR specifications have been developed for automotive applications only.
They have neither been developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Any such exemplary items are contained in the Specification Documents for
illustration purposes only, and they themselves are not part of the AUTOSAR
Standard. Neither their presence in such Specification Documents, nor any later
documentation of AUTOSAR conformance of products actually implementing such
exemplary items, imply that intellectual property rights covering such exemplary
items are licensed under the same rules as applicable to the AUTOSAR Standard.
Table of Contents
1 Introduction and functional overview ................................................................... 4
2 Acronyms and abbreviations ............................................................................... 5
3 Related documentation........................................................................................ 6
3.1 Input documents........................................................................................... 6
3.2 Related standards and norms ...................................................................... 6
4 Constraints and assumptions .............................................................................. 7
4.1 Limitations .................................................................................................... 7
4.2 Applicability to car domains.......................................................................... 7
4.3 Applicability to safety related environments ................................................. 7
5 Software Architecture .......................................................................................... 8
5.1 Dependencies to other modules................................................................... 8
5.2 File structure ................................................................................................ 8
6 Requirements traceability .................................................................................... 9
7 Functional specification ..................................................................................... 15
7.1 General issues ........................................................................................... 15
8 API specification................................................................................................ 16
8.1 Type definitions .......................................................................................... 16
8.1.1 PduIdType .............................................................................................. 16
8.1.2 PduLengthType ...................................................................................... 16
8.1.3 PduInfoType ........................................................................................... 16
8.1.4 BufReq_ReturnType ............................................................................... 18
8.1.5 NotifResultType ...................................................................................... 18
8.1.6 BusTrcvErrorType................................................................................... 21
8.1.7 NetworkHandleType ............................................................................... 22
8.2 Function definitions .................................................................................... 22
9 Sequence diagrams .......................................................................................... 23
10 Configuration specification ................................................................................ 24
10.1 Published parameters ................................................................................ 24
Abbreviation Description:
:
Com Communication
e.g. [lat.] exempli gratia = [eng.] for example
i.e. [lat.] it est = [eng.] that is
3 Related documentation
4.1 Limitations
No limitations.
5 Software Architecture
ComStack_Types.h
includes
Std_Types.h
includes includes
Platform_Types.h Compiler.h
6 Requirements traceability
Document: AUTOSAR general requirements on Basic Software Modules
[GeneralSRS]
Requirement Satisfied by
[BSW00344] Reference to link-time configuration Not applicable
(this is only a header file specification)
[BSW00404] Reference to post build time Not applicable
configuration (this is only a header file specification)
[BSW00405] Reference to multiple configuration Not applicable
sets (this is only a header file specification)
[BSW00345] Pre-compile-time configuration Not applicable
(this is only a header file specification)
[BSW159] Tool-based configuration Not applicable
(this is a tool requirement)
[BSW167] Static configuration checking Not applicable
(this is only a header file specification)
[BSW171] Configurability of optional functionality Not applicable
(this is only a header file specification)
[BSW170] Data for reconfiguration of AUTOSAR Not applicable
SW-Components (this is only a header file specification)
[BSW00380] Separate C-File for configuration Not applicable
parameters (this is only a header file specification)
[BSW00381] Separate configuration header file Not applicable
for pre-compile time parameters (this is only a header file specification)
[BSW00412] Separate H-File for configuration Not applicable
parameters [approved] (this is only a header file specification)
[BSW00383] List dependencies of configuration Not applicable
files (this is only a header file specification)
[BSW00384] List dependencies to other modules COMTYPE001
[BSW00387] Specify the configuration class of Not applicable
callback function (this is only a header file specification)
[BSW00388] Introduce containers Not applicable
(this is only a header file specification)
[BSW00389] Containers shall have names Not applicable
(this is only a header file specification)
[BSW00390] Parameter content shall be unique Not applicable
within the module (this is only a header file specification)
[BSW00391] Parameter shall have unique names Not applicable
(this is only a header file specification)
[BSW00392] Parameters shall have a type Not applicable
(this is only a header file specification)
[BSW00393] Parameters shall have a range Not applicable
(this is only a header file specification)
[BSW00394] Specify the scope of the parameters Not applicable
(this is only a header file specification)
[BSW00395] List the required parameters (per Not applicable
parameter) (this is only a header file specification)
[BSW00396] Configuration classes Not applicable
(this is only a header file specification)
[BSW00397] Pre-compile-time parameters Not applicable
(this is only a header file specification)
[BSW00398] Link-time parameters Not applicable
(this is only a header file specification)
[BSW00399] Loadable Post-build time parameters Not applicable
9 of 24 Document ID 050: AUTOSAR_SWS_ComStackTypes
- AUTOSAR confidential -
Specification of Communication Stack Types
V2.3.0
R3.1 Rev 5
Requirement Satisfied by
(this is only a header file specification)
[BSW00400] Selectable Post-build time Not applicable
parameters (this is only a header file specification)
[BSW00402] Published information Partly fulfilled by COMTYPE002. Vendor version
number for this header file not necessary.
[BSW00375] Notification of wake-up reason Not applicable
(this is only a header file specification)
[BSW101] Initialization interface Not applicable
(this is only a header file specification)
[BSW00416] Sequence of Initialization Not applicable
(this is only a header file specification)
[BSW00406] Check module initialization Not applicable
(this is only a header file specification)
[BSW168] Diagnostic Interface of SW Not applicable
components (this is only a header file specification)
[BSW00407] Function to read out published Not applicable
parameters (this is only a header file specification)
[BSW00423] Usage of SW-C template to describe Not applicable
BSW modules with AUTOSAR Interfaces (this is only a header file specification)
[BSW00424] BSW main processing function task Not applicable
allocation (this is only a header file specification)
[BSW00425] Trigger conditions for schedulable Not applicable
objects (this is only a header file specification)
[BSW00426] Exclusive areas in BSW modules Not applicable
(this is only a header file specification)
[BSW00427] ISR description for BSW modules Not applicable
(this is only a header file specification)
[BSW00428] Execution order dependencies of Not applicable
main processing functions (not related to this specification)
[BSW00429] Restricted BSW OS functionality Not applicable
access (this is only a header file specification)
[BSW00431] The BSW Scheduler module Not applicable
implements task bodies (not related to this specification)
[BSW00432] Modules should have separate main Not applicable
processing functions for read/receive and (this is only a header file specification)
write/transmit data path
[BSW00433] Calling of main processing functions Not applicable
(not related to this specification)
[BSW00434] The Schedule Module shall provide Not applicable
an API for exclusive areas (not related to this specification)
[BSW00336] Shutdown interface Not applicable
(this is only a header file specification)
[BSW00337] Classification of errors Not applicable
(this is only a header file specification)
[BSW00338] Detection and Reporting of Not applicable
development errors (this is only a header file specification)
[BSW00369] Do not return development error Not applicable
codes via API (this is only a header file specification)
[BSW00339] Reporting of production relevant Not applicable
error status (this is only a header file specification)
[BSW00421] Reporting of production relevant Not applicable
error events (this is only a header file specification)
[BSW00422] Debouncing of production relevant Not applicable
error status (not related to this specification)
[BSW00420] Production relevant error event rate Not applicable
detection (not related to this specification)
[BSW00417] Reporting of Error Events by Non- Not applicable
10 of 24 Document ID 050: AUTOSAR_SWS_ComStackTypes
- AUTOSAR confidential -
Specification of Communication Stack Types
V2.3.0
R3.1 Rev 5
Requirement Satisfied by
Basic Software (this is only a header file specification)
[BSW00323] API parameter checking Not applicable
(this is only a header file specification)
[BSW004] Version check Check has to be done by a specific tool. Version
numbers provided by COMTYPE002.
[BSW00409] Header files for production code Not applicable
error IDs (this is only a header file specification)
[BSW00385] List possible error notificatons Not applicable
(this is only a header file specification)
[BSW00386] Configuration for detecting an error Not applicable
(this is only a header file specification)
[BSW161] Microcontroller abstraction Not applicable
(this is only a header file specification)
[BSW162] ECU layout abstraction Not applicable
(requirement on AUTOSAR architecture, not a
single module)
[BSW00324] Do not use HIS I/O Library Not applicable
(architecture decision)
[BSW005] No hard coded horizontal interfaces Not applicable
within MCAL (requirement on AUTOSAR architecture, not a
single module)
[BSW00415] User dependent include files Not applicable
(only one user for this module)
[BSW164] Implementation of interrupt service Not applicable
routines (this module does not implement any ISRs)
[BSW00325] Runtime of interrupt service routines Not applicable
(this module does not implement any ISRs or
callback routines)
[BSW00326] Transition from ISRs to OS tasks Not applicable
(requirement on implementation, not on
specification)
[BSW00342] Usage of source code and object Not applicable
code (requirement on AUTOSAR architecture, not a
single module)
[BSW00343] Specification and configuration of Not applicable
time (this module does not provide any timing
configuration)
[BSW160] Human-readable configuration data Not applicable
(requirement on documentation, not on
specification)
[BSW007] HIS MISRA C Not applicable
(requirement on implementation, not on
specification)
[BSW00300] Module naming convention Not applicable
(requirement on implementation, not on
specification)
[BSW00413] Accessing instances of BSW Requirement can not be implemented in R2.0
modules timeframe.
[BSW00347] Naming separation of different Not applicable
instances of BSW drivers (requirement on the implementation, not on the
specification)
[BSW00305] Self-defined data types naming Chapter 8.1
convention
[BSW00307] Global variables naming convention Not applicable
(requirement on the implementation, not on the
specification)
[BSW00310] API naming convention Not applicable
11 of 24 Document ID 050: AUTOSAR_SWS_ComStackTypes
- AUTOSAR confidential -
Specification of Communication Stack Types
V2.3.0
R3.1 Rev 5
Requirement Satisfied by
(this is only a header file specification)
[BSW00373] Main processing function naming Not applicable
convention (this module does not provide a scheduled
function)
[BSW00327] Error values naming convention Not applicable
(this is only a header file specification)
[BSW00335] Status values naming convention Not applicable
(this is only a header file specification)
[BSW00350] Development error detection Not applicable
keyword (this is only a header file specification)
[BSW00408] Configuration parameter naming Not applicable
convention (this is only a header file specification)
[BSW00410] Compiler switches shall have Not applicable
defined values (this is only a header file specification)
[BSW00411] Get version info keyword Not applicable
(this is only a header file specification)
[BSW00346] Basic set of module files Not applicable
(this is only a header file specification)
[BSW158] Separation of configuration from Not applicable
implementation (this is only a header file specification)
[BSW00314] Separation of interrupt frames and Not applicable
service routines (this is only a header file specification)
[BSW00370] Separation of callback interface from Not applicable
API (this module does not implement any callback
routines)
[BSW00348] Standard type header Not applicable
(requirement on the standard header file)
[BSW00353] Platform specific type header Not applicable
(requirement on the platform specific header file)
[BSW00361] Compiler specific language Not applicable
extension header (requirement on the compiler specific header file)
[BSW00301] Limit imported information Not applicable
(this is only a header file specification)
[BSW00302] Limit exported information Not applicable
(requirement on the implementation, not on the
specification)
[BSW00328] Avoid duplication of code Not applicable
(requirement on the implementation, not on the
specification)
[BSW00312] Shared code shall be reentrant Not applicable
(requirement on the implementation, not on the
specification)
[BSW006] Platform independency Not applicable
(this is a module of the microcontroller abstraction
layer)
[BSW00357] Standard API return type Not applicable
(this is only a header file specification)
[BSW00377] Module specific API return types Not applicable
(this is only a header file specification)
[BSW00304] AUTOSAR integer data types Not applicable
(requirement on implementation, not for
specification)
[BSW00355] Do not redefine AUTOSAR integer Not applicable
data types (requirement on implementation, not for
specification)
[BSW00378] AUTOSAR boolean type Not applicable
(requirement on implementation, not for
12 of 24 Document ID 050: AUTOSAR_SWS_ComStackTypes
- AUTOSAR confidential -
Specification of Communication Stack Types
V2.3.0
R3.1 Rev 5
Requirement Satisfied by
specification)
[BSW00306] Avoid direct use of compiler and Not applicable
platform specific keywords (requirement on implementation, not for
specification)
[BSW00308] Definition of global data Not applicable
(requirement on implementation, not for
specification)
[BSW00309] Global data with read-only constraint Not applicable
(requirement on implementation, not for
specification)
[BSW00371] Do not pass function pointers via API Not applicable
(no function pointers in this specification)
[BSW00358] Return type of init() functions Not applicable
(this module does not provide an initialization
function)
[BSW00414] Parameter of init function Not applicable
(this module does not provide an initialization
function)
[BSW00376] Return type and parameters of main Not applicable
processing functions (this module does not provide a scheduled
function)
[BSW00359] Return type of callback functions Not applicable
(this module does not provide any callback
routines)
[BSW00360] Parameters of callback functions Not applicable
(this module does not provide any callback
routines)
[BSW00329] Avoidance of generic interfaces Not applicable
(this is only a header file specification)
[BSW00330] Usage of macros / inline functions Not applicable
instead of functions (requirement on implementation, not for
specification)
[BSW00331] Separation of error and status values Not applicable
(this is only a header file specification)
[BSW009] Module User Documentation Not applicable
(requirement on documentation, not on
specification)
[BSW00401] Documentation of multiple instances Not applicable
of configuration parameters (all configuration parameters are single instance
only)
[BSW172] Compatibility and documentation of Not applicable
scheduling strategy (no internal scheduling policy)
[BSW010] Memory resource documentation Not applicable
(requirement on documentation, not on
specification)
[BSW00333] Documentation of callback function Not applicable
context (requirement on documentation, not for
specification)
[BSW00374] Module vendor identification Not applicable
(this module is a standardized module)
[BSW00379] Module identification Not applicable
(this is only a header file specification)
[BSW003] Version identification COMTYPE002
[BSW00318] Format of module version numbers COMTYPE002
[BSW00321] Enumeration of module version Not applicable
numbers (requirement on implementation, not for
specification)
13 of 24 Document ID 050: AUTOSAR_SWS_ComStackTypes
- AUTOSAR confidential -
Specification of Communication Stack Types
V2.3.0
R3.1 Rev 5
Requirement Satisfied by
[BSW00341] Microcontroller compatibility Not applicable
documentation (requirement on documentation, not on
specification)
[BSW00334] Provision of XML file Not applicable
(requirement on documentation, not on
specification)
7 Functional specification
8 API specification
8.1.1 PduIdType
Type: uint8/uint16
Range: 0...<PduIdmax> Zero-based integer number
The size of this global type depends on the maximum
number of PDUs used within one software module.
Example :
If no software module deals with more PDUs that
256, this type can be set to uint8.
If at least one software module handles more than
256 PDUs, this type must globally be set to uint16.
Description: COMTYPE005: This type is used within the entire AUTOSAR Com Stack except
for bus drivers.
COMTYPE006: Variables of this type serve as a unique identifier of a PDU within
a software module or a set thereof, and also for interaction of two software
modules where the PduId of the corresponding target module is being used for
referencing.
COMTYPE007: In order to be able to perform table-indexing within a software
module, variables of this type shall be zero-based and consecutive.
There might be several ranges of PduIds in a module, one for each type of
operation performed within that module (e.g. sending and receiving).
COMTYPE014: PduIdmax, the maximum number of a PduId range, is the
number -1 of PDUs dealt with in the corresponding type of operation within that
module.
8.1.2 PduLengthType
Type: Uint8/uint16/uint32
Range: 0...<PduLengthmax> Zero-based integer number
The size of this global type depends on the maximum
length of PDUs to be sent by an ECU.
Example :
If no segmentation is used the length depends on the
maximum payload size of a frame of the underlying
communication system (for FlexRay maximum size is
255, therefore uint8).
If segementation is used it depends on the maximum
length of a segmeneted N-PDU (in general uint16 is
used)
Description: COMTYPE008: This type shall be used within the entire AUTOSAR Com Stack of
an ECU except for bus drivers.
COMTYPE010: Variables of this type serve as length information of a PDU. The
length information is provided in number of bytes.
COMTYPE017: PduLengthmax, the maximum length of a Pdu, is the length of
the largest (possibly segmented) PDU to be sent by the ECU.
8.1.3 PduInfoType
Type: typedef struct
16 of 24 Document ID 050: AUTOSAR_SWS_ComStackTypes
- AUTOSAR confidential -
Specification of Communication Stack Types
V2.3.0
R3.1 Rev 5
{
P2VAR(uint8,AUTOMATIC,AUTOSAR_COMSTACKDATA) SduDataPtr,
PduLengthType SduLength;
} PduInfoType;
8.1.4 BufReq_ReturnType
Type: typedef enum
Range: BUFREQ_OK Buffer request accomplished successful.
This status shall have the value 0.
BUFREQ_E_NOT_OK Buffer request not successful. Buffer cannot be
accessed.
This status shall have the value 1.
BUFREQ_E_BUSY Temporarily no buffer available. It’s up the
requestor to retry request for a certain time.
This status shall have the value 2.
BUFREQ_E_OVFL No Buffer of the required length can be provided.
This status shall have the value 3.
Description: COMTYPE012: Variables of this type shall be used to store the result of a buffer
request.
8.1.5 NotifResultType
Type: uint8
Range: 0x00 – 0x1E General return codes.
A detailed specification is listed below.
0x1F - 0x3C Error notification:
Error notification codes specific for the
communication system CAN.
For a detailed definition please refer to the
AUTOSAR specification of CAN TP [CANTP].
0x3D – 0x5A Error notification:
Error notification codes specific for the
communication system LIN.
A detailed definition is still open, because currently
there is not AUTOSAR specification of Lin TP.
0x5B – 0x78 Error notification:
Error notification codes specific for the
communication system FlexRay.
For a detailed definition please refer to the
AUTOSAR specification of FlexRay TP
[FlexRayTP].
> 0x78 Currently values in this range are invalid. In future
it might be possible that further return codes are
specified for other communication systems.
Description: COMTYPE013: Variables of this type shall be used to store the result status of a
notification (confirmation or indication).
<Currently this type is only used for communication between DCM and TP to
enable the notification that an error has occurred and a dedicated buffer can be
unlocked.>
8.1.6 BusTrcvErrorType
Type: uint8
Range: 0x00 – 0x1E General return codes.
A detailed specification is listed below.
0x1F - 0x3C Error notification:
Error notification codes specific for the
communication system CAN.
For a detailed definition please refer to the
AUTOSAR specification of CAN Transceiver Driver
[CANTRCV].
0x3D – 0x5A Error notification:
Error notification codes specific for the
communication system LIN.
A detailed definition is still open, because currently
there is not AUTOSAR specification of Lin
Interface.
0x5B – 0x78 Error notification:
Error notification codes specific for the
communication system FlexRay.
For a detailed definition please refer to the
AUTOSAR specification of FlexRay Transceiver
Driver [FRTRCV].
> 0x78 Currently values in this range are invalid. In future
it might be possible that further return codes are
specified for other communication systems.
Description: COMTYPE020: Variables of this type shall be used to return the bus status
evaluated by a transceiver.
8.1.7 NetworkHandleType
Type: Unti8
Range: 0...255 Zero-based integer number
9 Sequence diagrams
Not applicable.
10 Configuration specification
vendorId (COMSTACKTYPE_VENDOR_ID),
moduleId (COMSTACKTYPE _MODULE_ID),
arMajorVersion (COMSTACKTYPE_AR_MAJOR_VERSION),
arMinorVersion (COMSTACKTYPE_AR_MINOR_VERSION),
arPatchVersion (COMSTACKTYPE_AR_PATCH_VERSION),
swMajorVersion (COMSTACKTYPE_SW_MAJOR_VERSION),
swMinorVersion (COMSTACKTYPE_SW_MINOR_VERSION),
swPatchVersion (COMSTACKTYPE_SW_PATCH_VERSION),
vendorApiInfix (COMSTACKTYPE_VENDOR_API_INFIX)
is provided in the BSW Module Description Template (see 3.1 Figure 4.1 and Figure
7.1).
Additional published parameters are listed below if applicable for this module.