0% found this document useful (0 votes)
8 views107 pages

Autosar Sws Someiptransformer

The document outlines the specification of the SOME/IP Transformer as part of the AUTOSAR Classic Platform R21-11. It includes details on the document's change history, functional overview, and various specifications related to the SOME/IP protocol, including serialization and error handling. The document is intended for automotive applications and is published by AUTOSAR, with specific licensing requirements for commercial use.

Uploaded by

secadi5177
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views107 pages

Autosar Sws Someiptransformer

The document outlines the specification of the SOME/IP Transformer as part of the AUTOSAR Classic Platform R21-11. It includes details on the document's change history, functional overview, and various specifications related to the SOME/IP protocol, including serialization and error handling. The document is intended for automotive applications and is published by AUTOSAR, with specific licensing requirements for commercial use.

Uploaded by

secadi5177
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 107

Specification of SOME/IP Transformer

AUTOSAR CP R21-11

Specification of SOME/IP
Document Title Transformer
Document Owner AUTOSAR
Document Responsibility AUTOSAR
Document Identification No 660

Document Status published


Part of AUTOSAR Standard Classic Platform
Part of Standard Release R21-11

Document Change History


Date Release Changed by Description
• Clarification on network
representation
• SOME/IP Header encoded in
network byte order
• Clarification on
SOMEIPLegacyStringSerialization
• Optional method arguments not
supported
AUTOSAR • Clarification on Interface Version
2021-11-25 R21-11 Release • Clarification on processing order of
Management header fields in AUTOSAR CP
• Removed
SOMEIPXF_E_UNKNOWN_SERVICE
and
SOMEIPXF_E_UNKNOWN_METHOD
• Introduction on External Trigger
Events
• Clarification on ISignal length of
external trigger event
• Editorial Changes

1 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• Added call/response context to Client


Server requirements
• Constraint added for data type of
length field of variable Strings
• Added E_E2E Error to Table 7.11:
Return Codes
• Requirement added in case
unvailability of optional member in
the received serialized byte stream
AUTOSAR • Reworked E2E communication
2020-11-30 R20-11 Release protection for methods
Management • sizeOfStringLengthField introduced
for the size of the length field for
dynamic length strings
• sizeOfArrayLengthField introduced
for the size of the length field for
variable size arrays
• Fixed design issues with E2E
communication protection for
methods
• Editorial Changes
• Extended Serialization for Data
Structures in SOME/IP with
tag/length/value encoding set to valid
• Removed *_ACK message types
• replaced
implementsSOMEIPStringHandling
AUTOSAR (in class
2019-11-28 R19-11 Release SOMEIPTransformationSignalProps)
Management with
implementsLegacyStringSerialization
• Minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
• Changed Document Status from
Final to published

2 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• Checking for length of received


dynamic length strings
AUTOSAR • Extended Serialization for Data
2018-10-31 4.4.0 Release Structures in SOME/IP with
Management tag/length/value encoding
• Minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
• Bugfixes in serialization of strings
AUTOSAR and data with variable size
2017-12-08 4.3.1 Release • Signatures improved
Management • Minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
• Sizes of length fields can be
configured independently from each
AUTOSAR other
2016-11-30 4.3.0 Release • Support of union data types
Management • Minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
• Size of length fields is configurable
• External trigger events are
communciated as fire-and-forget
AUTOSAR methods
2015-07-31 4.2.2 Release • Autonomous error reactions of
Management SOME/IP transformer
• Minor corrections / clarifications /
editorial changes; For details please
refer to the ChangeDocumentation
AUTOSAR
2014-10-31 4.2.1 Release Initial Release
Management

3 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Disclaimer
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.

4 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Table of Contents
1 Introduction and functional overview 7

2 Acronyms and Abbreviations 8

3 Related documentation 9
3.1 Input documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Related standards and norms . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Constraints and assumptions 11
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Dependencies to other modules 12
5.1 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.1 Code file structure . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.2 Header file structure . . . . . . . . . . . . . . . . . . . . . . . 12
6 Requirements Tracing 13

7 Functional specification 19
7.1 Definition of Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.2 Specification of the SOME/IP on-wire format . . . . . . . . . . . . . . . 23
7.2.1 Message Length Limitations . . . . . . . . . . . . . . . . . . 23
7.2.2 Endianess . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.2.3 Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.2.3.1 Message ID [32 bit] . . . . . . . . . . . . . . . . . . . 25
7.2.3.2 Length [32 bit] . . . . . . . . . . . . . . . . . . . . . . 26
7.2.3.3 Request ID [32 bit] . . . . . . . . . . . . . . . . . . . 26
7.2.3.4 Protocol Version [8 bit] . . . . . . . . . . . . . . . . . 27
7.2.3.5 Interface Version [8 bit] . . . . . . . . . . . . . . . . . 27
7.2.3.6 Message Type [8 bit] . . . . . . . . . . . . . . . . . . 28
7.2.3.7 Return Code [8 bit] . . . . . . . . . . . . . . . . . . . 28
7.2.3.8 Payload [variable size] . . . . . . . . . . . . . . . . . 29
7.2.4 Serialization of Parameters and Data Structures . . . . . . . 29
7.2.4.1 Basic Datatypes . . . . . . . . . . . . . . . . . . . . 31
7.2.4.2 Structured Datatypes (structs) . . . . . . . . . . . . . 31
7.2.4.3 Structured Datatypes and Arguments with Identifier
and optional Members . . . . . . . . . . . . . . . . . 34
7.2.4.4 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.2.4.5 Arrays (fixed length) . . . . . . . . . . . . . . . . . . 44
7.2.4.6 Optional Parameters / Optional Elements . . . . . . 47
7.2.4.7 Dynamic Length Arrays / Variable Size Arrays . . . . 47
7.2.4.8 Bitfield . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.2.4.9 Union / Variant . . . . . . . . . . . . . . . . . . . . . 50

5 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7.3 Protocol specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


7.3.1 Client/Server Communication . . . . . . . . . . . . . . . . . . 53
7.3.2 Sender/Receiver Communication . . . . . . . . . . . . . . . . 56
7.3.3 External Trigger Events . . . . . . . . . . . . . . . . . . . . . 57
7.3.4 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.3.4.1 Return Code . . . . . . . . . . . . . . . . . . . . . . 58
7.3.4.2 Communication Errors and Handling of Communica-
tion Errors . . . . . . . . . . . . . . . . . . . . . . . . 59
7.4 Reserved and special identifiers for SOME/IP and SOME/IP-SD. . . . 61
7.5 Error Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.5.1 Development Errors . . . . . . . . . . . . . . . . . . . . . . . 63
7.5.2 Runtime Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.5.3 Transient Faults . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.5.4 Production Errors . . . . . . . . . . . . . . . . . . . . . . . . 63
7.5.5 Extended Production Errors . . . . . . . . . . . . . . . . . . . 64
8 API specification 65
8.1 Imported types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.2 Type definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.3 Function definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.3.1 SomeIpXf_ExtractProtocolHeaderFields . . . . . . . . . . . . 65
8.3.2 SomeIpXf_<transformerId> . . . . . . . . . . . . . . . . . . . 67
8.3.3 SomeIpXf_Inv_<transformerId> . . . . . . . . . . . . . . . . 72
8.3.4 SomeIpXf_Init . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3.5 SomeIpXf_DeInit . . . . . . . . . . . . . . . . . . . . . . . . . 77
8.3.6 SomeIpXf_GetVersionInfo . . . . . . . . . . . . . . . . . . . 77
8.4 Callback notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.5 Scheduled functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.6 Expected interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9 Sequence diagrams 79

10 Configuration specification 80

A Referenced Meta Classes 81

B Features of SOME/IP not supported by AUTOSAR SOME/IP transformer 103

C Examples 103
C.1 Serialization of a Client/Server Operation . . . . . . . . . . . . . . . . . 104
C.1.1 Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
C.1.2 Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

6 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

1 Introduction and functional overview


This document specifies the Scalable service-Oriented MiddlewarE over IP
(SOME/IP) Transformer. This is a transformer which linearizes data with the SOME/IP
on-the-wire format and specifies an automotive/embedded mechanism for Clien-
t/Server communication.
The only valid abbreviation is SOME/IP. Other abbreviations (e.g. Some/IP) are wrong
and shall not be used.
The basic motivation to specify "yet another Client/Server and Sender/Receiver mech-
anism" instead of using an existing infrastructure/technology is the goal to have a tech-
nology that:
• Fulfills the hard requirements regarding resource consumption in an embedded
world
• Is compatible through as many use-cases and communication partners as possi-
ble
• Provides the features required by automotive use-cases
• Is scalable from tiny to large platforms
• Can be implemented on different operating system (i.e. AUTOSAR, GENIVI, and
OSEK) and even embedded devices without operating system

7 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

2 Acronyms and Abbreviations


The glossary below includes acronyms and abbreviations relevant to the SOME/IP
Transformer that are not included in the [1, AUTOSAR glossary].

Abbreviation / Acronym: Description:


The configuration and required data of a service instance another
Client-Service-Instance-Entry ECU offers shall be called Client-Service-Instance-Entry at the
ECU using this service (Client).
a field represents a status and thus has a valid value at all times
Field
on which getter, setter and notfier act upon.
to send a SOME/IP-SD message in order to find a needed ser-
Finding a service instance
vice instance.
Getter a Request/Response call that allows read access to a field.
a method, procedure, function, or subroutine that is called/in-
Method
voked
sends out event message with a new value on change of the
Notifier
value of the field.
Request a message of the client to the server invoking a method
a message of the server to the client transporting results of a
Response
method invocation
SD Service Discovery (see[2])
a logical combination of zero or more methods, zero or more
Service events, and zero or more fields (empty service is allowed, e.g.
for announcing non-SOME/IP services in SOME/IP-SD)
software implementation of the service interface, which can exist
Service Instance
more than once in the vehicle and more than once on an ECU
the formal specification of the service including its methods,
Service Interface
events, and fields
Setter a Request/Response call that allows write access to a field.
Scalable service-Oriented MiddlewarE over IP
SOME/IP

8 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

3 Related documentation

3.1 Input documents

References
[1] Glossary
AUTOSAR_TR_Glossary
[2] Specification of Service Discovery
AUTOSAR_SWS_ServiceDiscovery
[3] General Specification of Transformers
AUTOSAR_ASWS_TransformerGeneral
[4] Specification of Socket Adaptor
AUTOSAR_SWS_SocketAdaptor
[5] Specification of RTE Software
AUTOSAR_SWS_RTE
[6] Requirements on AUTOSAR Features
AUTOSAR_RS_Features
[7] System Template
AUTOSAR_TPS_SystemTemplate
[8] Specification of Platform Types
AUTOSAR_SWS_PlatformTypes
[9] Software Component Template
AUTOSAR_TPS_SoftwareComponentTemplate
[10] Requirements on Transformer
AUTOSAR_SRS_Transformer
[11] UTF-8, a transformation format of ISO 10646
http://www.ietf.org/rfc/rfc3629.txt
[12] UTF-16, an encoding of ISO 10646
http://www.ietf.org/rfc/rfc2781.txt
[13] SOME/IP Protocol Specification
AUTOSAR_PRS_SOMEIPProtocol
[14] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[15] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral

9 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

3.2 Related standards and norms


Not applicable.

3.3 Related specification


AUTOSAR provides a General Specification on Transformers [3, ASWS Transformer
General], which is also valid for SOME/IP Transformer.
Thus, the specification SWS Transformer General shall be considered as additional
and required specification for SOME/IP Transformer.

10 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4 Constraints and assumptions

4.1 Limitations
For the SOME/IP Transformer all general transformer limitations (see [3, ASWS Trans-
former General]) apply.
The SOME/IP transformer doesn’t implement the whole SOME/IP protocol:
• a part is implemented by [2, SWS Service Discovery]
• a part is implemented by [4, SWS Socket Adaptor]
• a part is currently not implemented in AUTOSAR. This is documented in Ap-
pendix B
• The processing order of header fields in AUTOSAR CP deviates from the pro-
cessing order defined in [PRS_SOMEIP_00195] (also Figure 4.21: Message Val-
idation and Error Handling in SOME/IP). This deviation is caused by the layered
architecture of AUTOSAR CP.
[SWS_SomeIpXf_CONSTR_0001] dIn accordance with [SWS_SomeIpXf_00245],
2ˆ(8*sizeof(data type of length field)) shall be larger than the number of elements given
by the size indicator multiplied by the size in bytes of each element (i.e., 1 for UTF-8
and 2 for UTF-16) and increased by the size in bytes required by the BOM.c(SRS_-
Xfrm_00101)
[SWS_SomeIpXf_CONSTR_0002] dSerialization based on the network representa-
tion according to [TPS_SYST_02136] is currently not supported in combination with
structured datatypes and arguments with identifier and optional members, strings, dy-
namic length arrays / variable size arrays, and unions / variants and shall therefore not
be used in those combinations.c(SRS_Xfrm_00101)
Note:
Optional members according to section 7.2.4.3, Strings according to section 7.2.4.4.1
and 7.2.4.4.2, Dynamic Length Arrays / Variable Size Arrays according to section
7.2.4.7 and Unions / Variants according to section 7.2.4.9.

4.2 Applicability to car domains


The SOME/IP Transformer can be used for all domain applications when SOME/IP
Sender/Receiver or Client/Server communication is used.

11 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

5 Dependencies to other modules


The AUTOSAR RTE [5, SWS RTE] has to exist to execute the transformer.

5.1 File structure

5.1.1 Code file structure

The source code file structure is defined in the [3, ASWS Transformer General].

5.1.2 Header file structure

[SWS_SomeIpXf_00136] dThe header file SomeIpXf[_<Ie>].h shall be the main


include file for the SOME/IP transformer and include TransformerTypes.h and its
Module Interlink Header file SchM_<bsnp>_[<vi>_<ai>].h.
where
<Ie> is the optional implementation specific file name extension according [SWS_-
BSW_00103],
<bsnp> is the BSW Scheduler Name Prefix according [SWS_Rte_07593] and [SWS_-
Rte_07594],
<vi> is the vendorId of the BSW module and
<ai> is the vendorApiInfix of the BSW module.c(SRS_BSW_00346)
The file TransformerTypes.h contains the general transformer data types.

12 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

6 Requirements Tracing
The following table references the features specified in [6] and links to the fulfillments
of these.
Feature Description Satisfied by
[SRS_BSW_00159] All modules of the [SWS_SomeIpXf_00185]
AUTOSAR Basic
Software shall
support a tool based
configuration
[SRS_BSW_00337] Classification of [SWS_SomeIPxf_00184]
development errors
[SRS_BSW_00346] All AUTOSAR Basic [SWS_SomeIpXf_00136]
Software Modules
shall provide at least
a basic set of
module files
[SRS_BSW_00404] BSW Modules shall [SWS_SomeIpXf_00183]
support post-build
configuration
[SRS_BSW_00407] Each BSW module [SWS_SomeIpXf_00180]
shall provide a [SWS_SomeIpXf_00181]
function to read out [SWS_SomeIpXf_00182]
the version
information of a
dedicated module
implementation
[SRS_BSW_00411] All AUTOSAR Basic [SWS_SomeIpXf_00180]
Software Modules [SWS_SomeIpXf_00181]
shall apply a naming [SWS_SomeIpXf_00182]
rule for enabling/
disabling the
existence of the API
[SRS_BSW_00441] Naming convention [SWS_SomeIpXf_00183]
for type, macro and
function
[SRS_Xfrm_00001] A transformer shall [SWS_SomeIpXf_00264]
work on data given [SWS_SomeIpXf_00265]
by the Rte [SWS_SomeIpXf_00266]

13 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SRS_Xfrm_00002] A transformer shall [SWS_SomeIpXf_00206]


provide fixed [SWS_SomeIpXf_00207]
interfaces [SWS_SomeIpXf_00208]
[SWS_SomeIpXf_00209]
[SWS_SomeIpXf_00210]
[SWS_SomeIpXf_00211]
[SWS_SomeIpXf_00296]
[SWS_SomeIpXf_00297]
[SWS_SomeIpXf_00298]
[SWS_SomeIpXf_00299]
[SWS_SomeIpXf_00301]
[SWS_SomeIpXf_00302]
[SWS_SomeIpXf_00303]
[SWS_SomeIpXf_00304]
[SWS_SomeIpXf_00305]
[SWS_SomeIpXf_91001]
[SRS_Xfrm_00004] A transformer shall [SWS_SomeIpXf_00264]
support error [SWS_SomeIpXf_00265]
handling [SWS_SomeIpXf_00266]
[SRS_Xfrm_00008] A transformer shall [SWS_SomeIpXf_00001]
specify its output [SWS_SomeIpXf_00002]
format [SWS_SomeIpXf_00005]
[SWS_SomeIpXf_00006]
[SWS_SomeIpXf_00007]
[SWS_SomeIpXf_00009]
[SWS_SomeIpXf_00010]
[SWS_SomeIpXf_00011]
[SWS_SomeIpXf_00013]
[SWS_SomeIpXf_00015]
[SWS_SomeIpXf_00024]
[SWS_SomeIpXf_00025]
[SWS_SomeIpXf_00026]
[SWS_SomeIpXf_00029]
[SWS_SomeIpXf_00030]
[SWS_SomeIpXf_00031]
[SWS_SomeIpXf_00033]
[SWS_SomeIpXf_00130]
[SWS_SomeIpXf_00131]
[SWS_SomeIpXf_00132]
[SWS_SomeIpXf_00133]
[SWS_SomeIpXf_00134]
[SWS_SomeIpXf_00152]
[SWS_SomeIpXf_00154]

14 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00155]
[SWS_SomeIpXf_00156]
[SWS_SomeIpXf_00160]
[SWS_SomeIpXf_00161]
[SWS_SomeIpXf_00163]
[SWS_SomeIpXf_00164]
[SWS_SomeIpXf_00165]
[SWS_SomeIpXf_00166]
[SWS_SomeIpXf_00168]
[SWS_SomeIpXf_00172]
[SWS_SomeIpXf_00212]
[SWS_SomeIpXf_00213]
[SWS_SomeIpXf_00234]
[SWS_SomeIpXf_00235]
[SWS_SomeIpXf_00236]
[SWS_SomeIpXf_00237]
[SWS_SomeIpXf_00238]
[SRS_Xfrm_00101] The SOME/IP [SWS_SomeIpXf_00016]
Transformer shall [SWS_SomeIpXf_00017]
define the [SWS_SomeIpXf_00034]
serialization of [SWS_SomeIpXf_00036]
atomic and [SWS_SomeIpXf_00037]
structured data [SWS_SomeIpXf_00042]
elements into linear [SWS_SomeIpXf_00053]
arrays [SWS_SomeIpXf_00054]
[SWS_SomeIpXf_00055]
[SWS_SomeIpXf_00056]
[SWS_SomeIpXf_00057]
[SWS_SomeIpXf_00058]
[SWS_SomeIpXf_00059]
[SWS_SomeIpXf_00060]
[SWS_SomeIpXf_00069]
[SWS_SomeIpXf_00070]
[SWS_SomeIpXf_00072]
[SWS_SomeIpXf_00076]
[SWS_SomeIpXf_00088]
[SWS_SomeIpXf_00098]
[SWS_SomeIpXf_00099]
[SWS_SomeIpXf_00151]
[SWS_SomeIpXf_00169]
[SWS_SomeIpXf_00216]

15 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00217]
[SWS_SomeIpXf_00218]
[SWS_SomeIpXf_00219]
[SWS_SomeIpXf_00220]
[SWS_SomeIpXf_00221]
[SWS_SomeIpXf_00222]
[SWS_SomeIpXf_00223]
[SWS_SomeIpXf_00224]
[SWS_SomeIpXf_00225]
[SWS_SomeIpXf_00226]
[SWS_SomeIpXf_00227]
[SWS_SomeIpXf_00234]
[SWS_SomeIpXf_00235]
[SWS_SomeIpXf_00236]
[SWS_SomeIpXf_00237]
[SWS_SomeIpXf_00238]
[SWS_SomeIpXf_00239]
[SWS_SomeIpXf_00240]
[SWS_SomeIpXf_00241]
[SWS_SomeIpXf_00242]
[SWS_SomeIpXf_00243]
[SWS_SomeIpXf_00244]
[SWS_SomeIpXf_00245]
[SWS_SomeIpXf_00246]
[SWS_SomeIpXf_00247]
[SWS_SomeIpXf_00248]
[SWS_SomeIpXf_00249]
[SWS_SomeIpXf_00250]
[SWS_SomeIpXf_00251]
[SWS_SomeIpXf_00252]
[SWS_SomeIpXf_00253]
[SWS_SomeIpXf_00254]
[SWS_SomeIpXf_00256]
[SWS_SomeIpXf_00257]
[SWS_SomeIpXf_00258]
[SWS_SomeIpXf_00259]
[SWS_SomeIpXf_00260]
[SWS_SomeIpXf_00262]
[SWS_SomeIpXf_00263]
[SWS_SomeIpXf_00306]
[SWS_SomeIpXf_00307]
[SWS_SomeIpXf_CONSTR_0001]
[SWS_SomeIpXf_CONSTR_0002]

16 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SRS_Xfrm_00102] The SOME/IP [SWS_SomeIpXf_00106]


Transformer shall [SWS_SomeIpXf_00107]
define a protocol for [SWS_SomeIpXf_00108]
inter-ECU Client/ [SWS_SomeIpXf_00111]
Server [SWS_SomeIpXf_00112]
communication [SWS_SomeIpXf_00113]
[SWS_SomeIpXf_00115]
[SWS_SomeIpXf_00120]
[SWS_SomeIpXf_00121]
[SWS_SomeIpXf_00170]
[SWS_SomeIpXf_00176]
[SWS_SomeIpXf_00200]
[SWS_SomeIpXf_00201]
[SWS_SomeIpXf_00202]
[SWS_SomeIpXf_00204]
[SWS_SomeIpXf_00205]
[SRS_Xfrm_00103] The SOME/IP [SWS_SomeIpXf_00111]
Transformer shall
support exception
notification of
applications
[SRS_Xfrm_00105] The SOME/IP [SWS_SomeIpXf_00203]
Transformer shall
support autonomous
error reactions on
the server side for
client/server
communication
[SRS_Xfrm_00106] The SOME/IP [SWS_SomeIpXf_00267]
Transformer shall [SWS_SomeIpXf_00268]
support serialization [SWS_SomeIpXf_00269]
of extensible data [SWS_SomeIpXf_00270]
structs and methods [SWS_SomeIpXf_00271]
[SWS_SomeIpXf_00272]
[SWS_SomeIpXf_00273]
[SWS_SomeIpXf_00274]
[SWS_SomeIpXf_00275]
[SWS_SomeIpXf_00276]
[SWS_SomeIpXf_00277]
[SWS_SomeIpXf_00278]
[SWS_SomeIpXf_00279]
[SWS_SomeIpXf_00280]
[SWS_SomeIpXf_00281]
[SWS_SomeIpXf_00282]
[SWS_SomeIpXf_00283]
[SWS_SomeIpXf_00284]
[SWS_SomeIpXf_00285]
[SWS_SomeIpXf_00286]
[SWS_SomeIpXf_00287]
[SWS_SomeIpXf_00288]
[SWS_SomeIpXf_00289]
[SWS_SomeIpXf_00290]

17 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00291]
[SWS_SomeIpXf_00292]
[SWS_SomeIpXf_00293]
[SWS_SomeIpXf_00294]
[SWS_SomeIpXf_00295]

18 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7 Functional specification

ECU 1 Sending Application ECU 2 Receiving Application


SWC SWC

SOME/IP RTE SOME/IP


RTE
Serializer Deserializer

Com Com

Figure 7.1: Overview of SOME/IP Transformer

When a SWC initiates an inter-ECU communication which is configured to be trans-


formed, the SWC hands the data over to the RTE. The RTE executes the configured
transformer chain which contains the SOME/IP Transformer (A transformer chain may
contain also other transformers but this is omitted in this overview for simplicity).
The SOME/IP Transformer on the sender side serializes the data of the SWC and
brings them into an linear form. The serialized data are sent via the communication
stack over the bus to the receiver(s). The RTE of the receiver executes the transformer
chain in the reverse order. The SOME/IP transformer of the receiver deserializes the
linear data back into the original data structure. These are handed over to the receiving
SWC.
From the SWC’s point of view it is totally transparent whether data are transformed or
not.
The SOME/IP transformer is a transformer of the class Serializer. It serializes struc-
tured data into a linear form. Therefore it can only be used as the first transformer on
the sending side and the last transformer on the receiving side (in execution order).
Furthermore it provides the transformer errors specified for this transformer class and
supports only out-of-place buffer handling.

19 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

The SOME/IP Transformer has no module specific EcuC because its whole configu-
ration is based on the SOMEIPTransformationDescription and SOMEIPTrans-
formationISignalProps.
Identifiable
TransformationTechnology

+ hasInternalState: Boolean [0..1]


+ needsOriginalData: Boolean [0..1]
+ protocol: String
+ transformerClass: TransformerClassEnum
+ version: String

+transformer 1

FibexElement «atpVariation»
ISignal
+transformationDescription 0..1
+ dataTypePolicy: DataTypePolicyEnum
+ iSignalType: ISignalTypeEnum [0..1] Describable
+ length: UnlimitedInteger TransformationDescription

+transformationISignalProps 0..*

Describable
«atpVariation»
TransformationISignalProps SOMEIPTransformationDescription

+ csErrorReaction: CSTransformerErrorReactionEnum [0..1] + alignment: PositiveInteger


+ byteOrder: ByteOrderEnum
+ interfaceVersion: PositiveInteger

SOMEIPTransformationISignalProps
«enumeration»
+ implementsLegacyStringSerialization: Boolean [0..1] CSTransformerErrorReactionEnum
+ interfaceVersion: PositiveInteger [0..1]
+ isDynamicLengthFieldSize: Boolean [0..1] autonomous
+ messageType: SOMEIPMessageTypeEnum [0..1] applicationOnly
+ sessionHandlingSR: SOMEIPTransformerSessionHandlingEnum [0..1]
+ sizeOfArrayLengthFields: PositiveInteger [0..1]
+ sizeOfStringLengthFields: PositiveInteger [0..1]
+ sizeOfStructLengthFields: PositiveInteger [0..1]
+ sizeOfUnionLengthFields: PositiveInteger [0..1]

«enumeration»
SOMEIPTransformerSessionHandlingEnum
«enumeration»
«enumeration» sessionHandlingActive
SOMEIPMessageTypeEnum
ByteOrderEnum sessionHandlingInactive
Attributes
Attributes
+ request
+ mostSignificantByteFirst
+ requestNoReturn
+ mostSignificantByteLast
+ notification
+ opaque
+ response

Figure 7.2: SOME/IP specific configuration

Class SOMEIPTransformationDescription
Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note The SOMEIPTransformationDescription is used to specify SOME/IP transformer specific attributes.
Base ARObject, Describable, TransformationDescription
Attribute Type Mult. Kind Note
alignment PositiveInteger 1 attr Defines the padding for alignment purposes that will be
added by the SOME/IP transformer after the serialized
data of the variable data length data element. The
alignment shall be specified in Bits.
byteOrder ByteOrderEnum 1 attr Defines which byte order shall be serialized by the
SOME/IP transformer
interfaceVersion PositiveInteger 1 attr The interface version the SOME/IP transformer shall use.

Table 7.1: SOMEIPTransformationDescription

20 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Class <<atpVariation>> SOMEIPTransformationISignalProps


Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note The class SOMEIPTransformationISignalProps specifies ISignal specific configuration properties for
SOME/IP transformer attributes.
Base ARObject, Describable, TransformationISignalProps
Attribute Type Mult. Kind Note
implements Boolean 0..1 attr This attribute indicates that Strings in the SOME/IP
LegacyString message shall NOT be serialized according to the SOME/
Serialization IP specification for Strings.
If this attribute is set to true, BOM and null-termination
shall NOT be added in the serialization for Strings in the
payload. If this attribute is set to false (or not set) BOM
and null-termination shall be added in the serialization for
Strings in the payload according to the SOME/IP
specification for Strings.
NOTE! This attribute is not future safe, and will be
removed in an upcoming AUTOSAR release!"
interfaceVersion PositiveInteger 0..1 attr The interface version the SOME/IP transformer shall use.
isDynamic Boolean 0..1 attr This attribute shall be used to determine the wire type in
LengthFieldSize the context of using the TLV encoding.
messageType SOMEIPMessageType 0..1 attr The Message Type which shall be placed into the SOME/
Enum IP header.
session SOMEIPTransformer 0..1 attr Defines whether the SOME/IP transformer shall use
HandlingSR SessionHandlingEnum session handling for Sender/Receiver communication.
sizeOfArray PositiveInteger 0..1 attr The size of all length fields (in Bytes) of fixed-size arrays
LengthFields or dynamic size arrays in the SOME/IP message. This
attribute is valid for all available occurrences of fixed-size
arrays or dynamic size arrays in the SOME/IP message.
sizeOfString PositiveInteger 0..1 attr The size of all length fields (in Bytes) of dynamic length
LengthFields strings in the SOME/IP message. This attribute is valid for
all available occurrences of strings in the SOME/IP
message.
sizeOfStruct PositiveInteger 0..1 attr The size of all length fields (in Bytes) of structs in the
LengthFields SOME/IP message. This attribute is valid for all available
occurrences of structures in the SOME/IP message. For
a more fine granular modeling on the level of Data
Prototypes the DataPrototypeTransformationProps shall
be used.
sizeOfUnion PositiveInteger 0..1 attr The size of all length fields (in Bytes) of unions in the
LengthFields SOME/IP message. This attribute is valid for all available
occurrences of Unions in the SOME/IP message. For a
more fine granular modeling on the level of Data
Prototypes the DataPrototypeTransformationProps shall
be used.
tlvDataId TlvDataIdDefinitionSet * ref This reference identifies the TlvDataIdDefinitions relevant
Definition for the enclosing SOMEIPTransformationISignalProps

Table 7.2: SOMEIPTransformationISignalProps

Enumeration ByteOrderEnum
Package M2::AUTOSARTemplates::GenericStructure::GeneralTemplateClasses::PrimitiveTypes
Note When more than one byte is stored in the memory the order of those bytes may differ depending on
the architecture of the processing unit. If the least significant byte is stored at the lowest address, this
architecture is called little endian and otherwise it is called big endian.
ByteOrder is very important in case of communication between different PUs or ECUs.
5

21 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Enumeration ByteOrderEnum
Literal Description
mostSignificantByte Most significant byte shall come at the lowest address (also known as BigEndian or as
First Motorola-Format)
Tags:atp.EnumerationLiteralIndex=0
mostSignificantByte Most significant byte shall come highest address (also known as LittleEndian or as Intel-Format)
Last
Tags:atp.EnumerationLiteralIndex=1
opaque For opaque data endianness conversion has to be configured to Opaque. See AUTOSAR COM
Specification for more details.
Tags:atp.EnumerationLiteralIndex=2

Table 7.3: ByteOrderEnum

Enumeration SOMEIPMessageTypeEnum
Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note Depending on the style of the communication different message types shall be set in the header of a
SOME/IP message.
Literal Description
notification A request of a notification expecting no response.
Tags:atp.EnumerationLiteralIndex=1
request A request expecting a response.
Tags:atp.EnumerationLiteralIndex=2
requestNoReturn A fire&forget request.
Tags:atp.EnumerationLiteralIndex=3
response The response message.
Tags:atp.EnumerationLiteralIndex=4

Table 7.4: SOMEIPMessageTypeEnum

[SWS_SomeIpXf_00151] dThe SOME/IP transformer defined in this document shall


be used as a transformer if
• the attribute protocol of the TransformationTechnology is set to SOMEIP
• and the attribute version of the TransformationTechnology is set to 1
• and the attribute transformerClass of the TransformationTechnology is
set to serializer
c(SRS_Xfrm_00101)

7.1 Definition of Identifiers


[SWS_SomeIpXf_00001] dA service shall be identified using the Service-ID.c(SRS_-
Xfrm_00008)
[SWS_SomeIpXf_00002] dService-IDs shall be of type 16 bit length unsigned integer
(uint16).c(SRS_Xfrm_00008)

22 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

The Service-ID of 0xFFFE shall be used to encode non-SOME/IP services. See


[SWS_SomeIpXf_00130].
[SWS_SomeIpXf_00005] dDifferent services within the same vehicle shall have differ-
ent Service-IDs.c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00006] dA service instance shall be identified using the Service-
Instance-ID.c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00007] dService-Instance-IDs shall be of type 16 bit length un-
signed integer (uint16).c(SRS_Xfrm_00008)
The Service-Instance-IDs of 0x0000 and 0xFFFF shall not be used for a service,
since 0x0000 is reserved and 0xFFFF is used to describe all service instances. See
[SWS_SomeIpXf_00130].
[SWS_SomeIpXf_00009] dDifferent service instances within the same vehicle shall
have different Service-Instance-IDs.c(SRS_Xfrm_00008)
Note:
This means that two different camera services shall have two different ServiceInstance-
IDs SI-ID-1 and SI-ID-2. For one AUTOSAR system (that designs a vehicle product
line) SI-ID-1 shall be the same for all vehicles. The same is true for SI-ID-2. If consid-
ering another AUTOSAR system (that designs another vehicle product line), different
IDs may be used but it makes sense to use the same IDs among different AUTOSAR
systems for ease in testing and integration.
[SWS_SomeIpXf_00010] dMethods and events shall be identified inside a service us-
ing a 16bit Method-ID, which is called Event-ID for events and notifications.c(SRS_-
Xfrm_00008)
[SWS_SomeIpXf_00011] dMethods shall use Method-IDs with the highest bit set to 0,
while the Method-IDs highest bit shall be set to 1 for events and notifications of fields.c
(SRS_Xfrm_00008)

7.2 Specification of the SOME/IP on-wire format


Serialization describes the way data is represented in protocol data units (PDUs) trans-
ported over an automotive in-vehicle network.

7.2.1 Message Length Limitations

The usage of TCP allows for larger streams of data to transport SOME/IP header and
payload. However, current transport protocols for CAN and FlexRay limit messages
to 4095 Bytes. When compatibility to those has to be achieved, SOME/IP messages
including the SOME/IP header shall not exceed 4095 Bytes.

23 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7.2.2 Endianess

[SWS_SomeIpXf_00013] dAll headers shall be encoded in network byte order Big


Endian (MostSignificantByteFirst) [RFC 791].c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00172] dThe byte order of the parameters inside the payload
shall be defined by byteOrder of SOMEIPTransformationDescription.c(SRS_-
Xfrm_00008)

7.2.3 Header

[SWS_SomeIpXf_00152] dFor interoperability reasons the header layout shall be iden-


tical for all implementations of SOME/IP and is described as follows:
1. Message ID (Service ID / Method ID) [32 bit]
2. Length [32 bit]
3. Additional information:
(a) Protocol Version [8 bit]
(b) Interface Version [8 bit]
(c) Message Type [8 bit]
(d) Return Code [8 bit]
4. Payload [variable size]
The fields are presented in transmission order; i.e. the fields on the top are transmit-
ted first. In the following sections the different header fields and their usage is being
described.c(SRS_Xfrm_00008)
Note:
Layout is also shown in Figure 7.3.

24 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 bit offset

Message ID (Service ID / Method ID) [32 bit]

Length [32 bit]

Request ID (Client ID / Session ID) [32 bit]

Covered by Length
Protocol Version [8 bit] Interface Version [8 bit] Message Type [8 bit] Return Code [8 bit]

Payload [variable size]

Figure 7.3: SOME/IP Header Format

Figure 7.3 shows the complete SOME/IP header. The SOME/IP transformer only
implements the lower part (all except Message ID and Length).
[SWS_SomeIpXf_00015] dThe SOME/IP transformer shall implement all fields of the
header except Message ID and Length.c(SRS_Xfrm_00008)
Rationale:
Message-ID and Length are not covered since this allows the AUTOSAR Socket Adap-
tor header mode to work.
These are added by other modules in the AUTOSAR BSW. Nonetheless they are con-
tained in Figure 7.3 to show the whole on-wire-format.

7.2.3.1 Message ID [32 bit]

The Message ID is a 32 bit identifier that is used to identify the message. The Message
ID has to uniquely identify a method or event of a service.
The assignment of the Message ID is up to the user; however, the Message ID has
to be unique for the whole system (i.e. the vehicle). The Message ID can be best
compared to a CAN ID and should be handled with a comparable process. The next
section 7.2.3.1.1 describes how to structure the Message IDs in order to ease the
organization of Message IDs.

7.2.3.1.1 Structure of the Message ID

In order to structure the different methods, events, and fields, they are clustered into
services. Services have a set of methods, events, and fields as well as a Service ID,
which is only used for this service.

25 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

An event shall be part of zero to many eventgroups and an eventgroup shall contain
zero to many events. A field shall be part of zero to many eventgroups and an event-
group can contain zero to many fields.
For inter-ECU Client/Server communication calls we structure the ID in 216 services
with 215 methods:
Service ID [16 bit] 0 [1 bit] Method ID [last 15 bits]

where the 0-Bit is the first bit of the 16 bit Method ID.
With 16 bit Service-ID and a 16 bit Method-ID starting with a 0-Bit (15 bit are still left
in the Method-ID for real values), this allows for up to 65536 services with up to 32768
methods each.
Since events and notifications are transported using Client/Server communication, the
ID space for the events is further structured:

Service ID [16 bit] 1 [1 bit] Event ID [last 15 bits]

where the 1-Bit is the first bit of the 16 bit Method ID.
This means that up to 32768 events or notifications per service are possible.

7.2.3.2 Length [32 bit]

The Length field is 32 bit long and contains the length in Byte of the payload beginning
with the Request ID/Client ID until the end of the SOME/IP-message.

7.2.3.3 Request ID [32 bit]

[SWS_SomeIpXf_00154] dThe Request ID field shall be 32 bit long.c(SRS_Xfrm_-


00008)
The Request ID shall be the unique identifier for the calling client inside the ECU. Its
values are chosen by the RTE and handed over to the SOME/IP transformer.
[SWS_SomeIpXf_00024] dThe Request ID shall be constructed of the Client ID and
Session ID as shown in Table 7.5.c(SRS_Xfrm_00008)

Client ID [16 bits] Session ID [16 bits]

Table 7.5: Construction of Request ID

Both are chosen by RTE and handed over to the transformer as


Rte_Cs_TransactionHandleType.

26 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00025] dThe clientId inside the


Rte_Cs_TransactionHandleType handed over from RTE shall be used for
the value of the Client ID.c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00026] dThe sequenceCounter inside the
Rte_Cs_TransactionHandleType handed over from RTE shall be used for
the value of the Session ID.c(SRS_Xfrm_00008)
For details of Rte_Cs_TransactionHandleType see [SWS_Rte_08732].
The Request ID allows a client to differentiate multiple calls to the same method. There-
fore, the Request ID has to be unique for a single client and server combination only.
When generating a response message, the server has to copy the Request ID from
the request to the response message. This allows the client to map a response to the
issued request even with more than one request outstanding.
Request IDs may be reused as soon as the response arrived or is not expected to
arrive anymore (timeout).

7.2.3.4 Protocol Version [8 bit]

[SWS_SomeIpXf_00155] dThe Protocol Version field shall be 8 bit long.c(SRS_Xfrm_-


00008)
[SWS_SomeIpXf_00156] dThe Protocol Version field shall contain the SOME/IP pro-
tocol version.c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00029] dThe Protocol Version shall be set to 0x01.c(SRS_Xfrm_-
00008)

7.2.3.5 Interface Version [8 bit]

[SWS_SomeIpXf_00030] dThe Interface Version field shall be 8 bit long.c(SRS_Xfrm_-


00008)
[SWS_SomeIpXf_00160] dThe Interface Version field shall contain the Version of the
Service Interface.c(SRS_Xfrm_00008)
Rationale: This is required to catch mismatches in Service definitions and allows de-
bugging tools to identify the Service Interface used, if version is used.
Note:
The Version of the corresponding Service Discovery service has to match the
version of the Service Interface, i.e. SdServerServiceMajorVersion and/or
SdClientServiceMajorVersion has to match the used SOMEIPTransforma-
tionDescription.interfaceVersion and/or SOMEIPTransformationISig-
nalProps.interfaceVersion (see [TPS_SYST_02377]).

27 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7.2.3.6 Message Type [8 bit]

[SWS_SomeIpXf_00161] dThe Message Type field shall be 8 bit long.c(SRS_Xfrm_-


00008)
The Message Type field is used to differentiate different types of messages.
[SWS_SomeIpXf_00031] dThe Message Type field shall be filled with one of the values
of Table 7.6.c(SRS_Xfrm_00008)

Number Value Description


0x00 REQUEST A request expecting a response (even
void)
0x01 REQUEST_NO_RETURN A fire&forget request
0x02 NOTIFICATION A request of a notification expecting no
response
0x80 RESPONSE The response message
0x81 ERROR The response containing an error

Table 7.6: Message Types

A regular client request (message type 0x00) is answered by a server response (mes-
sage type 0x80), when no error occurred. If errors occur an error message (message
type 0x81) will be sent.
For updating values through notification a callback interface exists (message type
0x02).
It is possible to send a request that does not have a response message (message type
0x01) to use SOME/IP for AUTOSAR Sender/Receiver communication.

7.2.3.7 Return Code [8 bit]

[SWS_SomeIpXf_00163] dThe Return Code field shall be 8 bit long.c(SRS_Xfrm_-


00008)
[SWS_SomeIpXf_00164] dThe Return Code field shall be used to signal whether a
request has been successfully processed.c(SRS_Xfrm_00008)
For simplification of the header layout, every message transports the field Return Code.
The Return Codes are specified in detail in [SWS_SomeIpXf_00115].
[SWS_SomeIpXf_00033] dMessages of Type REQUEST, REQUEST_NO_RETURN,
and Notification have to set the Return Code to 0x00 (E_OK).c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00168] dThe allowed Return Codes for specific message types are
specified in Table 7.7.c(SRS_Xfrm_00008)

Message Type Allowed Return Codes


REQUEST N/A, set to 0x00 (E_OK)

28 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

REQUEST_NO_RETURN N/A, set to 0x00 (E_OK)


NOTIFICATION N/A, set to 0x00 (E_OK)
RESPONSE See Return Codes in [SWS_SomeIpXf_00115].

Table 7.7: Return Codes

7.2.3.8 Payload [variable size]

[SWS_SomeIpXf_00165] dThe Payload field shall have variable size.c(SRS_Xfrm_-


00008)
[SWS_SomeIpXf_00166] dThe Payload field shall contain the transported data.c
(SRS_Xfrm_00008)
The serialization of the data will be specified in the following section.

7.2.4 Serialization of Parameters and Data Structures

[SWS_SomeIpXf_00034] dThe serialization shall be based on the Sender-


ReceiverInterface or ClientServerInterface of the data.c(SRS_Xfrm_-
00101)
[SWS_SomeIpXf_00169] dTo allow migration the deserialization shall ignore parame-
ters attached to the end of previously known parameter list.c(SRS_Xfrm_00101)
This means: Parameters that were not defined in the ClientServerInterface or
SenderReceiverInterface used to generate or parameterize the deserialization
code at the end of the serialized data will be ignored by the deserialization.
[SWS_SomeIpXf_00259] dAfter the serialized data of a variable data length Dat-
aPrototype a padding for alignment purposes shall be added for the configured
alignment (see [SWS_SomeIpXf_00260] and [SWS_SomeIpXf_00262]) if the variable
data length DataPrototype is not the last element in the serialized data stream. This
requirement does not apply for the serialization of extensible structs and methods.c
(SRS_Xfrm_00101)
Note:
See also chapter 7.2.4.3.
[SWS_SomeIpXf_00260] dIf SOMEIPTransformationProps.alignment is set for
a variable data length data element, the value of SOMEIPTransformationProps.
alignment defines the alignment. This requirement does not apply for the serializa-
tion of extensible structs and methods .c(SRS_Xfrm_00101)
Note:
See also chapter 7.2.4.3.

29 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00262] dIf SOMEIPTransformationProps.alignment is not set


for a variable data length data element, the value of SOMEIPTransformationDe-
scription.alignment defines the alignment. This requirement does not apply for
the serialization of extensible structs and methods.c(SRS_Xfrm_00101)
Note:
See also chapter 7.2.4.3.
[SWS_SomeIpXf_00263] dAfter serialized fixed data length data elements, the
SOME/IP transformer shall never add automatically a padding for alignment.c(SRS_-
Xfrm_00101)
Note:
If the following data element shall be aligned, a padding element of accord-
ing size needs to be explicitly inserted into the ImplementationDataType
(in case of serialization based on ImplementationDataTypes according to
[SWS_SomeIpXf_00307]) or into the AutosarDataType (in case of serialization
based on NetworkRepresentation according to [SWS_SomeIpXf_00306]).
[SWS_SomeIpXf_00037] dAlignment shall always be calculated from start of SOME/IP
message.c(SRS_Xfrm_00101)
This attribute defines the memory alignment. The SOME/IP Transformer does not try
to automatically align parameters but aligns as specified. The alignment is currently
constraint to multiple of 1 Byte to simplify code generators.
SOME/IP payload should be placed in memory so that the SOME/IP payload is suit-
able aligned. For infotainment ECUs an alignment of 8 Bytes (i.e. 64 bits) should be
achieved, for all ECU at least an alignment of 4 Bytes should be achieved. An efficient
alignment is highly hardware dependent.
[SWS_SomeIpXf_00016] dIf more data than expected are handed over to the
SOME/IP transformer during deserialization of data, the unexpected data shall be dis-
carded. The known fraction shall be considered.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00017] dIf less data than expected are handed over to the SOME/IP
transformer during deserialization of data, the following shall happen:
• if for the corresponding ISignal an initial value is specified (in serialized form)
use the value to fill the missing elements at the end of the serialized stream.
• if no initial value is available abort deserialization with
E_SER_MALFORMED_MESSAGE.
c(SRS_Xfrm_00101)
Missing data can only be recognized by comparing the length of received serialized
data with the expected length of the data. [SWS_SomeIpXf_00017] enables extensions
of data by adding elements to the end and achieve backward compatibility of an ECU
with older boardnet layouts that are missing those data.
In the following the serialization of different parameters is specified.

30 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00306] Serialization based on NetworkRepresentation dIf a


networkRepresentationProps is defined according to [TPS_SYST_02136] on the
ISignal, then the SOME/IP serialization shall be based on the networkRepresen-
tationProps.c(SRS_Xfrm_00101)
Note:
For details refer to chapter Network Representation in [7].
[SWS_SomeIpXf_00307] Serialization based on ImplementationDataTypes dIf no
networkRepresentationProps is defined on the ISignal, then (according to
[TPS_SYST_02137]) the SOME/IP serialization shall be based on the Implementa-
tionDataTypes.c(SRS_Xfrm_00101)

7.2.4.1 Basic Datatypes

[SWS_SomeIpXf_00036] dThe SwBaseTypes defined in [8] and according to [TPS_-


STDT_00067] placed in the package /AUTOSAR_Platform/BaseTypes (e.g., /AU-
TOSAR_Platform/BaseTypes/uint32) whihc shall be supported for serialization
are listed in Table 7.8.c(SRS_Xfrm_00101)

Type Description Size [bit] Remark


boolean TRUE/FALSE value 8 FALSE (0), TRUE (1)
uint8 unsigned Integer 8
uint16 unsigned Integer 16
uint32 unsigned Integer 32
uint64 unsigned Integer 64
sint8 signed Integer 8
sint16 signed Integer 16
sint32 signed Integer 32
sint64 signed Integer 64
float32 floating point number 32 IEEE 754 binary32 (Single Preci-
sion)
float64 floating point number 64 IEEE 754 binary64 (Double Preci-
sion)

Table 7.8: SwBaseTypes supported for serialization

The Byte Order is specified common for all parameters by byteOrder of SOMEIP-
TransformationDescription. See chapter 7.2.2.

7.2.4.2 Structured Datatypes (structs)

[SWS_SomeIpXf_00042] dA struct shall be serialized in order of depth-first traversal.c


(SRS_Xfrm_00101)
The transformer doesn’t automatically align parameters of a struct.

31 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Insert reserved/padding elements into the AUTOSAR data type if needed for alignment,
since the SOME/IP implementation shall not automatically add such padding.
So if for example a struct includes a uint8 and a uint32, they are just written sequentially
into the buffer. This means that there is no padding between the uint8 and the first byte
of the uint32; therefore, the uint32 might not be aligned. So the system designer has
to consider to add padding elements to the data type to achieve the required alignment
or set it globally.
Warning about unaligned structs or similar shall not be done in the implementation but
only in the tool chain used to generate the implementation.
Messages of legacy busses like CAN and FlexRay are usually not aligned. Warnings
can be turned off or be ignored in such cases.
The SOME/IP transformer does not automatically insert dummy/padding elements.
SOME/IP allows to add a length field of 8, 16 or 32 bit in front of structs. The length
field of a struct describes the number of bytes of the struct. This allows for extensible
structs which allow better migration of interfaces.
[SWS_SomeIpXf_00216] dIf attribute sizeOfStructLengthFields of SOMEIP-
TransformationISignalProps is set to a value greater 0, a length field shall be
inserted in front of every serialized struct.c(SRS_Xfrm_00101)
Note:
[SWS_SomeIpXf_00216] also applies to nested structs which means that additionally
every nested struct has its own length field. Furthermore, in an array of structs where
all structs have the same length, the length field is inserted in front of every struct inside
the array.
[SWS_SomeIpXf_00252] dIf attribute sizeOfStructLengthField of SOMEIP-
TransformationProps is set to a value greater 0, a length field shall be inserted
in front of the serialized struct for which the SOMEIPTransformationProps is de-
fined. (See [TPS_SYST_02121])c(SRS_Xfrm_00101)
Note:
[SWS_SomeIpXf_00252] applies if the length fields of the struct and all nested structs
contained within the root struct are configured to different values for the lengths of the
length fields via SOMEIPTransformationProps.
[SWS_SomeIpXf_00217] dThe data type of the length field of the struct and all nested
structs within the struct shall be the same and shall be determined by the value
of SOMEIPTransformationISignalProps.sizeOfStructLengthFields of the
serialized ISignal:
• uint8 if sizeOfStructLengthFields equals 1
• uint16 if sizeOfStructLengthFields equals 2
• uint32 if sizeOfStructLengthFields equals 4

32 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00253] dIf SOMEIPTransformationProps.sizeOf-
StructLengthField is present for a struct the data type for the length field of
the struct shall be determined by the value of SOMEIPTransformationProps.
sizeOfStructLengthField:
• uint8 if sizeOfStructLengthField equals 1
• uint16 if sizeOfStructLengthField equals 2
• uint32 if sizeOfStructLengthField equals 4
• Otherwise [SWS_SomeIpXf_00217] applies.
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00218] dThe serializing SOME/IP transformer shall write the size (in
bytes) of the serialized struct (without the size of the length field) into the length field of
the struct.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00219] dIf the length is greater than the expected length of a struct
(as specified in the data type definition) a deserializing SOME/IP transformer shall only
interpret the expected data and skip the unexpected.c(SRS_Xfrm_00101)
To determine the start of the next expected data following the skipped unexpected part,
the SOME/IP transformer can use the supplied length information.

Struct_1 uint32 a
float32 b_1
uint32 a float32 b_2
float32 b[2] serialization uint32 d
float32 e_1
Struct_2 c Struct_2
float32 e_2
uint32 d …
float32 e[2]
Struct_3 f
Figure 7.4: Serialization of Structs without Length Fields (Example)

33 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Struct_1 uint16 lf1


uint32 a
uint32 a float32 b_1
float32 b[2] serialization float32 b_2
uint16 lf2
Struct_2 c Struct_2
uint32 d
uint32 d float32 e_1
float32 e_2
float32 e[2]
uint16 lf3
Struct_3 f …
Figure 7.5: Serialization of Structs with Length Fields (Example)

7.2.4.3 Structured Datatypes and Arguments with Identifier and optional Mem-
bers

Please note that the content of this chapter has draft character
To achieve enhanced forward and backward compatibility, an additional Data ID can
be added in front of struct members or method arguments. The receiver then can
skip unknown members/arguments, i.e. where the Data ID is unknown. New member-
s/arguments can be added at arbitrary positions when Data IDs are transferred in the
serialized byte stream.
Structs are modeled in the Software Component Template using an Implementa-
tionDataType of category STRUCTURE and members are represented by Imple-
mentationDataTypeElements. Method arguments are represented by Argument-
DataPrototypes. Refer to [9] for more details.
The assignment of Data IDs is modeled in the System Template in the context of
SOMEIPTransformationISignalProps. Refer to [7] for more details.
Moreover, the usage of Data IDs allows describing structs with optional members. To
serialize data with optional members, the transformer has to know which optional mem-
bers are available or not. This is stored in a bitfield which is contained inside the Im-
plementationDataType. This availabilityBitfield is realized as array of uint8.
Whether an optional member is actually present in the struct or not, must be deter-
mined during runtime.
In addition to the Data ID, a wire type encodes the datatype of the following member.
Data ID and wire type are encoded in a so-called tag.

34 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00267] dThe length of a tag shall be two bytes.c(SRS_Xfrm_00106)


[SWS_SomeIpXf_00268] dThe tag shall consist of
• reserved (Bit 7 of the first byte)
• wire type (Bit 6-4 of the first byte)
• Data ID (Bit 3-0 of the first byte and bit 7-0 of the second byte)
Bit 7 is the highest significant bit of a byte, bit 0 is the lowest significant bit of a byte.c
(SRS_Xfrm_00106)
Note:
Refer to Figure 7.6 for the layout of the tag.
7 0 7 0 7/15/31 0
reserved

Data ID (Higher
Wire Type Data ID (Lower Sig. Part) Length Field (8/16/32 bit) Member Data ...
Sig. Part)

Byte n Byte n + 1 Byte n + 2 ...

Figure 7.6: SOME/IP Struct Tag Layout

[SWS_SomeIpXf_00269] dThe lower significant part of the Data ID of the member


shall be encoded in bits 7-0 of the second byte of the tag. The higher significant part of
the Data ID of the member shall be encoded in bits 3-0 of the first byte.c(SRS_Xfrm_-
00106)
Example: The Data ID of the member is 1266 (dec). Then bits 3-0 of the first byte are
set to 0x4. The second byte is set to 0xF2.
[SWS_SomeIpXf_00270] dThe wire type shall determine the type of the following data
of the member. The value shall be assigned as shown in Table 7.9.c(SRS_Xfrm_-
00106)

Wire Type Value


0 8 Bit Data Base data type
1 16 Bit Data Base data type
2 32 Bit Data Base data type
3 64 Bit Data Base data type
4 Complex Data Type: Array, Struct, String, Union with length
field of static size (configured in data definition)
5 Complex Data Type: Array, Struct, String, Union with length
field size 1 byte (ignore static definition)
6 Complex Data Type: Array, Struct, String, Union with length
field size 2 byte (ignore static definition)
7 Complex Data Type: Array, Struct, String, Union with length
field size 4 byte (ignore static definition)

Table 7.9: Message Types

35 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Note:
Wire type 4 ensures the compatibility with the current approach where the size of length
fields is statically configured. This approach has the drawback that changing the size
of the length field during evolution of interfaces is always incompatible. Thus, wire
types 5, 6 and 7 allow to encode the size of the used length field in the transferred byte
stream.
[SWS_SomeIpXf_00271] dIf SOMEIPTransformationISignalProps.isDynami-
cLengthFieldSize is set to false or is not defined, the transformer shall use wire
type 4 for serializing complex types and shall use the fixed size length fields. The size of
the length fields is defined in SOMEIPTransformationISignalProps.sizeOfAr-
rayLengthFields, sizeOfStructLengthFields and sizeOfUnionLength-
Fields.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00272] dSOMEIPTransformationISignalProps.isDynami-
cLengthFieldSize is set to true, the transformer shall use wire types 5,6,7 for
serializing complex types and shall chose the size of the length field according to this
wire type.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00273] dA deserializer shall always be able to handle the wire types
4, 5, 6 and 7 independent of the setting of SOMEIPTransformationISignalProps.
isDynamicLengthFieldSizec(SRS_Xfrm_00106)
[SWS_SomeIpXf_00274] dIf a Data ID is defined for an ArgumentDataPrototype
or ImplementationDataTypeElement by means of SOMEIPTransformation-
ISignalProps.tlvDataId.id, a tag shall be inserted in the serialized byte stream.c
(SRS_Xfrm_00106)
Note:
regarding existence of Data IDs, refer to [7].
[SWS_SomeIpXf_00275] dIf the datatype of the serialized member / argument is a
basic datatype (wire types 0-3) and a Data ID is configured, the tag shall be inserted
directly in front of the member/argument. No length field shall be inserted into the
serialized stream.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00276] dIf the datatype of the serialized member/argument is not a
basic datatype (wire type 4-7) and a Data ID is configured, the tag shall be inserted in
front of the length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00277] dIf the datatype of the serialized member/argument is not a
basic datatype and a Data ID is configured, a length field shall always be inserted in
front of the member/argument.c(SRS_Xfrm_00106)
Rationale: The length field is required to skip unknown members/arguments during
deserialization.
[SWS_SomeIpXf_00278] dThe length field shall always contain the length up to the
next tag of the struct, but does not include the tag size and length field size itself.c
(SRS_Xfrm_00106)

36 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00279] dIf the member itself is of type struct, there shall be exactly
one length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00280] dIf the member itself is of type dynamic length string, there
shall be exactly one length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00281] dIf the member itself is of type fixed length string, there
shall be exactly one length field corresponding to dynamic length strings.c(SRS_Xfrm_-
00106)
Note:
When serialized without tag, fixed length strings do not have a length field. For the
serialization with tag, a length field is also required for fixed length strings in the same
way as for dynamic length strings.
[SWS_SomeIpXf_00282]{DRAFT} dIf the member itself is of type dynamic length ar-
ray, there shall be exactly one length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00283] dIf the member itself is of type fixed length array, there shall
be exactly one length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00284] dIf the member itself is of type union, there shall be exactly
one length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00285] dFor the serialization of extensible structs and methods the
length field shall cover the size of the type field, data and padding bytes if the member
itself is of type union.c(SRS_Xfrm_00106)
Note:
For the serialization without tags, the length field of unions does not cover the type
field (see [SWS_SomeIpXf_00226]). For the serialization with tags, it is required that
the complete content of the serialized union is covered by the length field.
[SWS_SomeIpXf_00286] dA member of a non-extensible (standard) struct which is of
type extensible struct, shall be serialized according to the requirements for extensible
structs.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00287] dA member of an extensible struct which is of type non-
extensible (standard) struct, shall be serialized according to the requirements for stan-
dard structs.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00288] dFor the serialization of extensible structs and methods no
alignment shall be applied.c(SRS_Xfrm_00106)
Rationale: When alignment greater 8 bits is used, the serializer may add padding bytes
after variable length data. The padding bytes are not covered by the length field. If the
receiver does not know the Data ID of the member, it also does not know that it is
variable length data and that there might be padding bytes.
[SWS_SomeIpXf_00289] dIf the attribute isStructWithOptionalElement of the
ImplementationDataType representing the extensible struct is set to true, the

37 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

transformer shall ignore the first ImplementationDataTypeElement and shall not se-
rialize or deserialize it.c(SRS_Xfrm_00106)
Rationale: the first ImplementationDataTypeElement represents the availability
bitfield which is not transferred on the wire.
[SWS_SomeIpXf_00290] dThe transformer shall only serialize an optional member of
a struct if the corresponding bit in the availability bitfield is set as follows:
(availabilityBitfield[(pos/8)] & (1<<(pos mod 8))) != 0

c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00291] dIf an optional member is available in the serialized byte
stream, the transformer shall set the corresponding bit in the availability bitfield as
follows:
availabilityBitfield[(pos/8)] = availabilityBitfield[(pos/8)] | (1<<(pos mod 8))

c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00292] dIf an optional member is not available in the serialized byte
stream, the transformer shall clear the corresponding bit in the availability bitfield as
follows:
availabilityBitfield[(pos/8)] = availabilityBitfield[(pos/8)] & ~(1<<(pos mod 8))

c(SRS_Xfrm_00106)
In the requirements [SWS_SomeIpXf_00288], [SWS_SomeIpXf_00289] and [SWS_-
SomeIpXf_00290] pos is the position of the optional ImplementationDataType-
Element among all optional ImplementationDataTypeElements within the Im-
plementationDataType starting with pos = 0.
Note:
Non-optional ImplementationDataTypeElements do not count since they do not
need a bit in the availabilityBitfield. So the bit position within the availabilityBitfield
is determined by the order of the optional ImplementationDataTypeElements.
Examples:
• 1st optional ImplementationDataTypeElement (pos=0):
(availabilityBitfield[0] & 0x01) != 0

• 8th optional ImplementationDataTypeElement (pos=7):


(availabilityBitfield[0] & 0x80) != 0

• 9th optional ImplementationDataTypeElement (pos=8):


(availabilityBitfield[1] & 0x01) != 0

[SWS_SomeIpXf_00295] dIf an optional member is not available in the received se-


rialized byte stream, the transformer shall keep the memory section occupied by this
optional element without modification.c(SRS_Xfrm_00106)

38 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00293] dIf the transformer reads an unknown Data ID (i.e. not con-
tained in its data definition), it shall skip the unknown member/argument by using the
information of the wire type and length field.c(SRS_Xfrm_00106)
[SWS_SomeIpXf_00294] dIf the transformer cannot find a required (i.e. non-optional)
member defined in its data definition in the serialized byte stream, the deserialization
shall be aborted with E_SER_MALFORMED_MESSAGE. For examples, please refer to
[10].c(SRS_Xfrm_00106)

7.2.4.4 Strings

[SWS_SomeIpXf_00053] dStrings shall be encoded using Unicode and terminated


with a
"\textbackslash0"-character

for both fixed-length and dynamic-length strings. Unused space shall be filled using
"\0".c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00054] dDifferent Unicode encoding shall be supported including
UTF-8, UTF-16BE, and UTF-16LE. Since these encoding have a dynamic length of
bytes per character, the maximum length in bytes is up to three times the length of
characters in UTF-8 plus 1 Byte for the termination with a "\0" or two times the length
of the characters in UTF-16 plus 2 Bytes for a "\0". UTF-8 character can be up to 6
bytes and an UTF-16 character can be up to 4 bytes.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00055] dUTF-16LE and UTF-16BE strings shall be zero terminated
with a
"\textbackslash0"-character

. This means they shall end with (at least) two 0x00 Bytes.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00056] dUTF-16LE and UTF-16BE strings shall have an even
length.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00057] dFor UTF-16LE and UTF-16BE strings having an odd length
the last byte shall be silently removed by the receiving SOME/IP transformer.c(SRS_-
Xfrm_00101)
[SWS_SomeIpXf_00248] dIn case of UTF-16LE and UTF-16BE strings having an odd
length, after removal of the last byte, the two bytes before shall be 0x00 bytes (termi-
nation) for a string to be valid.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00058] dAll strings shall always start with a Byte Order Mark (BOM).
The BOM shall be included in fixed-length-strings as well as dynamic-length strings.c
(SRS_Xfrm_00101)
For the specification of BOM, see [11] and [12]. Please note that the BOM is used in
the serialized strings to achieve compatibility with Unicode.

39 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00239] dThe String specific serialization will only be triggered if


an Unicode String is detected and implementsLegacyStringSerialization is
false.c(SRS_Xfrm_00101)
For the details of the recognition and serialization of fixed- and dynamic-length strings
see chapter 7.2.4.4.1 and chapter 7.2.4.4.2.
[SWS_SomeIpXf_00059] dThe receiving SOME/IP transformer implementation shall
check the BOM and handle a missing BOM or a malformed BOM as an error.c(SRS_-
Xfrm_00101)
[SWS_SomeIpXf_00060] dThe BOM shall be added by the SOME/IP sending trans-
former implementation.c(SRS_Xfrm_00101)

7.2.4.4.1 Strings (fixed length)

The length of the string (this includes the "\0") in Bytes is specified in the data type
definition.
[SWS_SomeIpXf_00240] Recognition of UTF-8 Fixed Length Strings dAn UTF-8
Fixed Length String shall be detected if an ApplicationPrimitiveDataType and
an ImplementationDataType with the following pattern are used:
• ApplicationPrimitiveDataType
– with category equal to STRING
– ApplicationPrimitiveDataType.swDataDefProps.swTextProps.
baseType refers to a BaseType with baseTypeDefinition.baseType-
Encoding equal to UTF-8
• ImplementationDataType
– with category ARRAY
– that contains exactly one ImplementationDataTypeElement that boils
down to a uint8 ImplementationDataType:
∗ ImplementationDataTypeElement.arraySize is set to a value
∗ ImplementationDataTypeElement.arraySizeSemantics is set
to fixedSize
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00241] Recognition of UTF-16 Fixed Length Strings dAn UTF-16
Fixed Length String shall be detected if an ApplicationPrimitiveDataType and
an ImplementationDataType with the following pattern are used:
• ApplicationPrimitiveDataType
– with category equal to STRING

40 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

– ApplicationPrimitiveDataType.swDataDefProps.swTextProps.
baseType refers to a BaseType with baseTypeDefinition.baseType-
Encoding equal to UTF-16
• ImplementationDataType
– with category ARRAY
– that contains exactly one ImplementationDataTypeElement that boils
down to a uint16 ImplementationDataType:
∗ ImplementationDataTypeElement.arraySize is set to a value
∗ ImplementationDataTypeElement.arraySizeSemantics is set
to fixedSize
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00244] Serialization of fixed length strings dSerialization of fixed
length strings shall consist of the following steps:
1. Check whether the string terminates with 0x00 (UTF-8) or 0x0000 (UTF-16). If
not, a E_SER_GENERIC_ERROR error shall be issued.
2. Appending BOM at the beginning of the output buffer, if BOM is not already avail-
able in the first three (UTF-8) or two (UTF-16) bytes of the to be serialized array
containing the string. If the BOM is already present, simply copy the BOM into
the output buffer.
3. Copying the string data (the number of bytes according to the string’s fixed length)
from the array into the output buffer, optionally performing a conversion between
UTF-16LE and UTF-16BE between ECU and network byte order if BaseTypeDi-
rectDefinition.byteOrder and SOMEIPTransformationDescription.
byteOrder have different values
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00246] Deserialization of fixed length strings dDeserialization of
fixed length strings shall consist of the following steps:
1. Check whether the string starts with a BOM. If not, a MALFORMED_MESSAGE error
shall be issued
2. Check whether BOM has the same value as SOMEIPTransformationDe-
scription.byteOrder. If not, a MALFORMED_MESSAGE error shall be issued
3. Remove the BOM
4. Silently discard the last byte of the string in case of an UTF-16 string with odd
length
5. Check whether the string terminates with 0x00 (UTF-8) or 0x0000 (UTF-16). If
not, a MALFORMED_MESSAGE error shall be issued

41 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

6. Copy the string data (the number of bytes according to the string’s fixed length)
from the input buffer into the array, optionally performing a conversion between
UTF-16LE and UTF-16BE between network and ECU byte order if BaseTypeDi-
rectDefinition.byteOrder and SOMEIPTransformationDescription.
byteOrder have different values.
c(SRS_Xfrm_00101)

7.2.4.4.2 Strings (dynamic length)

Strings with dynamic length can be realized in an AUTOSAR system as an array with
dynamic length that transports the single characters.
[SWS_SomeIpXf_00242] Recognition of UTF-8 Variable Length Strings dAn UTF-8
Fixed Length String shall be detected if an ApplicationPrimitiveDataType and
an ImplementationDataType with the following pattern are used:
• ApplicationPrimitiveDataType
– with category equal to STRING
– ApplicationPrimitiveDataType.swDataDefProps.swTextProps.
baseType refers to a BaseType with baseTypeDefinition.baseType-
Encoding equal to UTF-8
• ImplementationDataType
The ImplementationDataType shall be defined according to [TPS_SWCT_-
01650] as a STRUCTURE that contains exactly two Implementation-
DataTypeElements and shall follow the rules defined by [constr_1318]:
– one ImplementationDataTypeElement represents the Size Indica-
tor and has the category equal to TYPE_REFERENCE which points to a
uint8, uint16 or uint32 ImplementationDataType
– one ImplementationDataTypeElement has the category equal to
ARRAY and contains exactly one ImplementationDataTypeElement
that boils down to a uint8 ImplementationDataType
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00243] Recognition of UTF-16 Variable Length Strings dAn
UTF-16 Fixed Length String shall be detected if an ApplicationPrimitive-
DataType and an ImplementationDataType with the following pattern are used:
• ApplicationPrimitiveDataType
– with category equal to STRING
– ApplicationPrimitiveDataType.swDataDefProps.swTextProps.
baseType refers to a BaseType with baseTypeDefinition.baseType-
Encoding equal to UTF-16

42 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• ImplementationDataType
The ImplementationDataType shall be defined according to [TPS_SWCT_-
01650] as a STRUCTURE that contains exactly two Implementation-
DataTypeElements and shall follow the rules defined by [constr_1318]:
– one ImplementationDataTypeElement represents the Size Indica-
tor and has the category equal to TYPE_REFERENCE which points to a
uint8, uint16 or uint32 ImplementationDataType
– one ImplementationDataTypeElement has the category equal to
ARRAY and contains exactly one ImplementationDataTypeElement
that boils down to a uint16 ImplementationDataType
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00245] Serialization of dynamic length strings dSerialization of
dynamic length strings shall consist of the followign steps:
1. Check whether the string terminates with 0x00 (UTF-8) or 0x0000 (UTF-16). If
not, a E_SER_GENERIC_ERROR error shall be issued.
2. Add the Length Field - The value of the length field shall be computed by multi-
plying the number of elements given by the size indicator with the size in bytes of
each element (i.e., 1 for UTF-8 and 2 for UTF-16) increased by the size in bytes
required by the BOM. The data type of the length field shall be determined from
the sizeOfStringLengthFields. If the attribute sizeOfStringLength-
Fields is not configured then the default value of 32 bit shall be used as de-
fined by [PRS_SOMEIP_00094]. The value of the length field shall comply with
[SWS_SomeIpXf_CONSTR_0001].
3. Appending BOM at the beginning, if BOM is not already available in the first 3
(UTF-8) or 2 (UTF-16) bytes of the to be serialized array containing the string. If
the BOM is already present, simply copy the BOM into the output buffer
4. Copying the string data (copy the the number of bytes according to the string’s
size indicator and the size of bytes of each element) from the array into the out-
put buffer, optionally performing a conversion between UTF-16LE and UTF-16BE
between ECU and network byte order BaseTypeDirectDefinition.byte-
Order and SOMEIPTransformationDescription.byteOrder have differ-
ent values
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00247] Deserialization of dynamic length strings
dDeserialization of dynamic length strings shall consist of the following steps:
1. Check whether the string starts with a BOM. If not, a MALFORMED_MESSAGE error
shall be issued
2. Check whether BOM has the same value as SOMEIPTransformationDe-
scription.byteOrder. If not, a MALFORMED_MESSAGE error shall be issued

43 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

3. Remove the BOM and reduce the value of the length field accordingly
4. Silently discard the last byte of the string in case of an UTF-16 string with odd
length (according to the reduced value of the length field)
5. Check whether the string terminates with 0x00 (UTF-8) or 0x0000 (UTF-16). If
not, a MALFORMED_MESSAGE error shall be issued
6. Check whether the length of the received dynamic length string is less or
equal than the specified maximum length of the string (ApplicationPrimitive-
DataType.swTextProps.swMaxTextSize or arraySize of ImplementationDataType-
Element of category ARRAY). If not, a MALFORMED_MESSAGE error shall be
issued.
7. Copy the string data (copy the number of bytes according to the string’s reduced
value of the length field) from the input buffer into the array, optionally perform-
ing a conversion between (UTF-16LE) and (UTF-16BE) between ECU and bus
if BaseTypeDirectDefinition.byteOrder and SOMEIPTransformation-
Description.byteOrder have different values.
c(SRS_Xfrm_00101)
Instead of transferring application strings as SOME/IP strings with BOM and "\0" ter-
mination, strings can also be transported as plain dynamic length arrays without BOM
and "\0" termination (see chapter Dynamic Length Arrays of [13]).
Please note that this requires the full string handling (e.g. endianness conversion) to
be done in the applications. This can also be achieved by setting the attribute im-
plementsLegacyStringSerialization to true. In CP this attribute is configured
in SOMEIPTransformationISignalProps, in AP it is configured in ApSomeip-
TransformationProps.
NOTE! This attribute is not future safe and will be removed in an upcoming AUTOSAR
release! Therefore, to be forward compatible, plain dynamic length arrays should
preferably be used in this case.

7.2.4.5 Arrays (fixed length)

[SWS_SomeIpXf_00069] dThe length of fixed length arrays is defined by the datatype


definition.c(SRS_Xfrm_00101)
They can be seen as repeated elements. In chapter 7.2.4.7 dynamic length arrays are
shown, which can be also used. Fixed length arrays are easier for use in very small
devices. Dynamic length arrays might need more resources on the ECU using them.
SOME/IP allows to add a length field of 8, 16 or 32 bit in front of arrays. The length field
of an array describes the number of bytes of the array. This allows extensible arrays
which allow better migration of interfaces.

44 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00220] dIf attribute sizeOfArrayLengthFields of SOMEIP-


TransformationISignalProps is set to a value greater 0, a length field shall be
inserted in front of every serialized array.c(SRS_Xfrm_00101)
Note:
[SWS_SomeIpXf_00220] also applies to nested arrays which means that additionally
every nested fixed-size array has its own length field.
[SWS_SomeIpXf_00256] dIf attribute sizeOfArrayLengthField of SOMEIP-
TransformationProps is set to a value greater 0, a length field shall be inserted
in front of the serialized array for which the SOMEIPTransformationProps is de-
fined. (See [TPS_SYST_02121])c(SRS_Xfrm_00101)
Note:
[SWS_SomeIpXf_00256] applies if the length fields of the array and all nested ar-
rays contained are configured to different values for the lengths of the length fields
via SOMEIPTransformationProps
[SWS_SomeIpXf_00257] dIf SOMEIPTransformationProps.sizeOfAr-
rayLengthField is present for a static size array the data type for the length
field of the array shall be determined by the value of SOMEIPTransformation-
Props.sizeOfArrayLengthField:
• uint8 if sizeOfArrayLengthField equals 1
• uint16 if sizeOfArrayLengthField equals 2
• uint32 if sizeOfArrayLengthField equals 4
• Otherwise [SWS_SomeIpXf_00221] applies.
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00221] dThe data type of the length field for an array shall be
determined by the value of SOMEIPTransformationISignalProps.sizeOfAr-
rayLengthFields of the serialized ISignal:
• uint8 if sizeOfArrayLengthFields equals 1
• uint16 if sizeOfArrayLengthFields equals 2
• uint32 if sizeOfArrayLengthFields equals 4
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00222] dThe serializing SOME/IP transformer shall write the size (in
bytes) of the serialized array (without the size of the length field) into the length field of
the array.c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00223] dIf the length is greater than the expected length of an array
(as specified in the data type definition) a deserializing SOME/IP transformer shall only
interpret the expected data and skip the unexpected.c(SRS_Xfrm_00101)

45 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

To determine the start of the next expected data following the skipped unexpected part,
the SOME/IP transformer can use the supplied length information.

7.2.4.5.1 One-dimensional

The one-dimensional arrays with fixed length n carry exactly n elements of the same
type. The layout is shown in Figure 7.7.
[SWS_SomeIpXf_00070] dA one-dimensional array with fixed length shall be serial-
ized by concatenating the array elements in order.c(SRS_Xfrm_00101)

Static Array a[n]


Element_1 Element_2 Element_3 Element_n


element size e [byte]
n*e

Figure 7.7: One-dimensional array (fixed length)

7.2.4.5.2 Multidimensional

[SWS_SomeIpXf_00072] dThe serialization of multidimensional arrays shall happen


in row-major order(in-memory layout of multidimensional arrays in the C programming
language)c(SRS_Xfrm_00101)

Static Array a[n][m]


Element_1 Element_2 Element_n
E1,1 E1,2 E1,m


e
m*e
n*(m*e)

Figure 7.8: Multidimensional array (fixed length)

Consult AUTOSAR SWS RTE chapter 5.3.4.4 for Arrays.

46 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7.2.4.6 Optional Parameters / Optional Elements

Optional Elements can be encoded as array with 0 to 1 elements. For the serialization
of arrays with dynamic length see Chapter 7.2.4.7.

7.2.4.7 Dynamic Length Arrays / Variable Size Arrays

Variable size arrays are implemented in AUTOSAR as structs with two members
• a size indicator which is an integer and holds the number of valid elements in the
array
• the array with variable size
In SOME/IP variable size arrays are implemented in a similar manner. Only the size
indicator is replaced by a length indicator.
• a length indicator which is an integer and holds the length (in bytes) of the follow-
ing variable size array
• the array which contains the valid elements of the variable size array
In AUTOSAR also so called "old-world" variable-size array data types exist which don’t
have a size indicator. These are not supported by data transformation in general and
hence also not supported by the SOME/IP transformer. For details, refer to [con-
str_1387] ([7, System Template]), [TPS_SWCT_01644], [TPS_SWCT_01645], [TPS_-
SWCT_01642] and [TPS_SWCT_01643].
[SWS_SomeIpXf_00076] dA variable size array embedded in a structure which also
contains a size indicator shall be serialized as the concatenation of the following ele-
ments:
• the length indicator which holds the length (in bytes) of the following variable size
array
• the array which contains the valid elements of the variable size array
where
• the data type of the length field shall be determined as specified in
[SWS_SomeIpXf_00234]
• the array shall be serialized like a static size array but does only contain the valid
elements. The number of elements to serializer shall be taken from the size
indicator.
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00234] dA variable size array is represented in AUTOSAR by an
ImplementationDataType with the category STRUCTURE and two sub-elements
(namely payload and size indicator ). The data type of the length fields for the

47 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

SOME/IP message for an variable size array shall be determined from the sizeOfAr-
rayLengthFields. If the attribute sizeOfArrayLengthFields is not configured
then the default value of 32 bit shall be used as defined by [PRS_SOMEIP_00945].
In case of nested variable size arrays, AUTOSAR allows to use profiles to specify size
indicators which apply to more than one variable size array nested within the same
ImplementationDataType. Depending on the specific profile (dynamicArray-
SizeProfile), the data type of the of the length fields inside the SOME/IP message
shall be determined differently:
• VSA_LINEAR
The data type of the SOME/IP length field shall be determined from the single
sizeOfArrayLengthFields. If the attribute sizeOfArrayLengthFields is
not configured then the default value of 32 bit shall be used as defined by [PRS_-
SOMEIP_00945].
• VSA_SQUARE
All data type of the SOME/IP length fields shall be determined from the single
sizeOfArrayLengthFields. If the attribute sizeOfArrayLengthFields is
not configured then the default value of 32 bit shall be used as defined by [PRS_-
SOMEIP_00945].
• VSA_RECTANGULAR
The data type of all SOME/IP length fields for all dimensions (nesting level) shall
be determined from the single sizeOfArrayLengthFields. If the attribute
sizeOfArrayLengthFields is not configured then the default value of 32 bit
shall be used as defined by [PRS_SOMEIP_00945].
• VSA_FULLY_FLEXIBLE
The data type of all SOME/IP length fields for all variable size arrays shall be de-
termined from the single sizeOfArrayLengthFields. If the attribute sizeO-
fArrayLengthFields is not configured then the default value of 32 bit shall be
used as defined by [PRS_SOMEIP_00945].
c(SRS_Xfrm_00101, SRS_Xfrm_00008)
This means only the first m elements of the variable size array are serialized where m is
the value of the size indicator.
The layout of dynamic arrays is shown in 7.9 and Figure 7.10 where L_1 and L_2
denote the length in bytes.

48 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Length n Element_1 Element_2 Element_3 Element_n


8,16 or 32 bit element size e
n [byte]

Figure 7.9: One-dimensional array (dynamic length) (Example)

In the one-dimensional array one length field is used, which carries the size in bytes of
the valid elements in the array.
[SWS_SomeIpXf_00235] dIf the value of dynamicArraySizeProfile equals
VSA_LINEAR, the value of the length field of the serialized variable size array shall
be calculated based on the value of the size indicator of the AUTOSAR data type.c
(SRS_Xfrm_00101, SRS_Xfrm_00008)
The number of static length elements can be easily calculated by dividing the array
length n by the Byte size of an element.
In the case of dynamical length elements the number of elements cannot be calculated
but the elements must be parsed sequentially.

Length n Element_a[1][j…k_1] Element_a[2][j…k_2]


L_1 E1,1 E1,2

E1,k_1 L_2 E1,1 E1,2

E1,k_2

L_1 [byte] L_2 [byte]
8,16 or 32 bit
n [byte]

Figure 7.10: Multidimensional array (dynamic length) (Example)

In case of multidimensional variable size arrays, each variable size array needs to
have its own length field, independent of the way how the variable size array is de-
signed in the AUTOSAR data type (i.e. independent from the value of dynamicAr-
raySizeProfile) as specified in [SWS_SomeIpXf_00234]. Hence it is supported to
have different length columns and different length rows in the same dimension. See
k_1 and k_2 in Figure 7.10.
[SWS_SomeIpXf_00236] dIf the value of dynamicArraySizeProfile of a multi-
dimensional variable size array equals VSA_SQUARE, the value of all length fields of
the nested serialized variable size arrays that belong to this multi-dimensional variable
size arrays shall be calculated based on the value of the single size indicator of the
AUTOSAR data type.c(SRS_Xfrm_00101, SRS_Xfrm_00008)

49 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

In case of VSA_SQUARE, the AUTOSAR data type only has one size indicator. The
value of this size indicator will be used as base for the calculation for the value of all
length fields of such a multi-dimensional variable size array.
[SWS_SomeIpXf_00237] dIf the value of dynamicArraySizeProfile of a multi-
dimensional variable size array equals VSA_RECTANGULAR, the values of all length
fields of the nested serialized variable size arrays of the same nesting level (i.e. the
same dimension) that belong to this multi-dimensional variable size array shall be cal-
culated based on the values of the size indicators of the AUTOSAR data type for this
respective nesting level.c(SRS_Xfrm_00101, SRS_Xfrm_00008)
In case of VSA_RECTANGULAR, the AUTOSAR data type has exactly one size indicator
for each dimension of the the multi-dimensional variable size array. For all variable size
arrays in one dimension, the value of the according size indicator of this dimension will
be used as base for the calculation of the values of all length fields of this dimension.
[SWS_SomeIpXf_00238] dIf the value of dynamicArraySizeProfile of a multi-
dimensional variable size array equals VSA_FULLY_FLEXIBLE, the values of all length
fields of the nested serialized variable size arrays that belong to this multi-dimensional
variable size arrays shall be calculated based on the value of the size indicator of the
corresponding variable size array that is contained in the AUTOSAR data type.c(SRS_-
Xfrm_00101, SRS_Xfrm_00008)
In case of VSA_FULLY_FLEXIBLE, in the AUTOSAR data type the outer variable size
array and each nested variable size arrays has its own size indicator. For the calculation
of the values of the length fields both of the outer and all nested variable size arrays
the according values of the size indicators of the AUTOSAR data type will be used as
base.
The RTE provides a buffer where serialization result will be written into by the SOME/IP
transformer which is large enough to keep the length field and a fully filled dynamic
array.

7.2.4.8 Bitfield

[SWS_SomeIpXf_00300] dBitfields shall be transported as basic datatypes


uint8/uint16/uint32.c()

7.2.4.9 Union / Variant

A union (also called variant) is a parameter that can contain different types of elements.
For example, if one defines a union of type uint8 and type uint16, the union shall carry
an element of uint8 or uint16.
The union serialization will only be triggered if the pattern defined in
[SWS_SomeIpXf_00249] applies.

50 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00249] dA union shall be detected if an Implementation-


DataType with the following pattern (named wrapped union data type) is used: Im-
plementationDataType with category STRUCTURE that contains exactly two Im-
plementationDataTypeElements:
• memberSelector: ImplementationDataTypeElement which represents the
type field that boils down to a uint8, uint16 or uint32 Implementation-
DataType
• payload: ImplementationDataTypeElement of category UNION which rep-
resents the actual union
c(SRS_Xfrm_00101)
When using different types of elements the alignment of subsequent parameters may
be distorted. To resolve this, padding might be needed.
[SWS_SomeIpXf_00088] dThe default serialization layout of unions in SOME/IP is
shown in Table 7.10.c(SRS_Xfrm_00101)

Length field (optional)


Type field
Element including padding [sizeof(padding) = length - sizeof(element)]

Table 7.10: Default serialization layout of unions

SOME/IP allows to add a length field of 8, 16 or 32 bit in front of unions. The length
field of a union describes the number of bytes in the union.
This allows the deserializer to quickly calculate the position where the data after the
union begin in the serialized data stream. This gets necessary if the union con-
tains data which are larger than expected, for example if a struct was extended with
appended new members and only the first "old" members are deserialized by the
SOME/IP transformer.
[SWS_SomeIpXf_00224] dIf attribute sizeOfUnionLengthFields of SOMEIP-
TransformationISignalProps is set to a value greater 0, a length field shall be
inserted in front of every serialized union.c(SRS_Xfrm_00101)
Note:
[SWS_SomeIpXf_00224] also applies to nested unions which means that additionally
every nested union has its own length field.
[SWS_SomeIpXf_00254] dIf attribute sizeOfUnionLengthField of SOMEIP-
TransformationProps is set to a value greater 0, a length field shall be inserted
in front of the serialized union for which the SOMEIPTransformationProps is de-
fined. (See [TPS_SYST_02121]).c(SRS_Xfrm_00101)
Note:
[SWS_SomeIpXf_00254] applies if the length fields of the union and all nested unions

51 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

contained within the root union are configured to different values for the lengths of the
length fields via SOMEIPTransformationProps.
[SWS_SomeIpXf_00225] dThe data type of the length field of the union and all nested
unions within the union shall be determined by the value of SOMEIPTransforma-
tionISignalProps.sizeOfUnionLengthFields of the serialized ISignal:
• uint8 if sizeOfUnionLengthFields equals 1
• uint16 if sizeOfUnionLengthFields equals 2
• uint32 if sizeOfUnionLengthFields equals 4
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00258] dIf SOMEIPTransformationProps.sizeOfUnion-
LengthField is present for a union the data type of the length field for the union
shall be determined by the value of SOMEIPTransformationProps.sizeOfU-
nionLengthField:
• uint8 if sizeOfUnionLengthFields equals 1
• uint16 if sizeOfUnionLengthFields equals 2
• uint32 if sizeOfUnionLengthFields equals 4
• Otherwise [SWS_SomeIpXf_00225] applies.
c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00226] dThe serializing SOME/IP transformer shall write the size (in
bytes) of the serialized union (including padding bytes but without the size of the length
field and type field) into the length field of the union. This requirement does not apply
for the serialization of extensible structs and methods.c(SRS_Xfrm_00101)
Note:
See also chapter 7.2.4.3.
[SWS_SomeIpXf_00227] dIf the length is greater than the expected length of a union
(as specified in the data type definition) a deserializing SOME/IP transformer shall only
interpret the expected data and skip the unexpected.c(SRS_Xfrm_00101)
To determine the start of the next expected data following the skipped unexpected part,
the SOME/IP transformer can use the supplied length information.
The length of the type field shall be 32, 16, 8 or 0 bits.
The type field describes the type of the element.
[SWS_SomeIpXf_00250] dThe data type of the type field of the union shall be
determined from the ImplementationDataType of the first Implementation-
DataTypeElement (memberSelector) in the wrapped union data type defined in
[SWS_SomeIpXf_00249].c(SRS_Xfrm_00101)

52 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00098] dPossible values of the type field are defined by the data
type specification of the union. The types are encoded as in the data type in ascending
order starting with 1. The 0 is reserved for the NULL type - i.e. an empty union.c
(SRS_Xfrm_00101)
[SWS_SomeIpXf_00251] dThe value of the type field shall be set to the value defined
by the first ImplementationDataTypeElement (memberSelector) in the wrapped
union data type defined in [SWS_SomeIpXf_00249].c(SRS_Xfrm_00101)
[SWS_SomeIpXf_00099] dThe element is serialized depending on the type in the type
field. This also defines the length of the data. All bytes behind the data that are covered
by the length, are padding. The deserializer shall skip the padding bytes by calculat-
ing the required number according to the formula given in [SWS_SomeIpXf_00088].c
(SRS_Xfrm_00101)
By using a struct in the data type definition, different padding layouts can be achieved.

7.2.4.9.1 Example: Union of uint8/uint16 both padded to 32 bit

In this example a length of the length field is specified as 32 bits. The union shall
support a uint8 and a uint16 as elements. Both are padded to the 32 bit boundary
(length=4 Bytes).
A uint8 will be serialized like this:
Length = 4 Bytes
Type = 1
uint8 Padding 0x00 Padding 0x00 Padding 0x00

A uint16 will be serialized like this:


Length = 4 Bytes
Type = 2
uint16 Padding 0x00 Padding 0x00

7.3 Protocol specification


This chapter describes the protocol of SOME/IP for Client/Server and Sender/Receiver
communication.

7.3.1 Client/Server Communication

[SWS_SomeIpXf_00106] dFor the SOME/IP request message, the SOME/IP trans-


former on the client-ECU has to do the following for payload and header:

53 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• Construct the payload


• Optionally set the Request ID to a unique number (shall be unique for client only)
• Set the Protocol Version according [SWS_SomeIpXf_00029]
• Set the Interface Version. If interfaceVersion of SOMEIPTransforma-
tionISignalProps is set, this shall be used. Otherwise interfaceVersion
of SOMEIPTransformationDescription shall be used.
• Set the Message Type to Request (i.e. 0x00)
• Set the Return Code to 0x00
c(SRS_Xfrm_00102)
[SWS_SomeIpXf_00120] dTo construct the payload of a request message all argu-
ments of the ClientServerOperation which have direction IN or INOUT shall
be serialized according to the order of the ArgumentDataPrototypes within the
ClientServerOperation.c(SRS_Xfrm_00102)
This can be seen graphically in Figure 7.11.
SomeIpXf_<XfId> (
*transactionHandle, SOME/IP
*buffer, Header
*bufferLength, argument1
Payload
IN/INOUT argument1,

…,
IN/INOUT argumentN argumentN
)

Figure 7.11: Example for serialization of a Client/Server Request

[SWS_SomeIpXf_00200] dIf csErrorReaction of TransformationISignal-


Props is set to autonomous and the returnValue parameter handed over
from RTE is greater or equal to 0x80, the SOME/IP transformer for a response
of a client/server communication shall generate an error message according to
[SWS_SomeIpXf_00201], else it shall generate a normal response according to
[SWS_SomeIpXf_00107].c(SRS_Xfrm_00102)
[SWS_SomeIpXf_00107] dThe SOME/IP transformer on the server-ECU builds its
header for the server response based on the header of the client’s request and does in
addition:
• Construct the payload
• Set the Message Type to RESPONSE (i.e. 0x80)

54 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• If the ClientServerOperation has at least one possibleError defined,


place the return value of the executed ClientServerOperation into the Re-
turn Code field and add 0x1F to adapt the number ranges in case the original
return value was different from 0x00.
c(SRS_Xfrm_00102)
Note: See also chapter 7.2.3.7.
[SWS_SomeIpXf_00121] dTo construct the payload of a response message all argu-
ments of the ClientServerOperation which have direction INOUT or OUT shall
be serialized in the following order:
The ArgumentDataPrototypes with a direction of INOUT or OUT shall be serialized
according to the order of the ArgumentDataPrototypes within the ClientServer-
Operation.c(SRS_Xfrm_00102)
This can be seen graphically in Figure 7.12.
SomeIpXf_<XfId> (
*transactionHandle,
*buffer, SOME/IP
*bufferLength, Header
returnValue,
argument1
INOUT/OUT argument1,

Payload
…, …
INOUT/OUT argumentN argumentN
)

Figure 7.12: Example for serialization of a Client/Server Response

[SWS_SomeIpXf_00201] dThe SOME/IP transformer on the server-ECU builds its


header for an autonomous error response based on the header of the client’s request
and does in addition:
• Construct no payload (the payload shall be empty)
• Set the Message Type to RESPONSE (i.e. 0x80)
• Adapt the return value by subtracting 0x80 from the parameter returnValue
(calculation: adaptedReturnV alue = returnV alue − 0x80)
• Place the adaptedReturnValue into the Return Code field.
c(SRS_Xfrm_00102)
Note: See also chapter 7.2.3.7.
This leads to an output of the SOME/IP transformer which is exactly as long as the
SOME/IP header.

55 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Note:
Error messages can only be sent as a response for client/server requests, not for
Sender/Receiver communication or error messages.
[SWS_SomeIpXf_00202] dA SOME/IP transformer on the server-ECU that builds
an autonomous error response shall return with a return value equal to E_OK (See
[SWS_SomeIpXf_00141]).c(SRS_Xfrm_00102)
If the SOME/IP transformer would return with a return code different from E_OK this
would issue a hard error that prevents the RTE from sending the autonomous error
response.

7.3.2 Sender/Receiver Communication

Session Handling ID counter is used to set the correct Request ID in the SOME/IP
header in case of Sender/Receiver communication where session handling is acti-
vated.
[SWS_SomeIpXf_00212] dOne Session Handling ID counter (16 Bit) has to
be maintained per transformer function for Sender/Receiver communication (see
[SWS_SomeIpXf_00138]) if sessionHandlingSR is set to sessionHandlingAc-
tive.c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00213] dAll Session Handling ID counters shall be initialized with
0x0001.c(SRS_Xfrm_00008)
[SWS_SomeIpXf_00108] dThe SOME/IP transformer on the sender side of trans-
formed Sender/Receiver communication shall construct header and payload in the fol-
lowing way:
• Construct the payload
• Set the Request ID
– to 0x00 if sessionHandlingSR of SOMEIPTransformationISignal-
Props is not set to sessionHandlingActive
– the current value of the Session Handling ID counter otherwise
• Set the Protocol Version according [SWS_SomeIpXf_00029]
• Set the Interface Version. If interfaceVersion of SOMEIPTransforma-
tionISignalProps is set, this shall be used. Otherwise interfaceVersion
of SOMEIPTransformationDescription shall be used.
• Set the Message Type according to messageType of SOMEIPTransforma-
tionISignalProps:
– NOTIFICATION (0x02) shall be used in the header if attribute mes-
sageType is set to notification

56 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

– REQUEST_NO_RETURN (0x01) shall be used in the header if attribute mes-


sageType is set to requestNoReturn
• Set the Return Code to 0x00
c(SRS_Xfrm_00102)
In [SWS_SomeIpXf_00108] it is specified when session handling is considered for
messages which are sent. The SOME/IP transformer never checks the session ID on
receiver side because the default behaviour of SOME/IP is for sender/receiver commu-
nication to ignore session IDs on receiver side.
[SWS_SomeIpXf_00176] dThe payload of a message for Sender/Receiver communi-
cation shall consists of the serialized data element that is transported.c(SRS_Xfrm_-
00102)
Error handling and return codes have to be implemented by the application when
needed.

7.3.3 External Trigger Events

External trigger events are used to trigger RPCs without any IN, INOUT or OUT ar-
guments or to represent a special kind of an event without any parameters that is
transmitted from a server to one or more client(s) and at which occurrence the Service
Consumer shall react in a particular manner. External trigger events are realized by
SOME/IP as fire-and-forget methods without arguments
[SWS_SomeIpXf_00204] dThe SOME/IP transformer on the trigger source side of
transformed external trigger events shall construct header in the following way:
• Set the Request ID
– to 0x00 if sessionHandlingSR of SOMEIPTransformationISignal-
Props is not set to sessionHandlingActive
– the current value of the Session Handling ID counter otherwise
• Set the Protocol Version according [SWS_SomeIpXf_00029]
• Set the Interface Version. If interfaceVersion of SOMEIPTransforma-
tionISignalProps is set, this shall be used. Otherwise interfaceVersion
of SOMEIPTransformationDescription shall be used.
• Set the Message Type to REQUEST_NO_RETURN (i.e. 0x01)
• Set the Return Code to 0x00
c(SRS_Xfrm_00102)
[SWS_SomeIpXf_00205] dThe payload of a message for external trigger event com-
munication shall be empty.c(SRS_Xfrm_00102)

57 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Error handling and return codes have to be implemented by the application when
needed.

7.3.4 Error Handling

The error handling will be done solely in the application. SOME/IP only transports the
errors.
Two different mechanisms for error transportation are supported: Return Code and
Error Message
[SWS_SomeIpXf_00111] dThe SOME/IP transformer shall use the Return Code error
handling.c(SRS_Xfrm_00102, SRS_Xfrm_00103)
Exceptions are specified in SOME/IP but not yet supported by this version of the
SOME/IP transformer.
This can be used to handle all different application errors that might occur in the server.
In addition, problems with the communication medium or intermediate components
(e.g. switches) may occur, which have to be handled e.g. by means of reliable trans-
port.
All messages have a return code field to carry the return code. However, only re-
sponses (Message Types 0x80 and 0x81) use this field to carry a return code to the
request (Message Type 0x00) they answer. All other messages set this field to 0x00
(see Chapter 7.2.3.6). For more detailed errors the layout of the Error Message (Mes-
sage Type 0x81) can carry specific fields for error handling, e.g. an Exception String.
Error Messages are sent instead of Response Messages.

7.3.4.1 Return Code

[SWS_SomeIpXf_00112] dThe Error Handling via Return Code shall be based on the
Std_ReturnType.c(SRS_Xfrm_00102)
[SWS_SomeIpXf_00113] dThe Return Codes shall only be used for Client/Server
communicationc(SRS_Xfrm_00102)
[SWS_SomeIpXf_00170] dIn case of Client/Server communication the Return Code
shall transport the ApplicationErrors of the executed ClientServerOperation
if no SOME/IP error occurred.c(SRS_Xfrm_00102)
This means: If a SOME/IP error occurred, this error is contained in the Return Code. If
no SOME/IP error occurred, the Return Code contains the error (or success) code of
the executed server runnable.
If an error occurs in case of client/server communication the server can be configured
to create an autonomous error reaction which will be sent back to the client. In that

58 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

response, the SOME/IP header fields RequestId and Interface Version shall
be equal to the values in the header of the request message.
This is realized by [SWS_SomeIpXf_00201] which fills the header fields accordingly:
RequestId is handed over from RTE and InterfaceVersion is consistent to the
request as the configuration of the SOME/IP transformer only allows the same inter-
faceVersion for request and response.
[SWS_SomeIpXf_00115] dThe Return Codes of Table 7.11 are currently defined and
shall be implemented as described:c(SRS_Xfrm_00102)

ID Name Description
0x00 E_OK No error occurred
0x01 E_NOT_OK An unspecified error occurred
0x04 SOMEIPXF_E_NOT_READY Service ID and Method ID are known. Application
not running.
0x05 SOMEIPXF_E_NOT_ System running the service is not reachable (inter-
REACHABLE nal error code only).
0x06 SOMEIPXF_E_TIMEOUT A timeout occurred (internal error code only).
0x07 SOMEIPXF_E_WRONG_ Version of SOME/IP protocol not supported
PROTOCOL_
VERSION
0x08 SOMEIPXF_E_WRONG_ Interface version mismatch
INTERFACE_
VERSION
0x09 SOMEIPXF_E_ Deserialization error, so that payload cannot be de-
MALFORMED_MESSAGE serialized.
0x0a SOMEIPXF_E_ An unexpected message type was received (e.g.
WRONG_MESSAGE_TYPE REQUEST_NO_RETURN for a method defined as
REQUEST.)
0x0b E_E2E Not further specified E2E error
0x0c - RESERVED Reserved for generic SOME/IP errors. These errors
0x1f will be specified in future versions of this document.
0x20 - - Specific ApplicationErrors of
0x5e ClientServerOperations. These errors are the
application errors specified by the ClientServer-
Interface.
As the range of ApplicationErrors of the
ClientServerInterface is 0x01-0x3F, the
value of an ApplicationError has to be adapted
for transport over SOME/IP by adding 0x1F.

Table 7.11: Return Codes

7.3.4.2 Communication Errors and Handling of Communication Errors

When considering the transport of Client/Server messages different reliability seman-


tics exist:
• Maybe — the message might reach the communication partner

59 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• At least once — the message reaches the communication partner at least once
• Exactly once — the message reaches the communication partner exactly once
When using these terms in regard to client/server communication the term applies to
both messages (i.e. call and response or error).
While different implementations may implement different approaches, SOME/IP trans-
former currently achieves "maybe" reliability when using the UDP binding and "exactly
once" reliability when using the TCP binding by a suitable configuration of the Ethernet
modules. Further error handling is left to the application.
For "maybe" reliability, only a single timeout is needed, when using client/server com-
munication in combination with UDP as transport protocol. Figure 7.13 shows the
state machines for "maybe" reliability. The client’s SOME/IP implementation has to
wait for the response for a specified timeout. If the timeout occurs SOME/IP shall
signal SOMEIPXF_E_TIMEOUT to the client application.

Client
/Send Response
Request WaitingForResponse Received

Response Timeout Error:


SOMEIPXF_E_TIMEOUT

Server

Request Received processing /Send Response

Figure 7.13: State Machines for Reliability "Maybe"

For "exactly once" reliability the TCP binding may be used, since TCP was defined to
allow for reliable communication.
Additional mechanisms to reach higher reliability may be implemented in the applica-
tion or in a SOME/IP implementation. Keep in mind that the communication does not
have to implement these features. Chapter 7.3.4.2.1 describes such optional reliability
mechanisms.

60 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7.3.4.2.1 Application based Error Handling

The application can easily implement "at least once" reliability by using idempotent
operations (i.e. operation that can be executed multiple times without side effects)
and using a simple timeout mechanism. Figure 7.14 shows the state machines for
"at least once" reliability using implicit acknowledgements. When the client sends out
the request it starts a timer with the timeout specified for the specific method. If no
response is received before the timer expires (round transition at the top), the client
will retry the operation. A Typical number of retries would be 2, so that 3 requests are
sent.
The number of retries, the timeout values, and the timeout behavior (constant or expo-
nential back off) are outside of the SOME/IP specification.
No Response Received
/TimeoutCounter++

Client
/Send Request, Response
set TimeoutCounter = 0 WaitingForResponse Received

Error:
SOMEIPXF_E_TIMEOUT
TimeoutCounter == n,
(No Response received)

Server

Request Received processing /Send Response

Figure 7.14: State Machines for Reliability "At least once" (idempotent operations)

7.4 Reserved and special identifiers for SOME/IP and SOME/IP-


SD.
In this chapter an overview of reserved and special identifiers are shown.
[SWS_SomeIpXf_00130] dReserved and special Service-IDs are defined in Table
7.12.c(SRS_Xfrm_00008)

Service-ID Description
0x0000 Reserved

61 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

0xFF00 - 0xFF1F Reserved for Testing at OEM


0xFF20 - 0xFF3F Reserved for Testing at Tier-1
0xFF40 - 0xFF5F 0xFF5F Reserved for ECU Internal Communication (Tier-1
proprietary)
0xFFFE Reserved for announcing non-SOME/IP service instances.
0xFFFF SOME/IP and SOME/IP-SD special service.

Table 7.12: Reserved and special Service-IDs

[SWS_SomeIpXf_00131] dReserved and special Instance-IDs are defined in Table


7.13.c(SRS_Xfrm_00008)

Instance-ID Description
0x0000 Reserved
0xFFFF All Instances

Table 7.13: Reserved and special Instance-IDs

[SWS_SomeIpXf_00132] dReserved and special Method-IDs/Event-IDs are defined in


Table 7.14.c(SRS_Xfrm_00008)

Method-ID Description
0x0000 Reserved
0x7FFF Reserved
0x8000 Reserved
0xFFFF Reserved

Table 7.14: Reserved and special Method-IDs/Event-IDs

[SWS_SomeIpXf_00133] dMethod-IDs and Event-IDs of Service 0xFFFF are defined


in Table 7.15.c(SRS_Xfrm_00008)

Method-ID/Event- Description
ID
0x0000 SOME/IP Magic Cookie Messages
0x8000 SOME/IP Magic Cookie Messages
0x8100 SOME/IP-SD messages (events)

Table 7.15: Method-IDs and Event-IDs of Service 0xFFFF

[SWS_SomeIpXf_00134] dBesides "otherserv" other names are supported by the con-


figuration option. Table 7.16 gives an overview of the reserved namesc(SRS_Xfrm_-
00008)

Name Description
hostname Used to name a host or ECU.
instancename Used to name an instance of a service.
servicename Used to name a service.

62 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

otherserv Used for non-SOME/IP Services.

Table 7.16: Reserved names of configuration options

7.5 Error Classification


Section 7.5 "Error Handling" of the document "General Specification of Basic Software
Modules" describes the error handling of the Basic Software in detail. Above all, it
constitutes a classification scheme consisting of five error types which may occur in
[14, SWS BSW General] modules.
Based on this foundation, the following section specifies particular errors arranged in
the respective subsections below.

7.5.1 Development Errors

[SWS_SomeIPxf_00184] d
Type of error Related error code Error value
Error code if any other API service, except Get SOMEIPXF_E_UNINIT 0x01
VersionInfo is called before the transformer
module was initialized with Init or after a call to De
Init
Error code if an invalid configuration set was SOMEIPXF_E_INIT_FAILED 0x02
selected
API service called with wrong parameter SOMEIPXF_E_PARAM 0x03
API service called with invalid pointer SOMEIPXF_E_PARAM_POINTER 0x04

c(SRS_BSW_00337)

7.5.2 Runtime Errors

There are no runtime errors

7.5.3 Transient Faults

There are no transient faults.

7.5.4 Production Errors

There are no production errors.

63 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

7.5.5 Extended Production Errors

All Extended Production Errors valid for SOME/IP Transformer are specified in [3,
ASWS Transformer General].

64 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

8 API specification

8.1 Imported types


There are no imported types from other modules beyond those specified in [3, ASWS
Transformer General].
In the Module Interlink Headers file which is imported by the SOME/IP Transformer, all
ImplementationDataTypes known to the RTE are included. Using this mechanism,
the SOME/IP Transformer knows all data types of data which shall be transformed.

8.2 Type definitions


[SWS_SomeIpXf_00183] d
Name SomeIpXf_ConfigType
Kind Structure
Elements implementation specific
Type –
Comment –
Description This is the type of the data structure containing the initialization data for the transformer.
Available via SomeIpXf.h

c(SRS_BSW_00404, SRS_BSW_00441)

8.3 Function definitions


The SOME/IP transformer provides the specific interfaces generally required by [3,
ASWS Transformer General].
[SWS_SomeIpXf_00150] dThe SOME/IP Transformer shall only provide functions for
transformers where the TransformationTechnology is referenced as the first ref-
erence in the list of ordered references transformer from a DataTransformation
to a TransformationTechnology.c()
That means, only the first transformer in a transformer chain can be a SOME/IP Trans-
former because serializer transformer are in general only allowed to be the first trans-
former in a chain.

8.3.1 SomeIpXf_ExtractProtocolHeaderFields

[SWS_SomeIpXf_91001] d

65 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Service Name SomeIpXf_ExtractProtocolHeaderFields


Syntax Std_ReturnType SomeIpXf_ExtractProtocolHeaderFields (
const uint8* buffer,
uint32 bufferLength,
Std_MessageTypeType* messageType,
Std_MessageResultType* messageResult
)

Service ID [hex] 0x05


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) buffer Buffer allocated by the RTE, where the transformed data has to
be stored by the transformer.
bufferLength Length of the buffer
Parameters (inout) None
Parameters (out) messageType Canonical representation of the message type (extracted from the
transformers protocol header).
messageResult Canonical representation of the message result type (extracted
from the transformers protocol header).
Return value Std_ReturnType E_OK: Relevant protocol header fields have been extracted
successfully.
E_NOT_OK: An error occurred during parsing of the SOME/IP
protocol header (e.g., incorrect protocol version or insufficient
buffer length (bufferLength smaller than minimal SOME/IPheader
length))
Description Function to extract the relevant SOME/IP protocol header fields of the message and the type of
the message result. - At the time being, this is limited to the types used for C/S communication
(i.e., REQUEST and RESPONSE and OK and ERROR).
Available via SomeIpXf.h

c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00296] dThe function SomeIpXf_ExtractProtocolHeader-
Fields specified in [SWS_SomeIpXf_91001] shall extract the type of a message and
the type of the message result from the SOME/IP protocol header and provide this in-
formation in a canonical representation via its output arguments.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00297] dThe function SomeIpXf_ExtractProtocolHeader-
Fields specified in [SWS_SomeIpXf_91001] shall check whether the provided
bufferLength is larger or equal than the size of the protocol header processed by
the SOME/IP transformer (i.e., 8 bytes). – If this is not the case, E_NOT_OK shall be
returned. Neither messageType nor messageResult shall be modified in this case.c
(SRS_Xfrm_00002)
[SWS_SomeIpXf_00298] dThe function SomeIpXf_ExtractProtocolHeader-
Fields specified in [SWS_SomeIpXf_91001] shall check whether the value of the
Protocol Version field (see [PRS_SOMEIP_00052]) is equal to the value defined by
[PRS_SOMEIP_00051]. – If this is not the case, E_NOT_OK shall be returned. Nei-
ther messageType nor messageResult shall be modified in this case.c(SRS_Xfrm_-
00002)

66 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00299] dThe function SomeIpXf_ExtractProtocolHeader-


Fields specified in [SWS_SomeIpXf_91001] shall check whether the value of the
Message Type field (see [PRS_SOMEIP_00055]) is equal REQUEST, RESPONSE, or
ERROR. – If this is not the case, E_NOT_OK shall be returned. Neither messageType
nor messageResult shall be modified in this case.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00301] dThe function SomeIpXf_ExtractProtocolHeader-
Fields specified in [SWS_SomeIpXf_91001] shall return E_OK in all other cases.c
(SRS_Xfrm_00002)
[SWS_SomeIpXf_00302] dThe function SomeIpXf_ExtractProtocolHead-
erFields specified in [SWS_SomeIpXf_91001] shall set messageType to
STD_MESSAGETYPE_REQUEST in case the value of the Message Type field (see
[PRS_SOMEIP_00055]) is equal REQUEST.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00303] dThe function SomeIpXf_ExtractProtocolHead-
erFields specified in [SWS_SomeIpXf_91001] shall set messageType to
STD_MESSAGETYPE_RESULT in case the value of the Message Type field (see
[PRS_SOMEIP_00055]) is equal RESULT or ERROR.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00304] dThe function SomeIpXf_ExtractProtocolHeader-
Fields specified in [SWS_SomeIpXf_91001] shall set messageResult to
STD_MESSAGERESULT_ERROR in case the value of the Message Type field (see
[PRS_SOMEIP_00055]) is equal to ERROR or if the value of the Return Code field
(see [PRS_SOMEIP_00058]) is different from 0.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00305] dThe function SomeIpXf_ExtractProtocolHeader-
Fields specified in [SWS_SomeIpXf_91001] shall set messageResult to
STD_MESSAGERESULT_OK otherwise (i.e., in case the value of the Message Type field
(see [PRS_SOMEIP_00055]) is different from ERROR and if the value of the Return
Code field (see [PRS_SOMEIP_00058]) is 0.c(SRS_Xfrm_00002)

8.3.2 SomeIpXf_<transformerId>

[SWS_SomeIpXf_00138] d
Service Name SomeIpXf_<transformerId>
Syntax uint8 SomeIpXf_<transformerId> (
uint8* buffer,
uint32* bufferLength,
<paramtype> dataElement
)

Service ID [hex] 0x03


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) dataElement Data element which shall be transformed
Parameters (inout) None
5

67 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Parameters (out) buffer Buffer allocated by the RTE, where the transformed data has to
be stored by the transformer
bufferLength Used length of the buffer
Return value uint8 0x00 (E_OK): Serialization successful
0x81 (E_SER_GENERIC_ERROR): A generic error occurred
Description This function transforms a Sender/Receiver communication using the serialization of SOME/IP.
It takes the data element as input and outputs a uint8 array containing the serialized data.
The length of the serialized data shall be calculated by the transformer during runtime and
returned in the OUT-parameter bufferLength. It may be smaller than the maximum buffer size
used by the RTE for buffer allocation.
Available via SomeIpXf.h

c()
[SWS_SomeIpXf_00228] dIn function SomeIpXf_<transformerId> defined in
[SWS_SomeIpXf_00138]
• paramtype is derived from type according to the parameter passing rules rules
defined by the [15, SRS BSW General] (see [SRS_BSW_00484], [SRS_BSW_-
00485], and [SRS_BSW_00486]) and [14, SWS BSW General] (see [SWS_-
BSW_00186] and [SWS_BSW_00187]).
• type shall be the data type of the data element after all data conversion activities
of the RTE
• transformerId shall be the name pattern for the transformer specified in
[SWS_Xfrm_00062] ([3, ASWS Transformer General])
c()
This function specified in [SWS_SomeIpXf_00138] exists for each transformed
Sender/Receiver communication which uses the SOME/IP serialization.
[SWS_SomeIpXf_00139] dThe function SomeIpXf_<transformerId> specified in
[SWS_SomeIpXf_00138] shall exist for the first reference in the list of ordered refer-
ences transformer from a DataTransformation to a TransformationTech-
nology if the DataTransformation is referenced by an ISignal in the role data-
Transformation where the ISignal references a SystemSignal which is refer-
enced by SenderReceiverToSignalMapping.c()
[SWS_SomeIpXf_00140] dThe function SomeIpXf_<transformerId> specified
in [SWS_SomeIpXf_00138] shall serialize primitive or complex data elements of
Sender/Receiver communication into a linear byte array representation using the
SOME/IP serialization.c()
[SWS_SomeIpXf_00214] dAfter serialization of the data, the function
SomeIpXf_<transformerId> specified in [SWS_SomeIpXf_00138] shall in-
crement the Session Handling ID counter assigned to <transformerId> if
sessionHandlingSR is set to sessionHandlingActive.c()

68 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00215] dWhen the Session Handling ID counter assigned to


<transformerId> is 0xFFFF and gets incremented, it shall roll-over to 0x0001 (in-
stead of 0x0000) if sessionHandlingSR is set to sessionHandlingActive.c()
[SWS_SomeIpXf_00141] d
Service Name SomeIpXf_<transformerId>
Syntax uint8 SomeIpXf_<transformerId> (
const Rte_Cs_TransactionHandleType* TransactionHandle,
uint8* buffer,
uint32* bufferLength,
[Std_ReturnType returnValue],
<paramtype> data_1, ...
<paramtype> data_n
)

Service ID [hex] 0x03


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransactionHandle Transaction handle according to [SWS_Rte_08732] (clientId and
sequenceCounter) needed to differentiate between multiple
requests.
returnValue Return value from server side for transmission to the calling
client. This argument is only available for serializers of the
response of a Client/Server communication if
• the ClientServerOperation has at least one PossibleError
defined or
• autonomous error reaction is activated
data_1 Client/Server operation argument which shall be transformed (in
the same order as in the corresponding interface)
... ...
data_n Client/Server operation argument which shall be transformed (in
the same order as in the corresponding interface)
Parameters (inout) None
Parameters (out) buffer Buffer allocated by the RTE, where the transformed data has to
be stored by the transformer
bufferLength Used length of the buffer
Return value uint8 0x00 (E_OK): Serialization successful
0x81 (E_SER_GENERIC_ERROR): A generic error occurred
Description This function transforms a Client/Server communication using the serialization of SOME/IP. It
takes the operation arguments and optionally the return value as input and outputs a uint8 array
containing the serialized data.
The length of the serialized data shall be calculated by the transformer during runtime and
returned in the OUT-parameter bufferLength. It may be smaller than the maximum buffer size
used by the RTE for buffer allocation.
Available via SomeIpXf.h

c()
[SWS_SomeIpXf_00229] dIn function SomeIpXf_<transformerId> defined in
[SWS_SomeIpXf_00141]

69 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

• paramtype is derived from type according to the parameter passing rules rules
defined by the [15, SRS BSW General] (see [SRS_BSW_00484], [SRS_BSW_-
00485], and [SRS_BSW_00486]) and [14, SWS BSW General] (see [SWS_-
BSW_00186] and [SWS_BSW_00187]).
• type shall be the data type of the data element after all data conversion activities
of the RTE
• transformerId shall be the name pattern for the transformer specified in
[SWS_Xfrm_00062] ([3, ASWS Transformer General]).
c()
This function specified in [SWS_SomeIpXf_00141] exists for the server and each client
of each transformed Client/Server communication which uses the SOME/IP serializa-
tion.
It exists on both the Client and the Server but the arguments are different.
On the client it serializes the request of the Client/Server call. There, the data_1, ...,
data_n arguments of the API correpsond to the IN and INOUT arguments of the
ClientServerOperation. The argument returnValue doesn’t exist.
On the server it serializes the response of the Client/Server call. There, the data_1,
..., data_n arguments of the API correpsond to the INOUT and OUT arguments of the
ClientServerOperation. The argument returnValue exists here if at least one
PossibleError is defined for the ClientServerOperation because the return
code of the operation has to be transmitted.
[SWS_SomeIpXf_00142] dThe function SomeIpXf_<transformerId> specified in
[SWS_SomeIpXf_00141] shall exist for the first reference in the list of ordered refer-
ences transformer from a DataTransformation to a TransformationTech-
nology if the DataTransformation is referenced by an ISignal in the role
dataTransformation where the ISignal references a SystemSignal which
is referenced by ClientServerToSignalMapping in the callSignal or re-
turnSignal.c()
Due to [SWS_SomeIpXf_00142], the API of [SWS_SomeIpXf_00141] exists both on
client and server.
[SWS_SomeIpXf_00143] dThe function SomeIpXf_<transformerId>
[_<symbolSuffix>] specified in [SWS_SomeIpXf_00141] shall serialize all primi-
tive or complex operation arguments and the return value (if executed on server side) of
Client/Server communication into a linear byte array representation using the SOME/IP
serialization.c()
[SWS_SomeIpXf_00203] dThe function SomeIpXf_<transformerId>
[_<symbolSuffix>] specified in [SWS_SomeIpXf_00141] shall ignore all argu-
ments data_1, ..., data_n if the return code is greater or equal to 0x80 because
they are not filled with meaningful values.c(SRS_Xfrm_00105)

70 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00206] d
Service Name SomeIpXf_<transformerId>
Syntax uint8 SomeIpXf_<transformerId> (
uint8* buffer,
uint32* bufferLength
)

Service ID [hex] 0x03


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) buffer Buffer allocated by the RTE, where the transformed data has to
be stored by the transformer
bufferLength Used length of the buffer
Return value uint8 0x00 (E_OK): Serialization successful
0x81 (E_SER_GENERIC_ERROR): A generic error occurred
Description This function transforms an external trigger event using the serialization of SOME/IP. It takes
trigger as input and outputs a uint8 array.
The length of the transformed data shall be calculated by the transformer during runtime and
returned in the OUT parameter bufferLength. It may be smaller than the maximum buffer size
used by the RTE for buffer allocation.
Available via SomeIpXf.h

c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00230] dIn function SomeIpXf_<transformerId> defined in
[SWS_SomeIpXf_00206]
• transformerId shall be the name pattern for the transformer specified in
[SWS_Xfrm_00062] ([3, ASWS Transformer General]).
c()
This function specified in [SWS_SomeIpXf_00206] exists on the trigger source side for
each transformed external trigger event which uses SOME/IP transformation.
[SWS_SomeIpXf_00207] dThe function SomeIpXf_<transformerId> specified in
[SWS_SomeIpXf_00206] shall exist for the first referenced TransformationTech-
nology in the ordered transformerChain of a DataTransformation if the
DataTransformation is referenced by an ISignal in the role dataTransfor-
mation where the ISignal references a SystemSignal which is referenced by a
TriggerToSignalMapping.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00208] dThe function SomeIpXf_<transformerId> specified in
[SWS_SomeIpXf_00206] shall serialize an external trigger event into a linear byte array
representation using the SOME/IP serialization.c(SRS_Xfrm_00002)
As an external trigger event consists of an ISignal with length equal to zero, the
serialized SOME/IP message only contains a header but no payload.

71 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

8.3.3 SomeIpXf_Inv_<transformerId>

[SWS_SomeIpXf_00144] d
Service Name SomeIpXf_Inv_<transformerId>
Syntax uint8 SomeIpXf_Inv_<transformerId> (
const uint8* buffer,
uint32 bufferLength,
<type>* dataElement
)

Service ID [hex] 0x04


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) buffer Buffer allocated by the RTE, where the still serialized data are
stored by the Rte
bufferLength Used length of the buffer
Parameters (inout) None
Parameters (out) dataElement Data element which is the result of the transformation and
contains the deserialized data element
Return value uint8 0x00 (E_OK): Deserialization successful
0x01 (E_NO_DATA): No data available which can be deserialized
0x81 (E_SER_GENERIC_ERROR): A generic error occurred
0x87 (E_SER_WRONG_PROTOCOL_VERSION): The version of
the receiving transformer didn’t match the sending transformer.
0x88 (E_SER_WRONG_INTERFACE_VERSION): Interface
version of serialized data is not supported.
0x89 (E_SER_MALFORMED_MESSAGE): The received
message is malformed. The transformer is not able to produce an
output.
0x8a (E_SER_WRONG_MESSAGE_TYPE): The received
message type was not expected.
Description This function deserializes a Sender/Receiver communication using the deserialization of
SOME/IP. It takes the uint8 array containing the serialized data as input and outputs the original
data element which will be passed to the RTE.
Available via SomeIpXf.h

c()
[SWS_SomeIpXf_00231] dIn function SomeIpXf_Inv_<transformerId> defined
in [SWS_SomeIpXf_00144]
• type shall be the data type of the data element before all data conversion activi-
ties of the RTE
• transformerId shall be the name pattern for the transformer specified in
[SWS_Xfrm_00062] ([3, ASWS Transformer General]).
c()
This function specified in [SWS_SomeIpXf_00144] exists for each transformed
Sender/Receiver communication which uses the SOME/IP serialization.
[SWS_SomeIpXf_00146] dThe function SomeIpXf_Inv_<transformerId> speci-
fied in [SWS_SomeIpXf_00144] shall exist for the first reference in the list of ordered

72 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

references transformer from a DataTransformation to a Transformation-


Technology if the DataTransformation is referenced by an ISignal in the role
dataTransformation where the ISignal references a SystemSignal which is
referenced by SenderReceiverToSignalMapping.c()
[SWS_SomeIpXf_00147] dThe function SomeIpXf_Inv_<transformerId> spec-
ified in [SWS_SomeIpXf_00144] shall deserialize a linear byte array to primitive or
complex data elements of Sender/Receiver communication using the SOME/IP dese-
rialization.c()
[SWS_SomeIpXf_00264] dIf SomeIpXf_Inv_<transformerId> specified in
[SWS_SomeIpXf_00144] is called with buffer equal to NULL_PTR and buffer-
Length equal to 0, the output buffer buffer shall not be changed and
SomeIpXf_Inv_<transformerId> shall return with E_NO_DATA.c(SRS_Xfrm_-
00001, SRS_Xfrm_00004)
[SWS_SomeIpXf_00145] d
Service Name SomeIpXf_Inv_<transformerId>
Syntax uint8 SomeIpXf_Inv_<transformerId> (
Rte_Cs_TransactionHandleType* TransactionHandle,
const uint8* buffer,
uint32 bufferLength,
[Std_ReturnType* returnValue],
[<paramtype> data]
)

Service ID [hex] 0x04


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) buffer Buffer allocated by the RTE, where the still serialized data are
stored by the Rte
bufferLength Used length of the buffer
Parameters (inout) None
Parameters (out) TransactionHandle Transaction handle according to [SWS_Rte_08732] (clientId and
sequenceCounter) needed to differentiate between multiple
requests.
returnValue Return value from server side for transmission to the calling
client. This argument is only available for serializers of the
response of a Client/Server communication if
• the ClientServerOperation has at least one PossibleError
defined or
• autonomous error reaction is activated
data Client/Server operation argument which shall be transformed (in
the same order as in the corresponding interface)
5

73 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Return value uint8 0x00 (E_OK): Deserialization successful
0x01 (E_NO_DATA): No data available which can be deserialized
0x81 (E_SER_GENERIC_ERROR): A generic error occurred
0x87 (E_SER_WRONG_PROTOCOL_VERSION): The version of
the receiving transformer didn’t match the sending transformer.
0x88 (E_SER_WRONG_INTERFACE_VERSION): Interface
version of serialized data is not supported.
0x89 (E_SER_MALFORMED_MESSAGE): The received
message is malformed. The transformer is not able to produce an
output.
0x8a (E_SER_WRONG_MESSAGE_TYPE): The received
message type was not expected.
Description This function deserializes a Client/Server communication using the deserialization of SOME/IP.
It takes the uint8 array containing the serialized data as input and outputs the return value of
the server runnable and the operation arguments which have to be passed from the server to
the client.
Available via SomeIpXf.h

c()
[SWS_SomeIpXf_00232] dIn function SomeIpXf_Inv_<transformerId> defined
in [SWS_SomeIpXf_00145]
• paramtype is derived from type according to the parameter passing rules rules
defined by the [15, SRS BSW General] (see [SRS_BSW_00484], [SRS_BSW_-
00485], and [SRS_BSW_00486]) and [14, SWS BSW General] (see [SWS_-
BSW_00186] and [SWS_BSW_00187]).
• type shall be the data type of the data element before all data conversion activi-
ties of the RTE
• transformerId shall be the name pattern for the transformer specified in
[SWS_Xfrm_00062] ([3, ASWS Transformer General]).
c()
This function specified in [SWS_SomeIpXf_00145] exists for the server and each client
of each transformed Client/Server communication which uses the SOME/IP serializa-
tion.
It exists on both the Client and the Server but the arguments are different.
On the server it deserializes the request of the Client/Server call. There, the data_1,
..., data_n arguments of the API correpsond to the IN and INOUT arguments of the
ClientServerOperation. The argument returnValue doesn’t exist.
On the client it deserializes the response of the Client/Server call. There, the data_1,
..., data_n arguments of the API correpsond to the INOUT and OUT arguments of the
ClientServerOperation. The argument returnValue exists here if at least one
PossibleError is defined for the ClientServerOperation because the return
code of the operation has to be transmitted
[SWS_SomeIpXf_00148] d

74 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

The function SomeIpXf_Inv_<transformerId> specified in


[SWS_SomeIpXf_00145] shall exist for the first reference in the list of ordered
references transformer from a DataTransformation to a Transformation-
Technology if the DataTransformation is referenced by an ISignal in the
role dataTransformation where the ISignal references a SystemSignal
which is referenced by ClientServerToSignalMapping in the callSignal or
returnSignal.c()
Due to [SWS_SomeIpXf_00148], the API of [SWS_SomeIpXf_00145] exists both on
client and server.
[SWS_SomeIpXf_00149] dThe function SomeIpXf_Inv_<transformerId> spec-
ified in [SWS_SomeIpXf_00145] shall deserialize a linear byte array which contains
primitive or complex operation arguments and the return value (if executed on client
side) of Client/Server communication using the SOME/IP deserialization.c()
[SWS_SomeIpXf_00265] dIf SomeIpXf_Inv_<transformerId> specified in
[SWS_SomeIpXf_00145] is called with buffer equal to NULL_PTR and buffer-
Length equal to 0, the output buffer buffer shall not be changed and
SomeIpXf_Inv_<transformerId> shall return with E_NO_DATA.c(SRS_Xfrm_-
00001, SRS_Xfrm_00004)
[SWS_SomeIpXf_00209] d
Service Name SomeIpXf_Inv_<transformerId>
Syntax uint8 SomeIpXf_Inv_<transformerId> (
const uint8* buffer,
uint32 bufferLength
)

Service ID [hex] 0x04


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) buffer Buffer allocated by the RTE, where the still serialized data are
stored by the Rte
bufferLength Used length of the buffer
Parameters (inout) None
Parameters (out) None
Return value uint8 0x00 (E_OK): Deserialization successful
0x01 (E_NO_DATA): No data available which can be deserialized
0x81 (E_SER_GENERIC_ERROR): A generic error occurred
0x87 (E_SER_WRONG_PROTOCOL_VERSION): The version of
the receiving transformer didn’t match the sending transformer.
0x88 (E_SER_WRONG_INTERFACE_VERSION): Interface
version of serialized data is not supported.
0x89 (E_SER_MALFORMED_MESSAGE): The received
message is malformed. The transformer is not able to produce an
output.
0x8a (E_SER_WRONG_MESSAGE_TYPE): The received
message type was not expected.
Description This function deserializes an external trigger event using the deserialization of SOME/IP.
Available via SomeIpXf.h

c(SRS_Xfrm_00002)

75 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

[SWS_SomeIpXf_00233] dIn function SomeIpXf_Inv_<transformerId> defined


in [SWS_SomeIpXf_00209]
• transformerId shall be the name pattern for the transformer specified in
[SWS_Xfrm_00062] ([3, ASWS Transformer General]).
c()
This function specified in [SWS_SomeIpXf_00209] exists on the trigger sink side for
each transformed external trigger event which uses SOME/IP transformation.
[SWS_SomeIpXf_00210] dThe function SomeIpXf_Inv_<transformerId> speci-
fied in [SWS_SomeIpXf_00209] shall exist for the first referenced Transformation-
Technology in the ordered transformerChain of a DataTransformation if the
DataTransformation is referenced by an ISignal in the role dataTransfor-
mation where the ISignal references a SystemSignal which is referenced by a
TriggerToSignalMapping.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00211] dThe function SomeIpXf_Inv_<transformerId> spec-
ified in [SWS_SomeIpXf_00209] shall deserialize a linear byte array to an external
trigger event using the SOME/IP deserialization.c(SRS_Xfrm_00002)
[SWS_SomeIpXf_00266] dIf SomeIpXf_Inv_<transformerId> specified in
[SWS_SomeIpXf_00209] is called with buffer equal to NULL_PTR and buffer-
Length equal to 0, the output buffer buffer shall not be changed and
SomeIpXf_Inv_<transformerId> shall return with E_NO_DATA.c(SRS_Xfrm_-
00001, SRS_Xfrm_00004)
As an external trigger event consists of an ISignal with length = 64 Bit, the serialized
SOME/IP message only contains a header but no payload.

8.3.4 SomeIpXf_Init

[SWS_SomeIpXf_00181] d
Service Name SomeIpXf_Init
Syntax void SomeIpXf_Init (
const SomeIpXf_ConfigType* config
)

Service ID [hex] 0x01


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) config Pointer to the transformer’s configuration data.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service initializes the transformer for the further processing.
5

76 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Available via SomeIpXf.h

c(SRS_BSW_00407, SRS_BSW_00411)

8.3.5 SomeIpXf_DeInit

[SWS_SomeIpXf_00182] d
Service Name SomeIpXf_DeInit
Syntax void SomeIpXf_DeInit (
void
)

Service ID [hex] 0x02


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description This service deinitializes the transformer.
Available via SomeIpXf.h

c(SRS_BSW_00407, SRS_BSW_00411)

8.3.6 SomeIpXf_GetVersionInfo

[SWS_SomeIpXf_00180] d
Service Name SomeIpXf_GetVersionInfo
Syntax void SomeIpXf_GetVersionInfo (
Std_VersionInfoType* VersionInfo
)

Service ID [hex] 0x00


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) VersionInfo Pointer to where to store the version information of this module.
Return value None
Description This service returns the version information of the called transformer module.
Available via SomeIpXf.h

c(SRS_BSW_00407, SRS_BSW_00411)

77 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

8.4 Callback notifications


There are no callback notifications.

8.5 Scheduled functions


SOME/IP Transformer has no scheduled functions

8.6 Expected interfaces


There are no expected interfaces.

78 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

9 Sequence diagrams
There are no sequence diagrams applicable to SOME/IP Transformer.

79 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

10 Configuration specification
There is no module specific configuration available to the SOME/IP Transformer. The
EcuC defined in [3, ASWS Transformer General] shall be used.
[SWS_SomeIpXf_00185] dThe apiServicePrefix of the SOME/IP transformer’s
EcuC shall be set to SomeIpXf.c(SRS_BSW_00159)

80 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

A Referenced Meta Classes


For the sake of completeness, this chapter contains a set of class tables representing
meta-classes mentioned in the context of this document but which are not contained
directly in the scope of describing specific meta-model semantics.
Class ApplicationArrayDataType
Package M2::AUTOSARTemplates::SWComponentTemplate::Datatype::Datatypes
Note An application data type which is an array, each element is of the same application data type.
Tags:atp.recommendedPackage=ApplicationDataTypes
Base ARElement, ARObject, ApplicationCompositeDataType, ApplicationDataType, AtpBlueprint, Atp
Blueprintable, AtpClassifier , AtpType, AutosarDataType, CollectableElement, Identifiable, Multilanguage
Referrable, PackageableElement, Referrable
Attribute Type Mult. Kind Note
dynamicArray String 0..1 attr Specifies the profile which the array will follow if it is a
SizeProfile variable size array.
element ApplicationArray 0..1 aggr This association implements the concept of an array
Element element. That is, in some cases it is necessary to be able
to identify single array elements, e.g. as input values for
an interpolation routine.

Table A.1: ApplicationArrayDataType

Class ApplicationError
Package M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
Note This is a user-defined error that is associated with an element of an AUTOSAR interface. It is specific for
the particular functionality or service provided by the AUTOSAR software component.
Base ARObject, Identifiable, MultilanguageReferrable, Referrable
Attribute Type Mult. Kind Note
errorCode Integer 0..1 attr The RTE generator is forced to assign this value to the
corresponding error symbol. Note that for error codes
certain ranges are predefined (see RTE specification).

Table A.2: ApplicationError

Class ApplicationPrimitiveDataType
Package M2::AUTOSARTemplates::SWComponentTemplate::Datatype::Datatypes
Note A primitive data type defines a set of allowed values.
Tags:atp.recommendedPackage=ApplicationDataTypes
Base ARElement, ARObject, ApplicationDataType, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType,
AutosarDataType, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement,
Referrable
Attribute Type Mult. Kind Note
– – – – –
Table A.3: ApplicationPrimitiveDataType

81 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Class ArgumentDataPrototype
Package M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
Note An argument of an operation, much like a data element, but also carries direction information and is
owned by a particular ClientServerOperation.
Base ARObject, AtpFeature, AtpPrototype, AutosarDataPrototype, DataPrototype, Identifiable, Multilanguage
Referrable, Referrable
Attribute Type Mult. Kind Note
direction ArgumentDirection 0..1 attr This attribute specifies the direction of the argument
Enum prototype.
serverArgument ServerArgumentImpl 0..1 attr This defines how the argument type of the servers
ImplPolicy PolicyEnum RunnableEntity is implemented.
If the attribute is not defined this has the same semantics
as if the attribute is set to the value useArgumentType for
primitive arguments and structures.

Table A.4: ArgumentDataPrototype

Enumeration ArraySizeSemanticsEnum
Package M2::AUTOSARTemplates::CommonStructure::ImplementationDataTypes
Note This type controls how the information about the number of elements in an ApplicationArrayDataType
is to be interpreted.
Literal Description
fixedSize This means that the ApplicationArrayDataType will always have a fixed number of elements.
Tags:atp.EnumerationLiteralIndex=0
variableSize This implies that the actual number of elements in the ApplicationArrayDataType might vary at
run-time. The value of arraySize represents the maximum number of elements in the array.
Tags:atp.EnumerationLiteralIndex=1

Table A.5: ArraySizeSemanticsEnum

Class AutosarDataType (abstract)


Package M2::AUTOSARTemplates::SWComponentTemplate::Datatype::Datatypes
Note Abstract base class for user defined AUTOSAR data types for software.
Base ARElement, ARObject, AtpClassifier , AtpType, CollectableElement, Identifiable, Multilanguage
Referrable, PackageableElement, Referrable
Subclasses AbstractImplementationDataType, ApplicationDataType
Attribute Type Mult. Kind Note
swDataDef SwDataDefProps 0..1 aggr The properties of this AutosarDataType.
Props

Table A.6: AutosarDataType

Class BaseType (abstract)


Package M2::MSR::AsamHdo::BaseTypes
Note This abstract meta-class represents the ability to specify a platform dependent base type.
Base ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, Packageable
Element, Referrable
Subclasses SwBaseType
Attribute Type Mult. Kind Note
5

82 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class BaseType (abstract)
baseType BaseTypeDefinition 1 aggr This is the actual definition of the base type.
Definition
Tags:
xml.roleElement=false
xml.roleWrapperElement=false
xml.sequenceOffset=20
xml.typeElement=false
xml.typeWrapperElement=false

Table A.7: BaseType

Class BaseTypeDirectDefinition
Package M2::MSR::AsamHdo::BaseTypes
Note This BaseType is defined directly (as opposite to a derived BaseType)
Base ARObject, BaseTypeDefinition
Attribute Type Mult. Kind Note
baseType BaseTypeEncoding 0..1 attr This specifies, how an object of the current BaseType is
Encoding String encoded, e.g. in an ECU within a message sequence.
Tags:xml.sequenceOffset=90
baseTypeSize PositiveInteger 0..1 attr Describes the length of the data type specified in the
container in bits.
Tags:xml.sequenceOffset=70
byteOrder ByteOrderEnum 0..1 attr This attribute specifies the byte order of the base type.
Tags:xml.sequenceOffset=110
memAlignment PositiveInteger 0..1 attr This attribute describes the alignment of the memory
object in bits. E.g. "8" specifies, that the object in
question is aligned to a byte while "32" specifies that it is
aligned four byte. If the value is set to "0" the meaning
shall be interpreted as "unspecified".
Tags:xml.sequenceOffset=100
native NativeDeclarationString 0..1 attr This attribute describes the declaration of such a base
Declaration type in the native programming language, primarily in the
Programming language C. This can then be used by a
code generator to include the necessary declarations into
a header file. For example
BaseType with shortName: "MyUnsignedInt" native
Declaration: "unsigned short"
Results in
typedef unsigned short MyUnsignedInt;
If the attribute is not defined the referring Implementation
DataTypes will not be generated as a typedef by RTE.
If a nativeDeclaration type is given it shall fulfill the
characteristic given by basetypeEncoding and baseType
Size.
This is required to ensure the consistent handling and
interpretation by software components, RTE, COM and
MCM systems.
Tags:xml.sequenceOffset=120

Table A.8: BaseTypeDirectDefinition

83 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Class ClientServerInterface
Package M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
Note A client/server interface declares a number of operations that can be invoked on a server by a client.
Tags:atp.recommendedPackage=PortInterfaces
Base ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType, CollectableElement,
Identifiable, MultilanguageReferrable, PackageableElement, PortInterface, Referrable
Attribute Type Mult. Kind Note
operation ClientServerOperation * aggr ClientServerOperation(s) of this ClientServerInterface.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=blueprintDerivationTime
possibleError ApplicationError * aggr Application errors that are defined as part of this interface.

Table A.9: ClientServerInterface

Class ClientServerOperation
Package M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
Note An operation declared within the scope of a client/server interface.
Base ARObject, AtpClassifier , AtpFeature, AtpStructureElement, Identifiable, MultilanguageReferrable,
Referrable
Attribute Type Mult. Kind Note
argument ArgumentDataPrototype * aggr An argument of this ClientServerOperation
(ordered)
Stereotypes: atpVariation
Tags:vh.latestBindingTime=blueprintDerivationTime
diagArgIntegrity Boolean 0..1 attr This attribute shall only be used in the implementation of
diagnostic routines to support the case where input and
output arguments are allocated in a shared buffer and
might unintentionally overwrite input arguments by
tentative write operations to output arguments.
This situation can happen during sliced execution or while
output parameters are arrays (call by reference). The
value true means that the ClientServerOperation is aware
of the usage of a shared buffer and takes precautions to
avoid unintentional overwrite of input arguments.
If the attribute does not exist or is set to false the Client
ServerOperation does not have to consider the usage of a
shared buffer.
possibleError ApplicationError * ref Possible errors that may by raised by the referring
operation.

Table A.10: ClientServerOperation

Class ClientServerToSignalMapping
Package M2::AUTOSARTemplates::SystemTemplate::DataMapping
Note This element maps the ClientServerOperation to call- and return-SystemSignals.
Base ARObject, DataMapping
Attribute Type Mult. Kind Note
callSignal SystemSignal 1 ref Reference to the callSignal to which the IN and INOUT
ArgumentDataPrototypes are mapped.
5

84 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class ClientServerToSignalMapping
clientServer ClientServerOperation 1 iref Reference to a ClientServerOperation, which is mapped
Operation to a call SystemSignal and a return SystemSignal.
InstanceRef implemented by:OperationInSystem
InstanceRef
returnSignal SystemSignal 0..1 ref Reference to the returnSignal to which the OUT and
INOUT ArgumentDataPrototypes are mapped.

Table A.11: ClientServerToSignalMapping

Class DataPrototype (abstract)


Package M2::AUTOSARTemplates::SWComponentTemplate::Datatype::DataPrototypes
Note Base class for prototypical roles of any data type.
Base ARObject, AtpFeature, AtpPrototype, Identifiable, MultilanguageReferrable, Referrable
Subclasses ApplicationCompositeElementDataPrototype, AutosarDataPrototype
Attribute Type Mult. Kind Note
swDataDef SwDataDefProps 0..1 aggr This property allows to specify data definition properties
Props which apply on data prototype level.

Table A.12: DataPrototype

Class DataTransformation
Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note A DataTransformation represents a transformer chain. It is an ordered list of transformers.
Base ARObject, Identifiable, MultilanguageReferrable, Referrable
Attribute Type Mult. Kind Note
data DataTransformationKind 0..1 attr This attribute controls the kind of DataTransformation to
Transformation Enum be applied.
Kind
executeDespite Boolean 1 attr Specifies whether the transformer chain is executed even
Data if no input data are available.
Unavailability
transformer Transformation 1..* ref This attribute represents the definition of a chain of
Chain (ordered) Technology transformers that are supposed to be executed according
to the order of being referenced from DataTransformation.

Table A.13: DataTransformation

Enumeration DataTransformationErrorHandlingEnum
Package M2::AUTOSARTemplates::SWComponentTemplate::SwcInternalBehavior::PortAPIOptions
Note This enumeration defines different ways how a RunnableEntity shall handle transformer errors.
Literal Description
noTransformerError A runnable does not handle transformer errors.
Handling
Tags:atp.EnumerationLiteralIndex=0
transformerError The runnable implements the handling of transformer errors.
Handling
Tags:atp.EnumerationLiteralIndex=1

Table A.14: DataTransformationErrorHandlingEnum

85 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Class EcucModuleDef
Package M2::AUTOSARTemplates::ECUCParameterDefTemplate
Note Used as the top-level element for configuration definition for Software Modules, including BSW and RTE
as well as ECU Infrastructure.
Tags:atp.recommendedPackage=EcucModuleDefs
Base ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpDefinition, CollectableElement, Ecuc
DefinitionElement, Identifiable, MultilanguageReferrable, PackageableElement, Referrable
Attribute Type Mult. Kind Note
apiServicePrefix CIdentifier 0..1 attr For CDD modules this attribute holds the apiService
Prefix.
The shortName of the module definition of a Complex
Driver is always "Cdd". Therefore for CDD modules the
module apiServicePrefix is described with this attribute.
container EcucContainerDef * aggr Aggregates the top-level container definitions of this
specific module definition.
Stereotypes: atpSplitable
Tags:
atp.Splitkey=container.shortName
xml.sequenceOffset=11
postBuildVariant Boolean 0..1 attr Indicates if a module supports different post-build variants
Support (previously known as post-build selectable configuration
sets). TRUE means yes, FALSE means no.
refinedModule EcucModuleDef 0..1 ref Optional reference from the Vendor Specific Module
Def Definition to the Standardized Module Definition it refines.
In case this EcucModuleDef has the category
STANDARDIZED_MODULE_DEFINITION this reference
shall not be provided. In case this EcucModuleDef has
the category VENDOR_SPECIFIC_MODULE_
DEFINITION this reference is mandatory.
Stereotypes: atpUriDef
supported EcucConfiguration * attr Specifies which ConfigurationVariants are supported by
ConfigVariant VariantEnum this software module. This attribute is optional if the Ecuc
ModuleDef has the category STANDARDIZED_
MODULE_DEFINITION. If the category attribute of the
EcucModuleDef is set to VENDOR_SPECIFIC_
MODULE_DEFINITION then this attribute is mandatory.

Table A.15: EcucModuleDef

Class ISignal
Package M2::AUTOSARTemplates::SystemTemplate::Fibex::FibexCore::CoreCommunication
Note Signal of the Interaction Layer. The RTE supports a "signal fan-out" where the same System Signal is
sent in different SignalIPdus to multiple receivers.
To support the RTE "signal fan-out" each SignalIPdu contains ISignals. If the same System Signal is to
be mapped into several SignalIPdus there is one ISignal needed for each ISignalToIPduMapping.
ISignals describe the Interface between the Precompile configured RTE and the potentially Postbuild
configured Com Stack (see ECUC Parameter Mapping).
In case of the SystemSignalGroup an ISignal shall be created for each SystemSignal contained in the
SystemSignalGroup.
Tags:atp.recommendedPackage=ISignals
Base ARObject, CollectableElement, FibexElement, Identifiable, MultilanguageReferrable, Packageable
Element, Referrable
Attribute Type Mult. Kind Note
5

86 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class ISignal
data DataTransformation 0..1 ref Optional reference to a DataTransformation which
Transformation represents the transformer chain that is used to transform
the data that shall be placed inside this ISignal.
Stereotypes: atpSplitable; atpVariation
Tags:
atp.Splitkey=dataTransformation.dataTransformation,
dataTransformation.variationPoint.shortLabel
vh.latestBindingTime=codeGenerationTime
dataTypePolicy DataTypePolicyEnum 1 attr With the aggregation of SwDataDefProps an ISignal
specifies how it is represented on the network. This
representation follows a particular policy. Note that this
causes some redundancy which is intended and can be
used to support flexible development methodology as well
as subsequent integrity checks.
If the policy "networkRepresentationFromComSpec" is
chosen the network representation from the ComSpec
that is aggregated by the PortPrototype shall be used. If
the "override" policy is chosen the requirements specified
in the PortInterface and in the ComSpec are not fulfilled
by the networkRepresentationProps. In case the System
Description doesn’t use a complete Software Component
Description (VFB View) the "legacy" policy can be
chosen.
initValue ValueSpecification 0..1 aggr Optional definition of a ISignal’s initValue in case the
System Description doesn’t use a complete Software
Component Description (VFB View). This supports the
inclusion of legacy system signals.
This value can be used to configure the Signal’s "Init
Value".
If a full DataMapping exist for the SystemSignal this
information may be available from a configured Sender
ComSpec and ReceiverComSpec. In this case the
initvalues in SenderComSpec and/or ReceiverComSpec
override this optional value specification. Further
restrictions apply from the RTE specification.
iSignalProps ISignalProps 0..1 aggr Additional optional ISignal properties that may be stored
in different files.
Stereotypes: atpSplitable
Tags:atp.Splitkey=iSignalProps
iSignalType ISignalTypeEnum 0..1 attr This attribute defines whether this iSignal is an array that
results in a UINT8_N / UINT8_DYN ComSignalType in the
COM configuration or a primitive type.
length UnlimitedInteger 1 attr Size of the signal in bits. The size needs to be derived
from the mapped VariableDataPrototype according to the
mapping of primitive DataTypes to BaseTypes as used in
the RTE. Indicates maximum size for dynamic length
signals.
The ISignal length of zero bits is allowed.
network SwDataDefProps 0..1 aggr Specification of the actual network representation. The
Representation usage of SwDataDefProps for this purpose is restricted to
Props the attributes compuMethod and baseType. The optional
baseType attributes "memAllignment" and "byteOrder"
shall not be used.
The attribute "dataTypePolicy" in the SystemTemplate
element defines whether this network representation shall
be ignored and the information shall be taken over from
the network representation of the ComSpec.
5

87 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class ISignal
4
If "override" is chosen by the system integrator the
network representation can violate against the
requirements defined in the PortInterface and in the
network representation of the ComSpec.
In case that the System Description doesn’t use a
complete Software Component Description (VFB View)
this element is used to configure "ComSignalDataInvalid
Value" and the Data Semantics.
systemSignal SystemSignal 1 ref Reference to the System Signal that is supposed to be
transmitted in the ISignal.
timeout ValueSpecification 0..1 aggr Defines and enables the ComTimeoutSubstituition for this
Substitution ISignal.
Value
transformation TransformationISignal * aggr A transformer chain consists of an ordered list of
ISignalProps Props transformers. The ISignal specific configuration
properties for each transformer are defined in the
TransformationISignalProps class. The transformer
configuration properties that are common for all ISignals
are described in the TransformationTechnology class.

Table A.16: ISignal

Class Identifiable (abstract)


Package M2::AUTOSARTemplates::GenericStructure::GeneralTemplateClasses::Identifiable
Note Instances of this class can be referred to by their identifier (within the namespace borders). In addition to
this, Identifiables are objects which contribute significantly to the overall structure of an AUTOSAR
description. In particular, Identifiables might contain Identifiables.
Base ARObject, MultilanguageReferrable, Referrable
Subclasses ARPackage, AbstractDoIpLogicAddressProps, AbstractEvent, AbstractImplementationDataTypeElement,
AbstractSecurityEventFilter , AbstractSecurityIdsmInstanceFilter , AbstractServiceInstance, AppOsTask
ProxyToEcuTaskProxyMapping, ApplicationEndpoint, ApplicationError, ApplicationPartitionToEcuPartition
Mapping, AsynchronousServerCallResultPoint, AtpBlueprint, AtpBlueprintable, AtpClassifier , Atp
Feature, AutosarOperationArgumentInstance, AutosarVariableInstance, BinaryManifestAddressable
Object, BinaryManifestItemDefinition, BinaryManifestResource, BinaryManifestResourceDefinition, Block
State, BswInternalTriggeringPoint, BswModuleDependency, BuildActionEntity , BuildActionEnvironment,
CanTpAddress, CanTpChannel, CanTpNode, Chapter, ClassContentConditional, ClientIdDefinition,
ClientServerOperation, Code, CollectableElement, ComManagementMapping, CommConnectorPort,
CommunicationConnector , CommunicationController , Compiler, ConsistencyNeeds, ConsumedEvent
Group, CouplingPort, CouplingPortStructuralElement, CpSoftwareClusterResource, CpSoftwareCluster
ResourceToApplicationPartitionMapping, CpSoftwareClusterToEcuInstanceMapping, CpSoftwareCluster
ToResourceMapping, CryptoServiceMapping, DataPrototypeGroup, DataTransformation, Dependency
OnArtifact, DiagEventDebounceAlgorithm, DiagnosticConnectedIndicator, DiagnosticDataElement,
DiagnosticDebounceAlgorithmProps, DiagnosticFunctionInhibitSource, DiagnosticRoutineSubfunction,
DltApplication, DltArgument, DltLogChannel, DltMessage, DoIpInterface, DoIpLogicAddress, DoIp
RoutingActivation, ECUMapping, EOCExecutableEntityRefAbstract, EcuPartition, EcucContainerValue,
EcucDefinitionElement, EcucDestinationUriDef, EcucEnumerationLiteralDef, EcucQuery, EcucValidation
Condition, EndToEndProtection, EthernetWakeupSleepOnDatalineConfig, EventHandler, ExclusiveArea,
ExecutableEntity , ExecutionTime, FMAttributeDef, FMFeatureMapAssertion, FMFeatureMapCondition, F
MFeatureMapElement, FMFeatureRelation, FMFeatureRestriction, FMFeatureSelection, FlatInstance
Descriptor, FlexrayArTpNode, FlexrayTpConnectionControl, FlexrayTpNode, FlexrayTpPduPool, Frame
Triggering, GeneralParameter, GlobalTimeGateway, GlobalTimeMaster , GlobalTimeSlave, HeapUsage,
HwAttributeDef, HwAttributeLiteralDef, HwPin, HwPinGroup, IPSecRule, IPv6ExtHeaderFilterList, ISignal
ToIPduMapping, ISignalTriggering, IdentCaption, InternalTriggeringPoint, J1939SharedAddressCluster,
J1939TpNode, Keyword, LifeCycleState, LinScheduleTable, LinTpNode, Linker, MacMulticastGroup, Mc
DataInstance, MemorySection, ModeDeclaration, ModeDeclarationMapping, ModeSwitchPoint, Network
Endpoint, NmCluster , NmEcu, NmNode, NvBlockDescriptor, PackageableElement, ParameterAccess,
PduActivationRoutingGroup, PduToFrameMapping, PduTriggering, PerInstanceMemory, Physical
5

88 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class Identifiable (abstract)
4
Channel, PortElementToCommunicationResourceMapping, PortGroup, PortInterfaceMapping, Possible
ErrorReaction, ResourceConsumption, RootSwCompositionPrototype, RptComponent, RptContainer,
RptExecutableEntity, RptExecutableEntityEvent, RptExecutionContext, RptProfile, RptServicePoint, Rte
EventInCompositionSeparation, RteEventInCompositionToOsTaskProxyMapping, RteEventInSystem
Separation, RteEventInSystemToOsTaskProxyMapping, RunnableEntityGroup, SdgAttribute, SdgClass,
SecureCommunicationAuthenticationProps, SecureCommunicationFreshnessProps, SecurityEvent
ContextProps, ServerCallPoint, ServiceNeeds, SignalServiceTranslationElementProps, SignalService
TranslationEventProps, SignalServiceTranslationProps, SocketAddress, SomeipTpChannel, Spec
ElementReference, StackUsage, StaticSocketConnection, StructuredReq, SwGenericAxisParamType,
SwServiceArg, SwcServiceDependency, SwcToApplicationPartitionMapping, SwcToEcuMapping, SwcTo
ImplMapping, SystemMapping, TDCpSoftwareClusterMapping, TDCpSoftwareClusterResourceMapping,
TcpOptionFilterList, TimingCondition, TimingConstraint, TimingDescription, TimingExtensionResource,
TimingModeInstance, TlsCryptoCipherSuite, TlsCryptoCipherSuiteProps, Topic1, TpAddress, Traceable
Table, TraceableText, TracedFailure, TransformationProps, TransformationTechnology, Trigger, Variable
Access, VariationPointProxy, ViewMap, VlanConfig, WaitPoint
Attribute Type Mult. Kind Note
adminData AdminData 0..1 aggr This represents the administrative data for the identifiable
object.
Stereotypes: atpSplitable
Tags:
atp.Splitkey=adminData
xml.sequenceOffset=-40
annotation Annotation * aggr Possibility to provide additional notes while defining a
model element (e.g. the ECU Configuration Parameter
Values). These are not intended as documentation but
are mere design notes.
Tags:xml.sequenceOffset=-25
category CategoryString 0..1 attr The category is a keyword that specializes the semantics
of the Identifiable. It affects the expected existence of
attributes and the applicability of constraints.
Tags:xml.sequenceOffset=-50
desc MultiLanguageOverview 0..1 aggr This represents a general but brief (one paragraph)
Paragraph description what the object in question is about. It is only
one paragraph! Desc is intended to be collected into
overview tables. This property helps a human reader to
identify the object in question.
More elaborate documentation, (in particular how the
object is built or used) should go to "introduction".
Tags:xml.sequenceOffset=-60
introduction DocumentationBlock 0..1 aggr This represents more information about how the object in
question is built or is used. Therefore it is a
DocumentationBlock.
Tags:xml.sequenceOffset=-30
uuid String 0..1 attr The purpose of this attribute is to provide a globally
unique identifier for an instance of a meta-class. The
values of this attribute should be globally unique strings
prefixed by the type of identifier. For example, to include a
DCE UUID as defined by The Open Group, the UUID
would be preceded by "DCE:". The values of this attribute
may be used to support merging of different AUTOSAR
models. The form of the UUID (Universally Unique
Identifier) is taken from a standard defined by the Open
Group (was Open Software Foundation). This standard is
widely used, including by Microsoft for COM (GUIDs) and
by many companies for DCE, which is based on CORBA.
The method for generating these 128-bit IDs is published
5

89 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class Identifiable (abstract)
4
in the standard and the effectiveness and uniqueness of
the IDs is not in practice disputed. If the id namespace is
omitted, DCE is assumed. An example is
"DCE:2fac1234-31f8-11b4-a222-08002b34c003". The
uuid attribute has no semantic meaning for an AUTOSAR
model and there is no requirement for AUTOSAR tools to
manage the timestamp.
Tags:xml.attribute=true

Table A.17: Identifiable

Class Implementation (abstract)


Package M2::AUTOSARTemplates::CommonStructure::Implementation
Note Description of an implementation a single software component or module.
Base ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, Packageable
Element, Referrable
Subclasses BswImplementation, SwcImplementation
Attribute Type Mult. Kind Note
buildAction BuildActionManifest 0..1 ref A manifest specifying the intended build actions for the
Manifest software delivered with this implementation.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=codeGenerationTime
codeDescriptor Code * aggr Specifies the provided implementation code.
compiler Compiler * aggr Specifies the compiler for which this implementation has
been released
generated DependencyOnArtifact * aggr Relates to an artifact that will be generated during the
Artifact integration of this Implementation by an associated
generator tool. Note that this is an optional information
since it might not always be in the scope of a single
module or component to provide this information.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
hwElement HwElement * ref The hardware elements (e.g. the processor) required for
this implementation.
linker Linker * aggr Specifies the linker for which this implementation has
been released.
mcSupport McSupportData 0..1 aggr The measurement & calibration support data belonging to
this implementation. The aggregtion is <<atpSplitable>>
because in case of an already exisiting BSW
Implementation model, this description will be added later
in the process, namely at code generation time.
Stereotypes: atpSplitable
Tags:atp.Splitkey=mcSupport
programming Programminglanguage 0..1 attr Programming language the implementation was created
Language Enum in.
5

90 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class Implementation (abstract)
requiredArtifact DependencyOnArtifact * aggr Specifies that this Implementation depends on the
existance of another artifact (e.g. a library). This
aggregation of DependencyOnArtifact is subject to
variability with the purpose to support variability in the
implementations. Different algorithms in the
implementation might cause different dependencies, e.g.
the number of used libraries.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
required DependencyOnArtifact * aggr Relates this Implementation to a generator tool in order to
GeneratorTool generate additional artifacts during integration.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
resource ResourceConsumption 0..1 aggr All static and dynamic resources for each implementation
Consumption are described within the ResourceConsumption class.
Stereotypes: atpSplitable
Tags:atp.Splitkey=resourceConsumption.shortName
swcBsw SwcBswMapping 0..1 ref This allows a mapping between an SWC and a BSW
Mapping behavior to be attached to an implementation description
(for AUTOSAR Service, ECU Abstraction and Complex
Driver Components). It is up to the methodology to define
whether this reference has to be set for the Swc- or Bsw
Implementtion or for both.
swVersion RevisionLabelString 0..1 attr Software version of this implementation. The numbering
contains three levels (like major, minor, patch), its values
are vendor specific.
usedCode String 0..1 attr Optional: code generator used.
Generator
vendorId PositiveInteger 0..1 attr Vendor ID of this Implementation according to the
AUTOSAR vendor list

Table A.18: Implementation

Class ImplementationDataType
Package M2::AUTOSARTemplates::CommonStructure::ImplementationDataTypes
Note Describes a reusable data type on the implementation level. This will typically correspond to a typedef in
C-code.
Tags:atp.recommendedPackage=ImplementationDataTypes
Base ARElement, ARObject, AbstractImplementationDataType, AtpBlueprint, AtpBlueprintable, AtpClassifier ,
AtpType, AutosarDataType, CollectableElement, Identifiable, MultilanguageReferrable, Packageable
Element, Referrable
Attribute Type Mult. Kind Note
dynamicArray String 0..1 attr Specifies the profile which the array will follow in case this
SizeProfile data type is a variable size array.
isStructWith Boolean 0..1 attr This attribute is only valid if the attribute category is set to
Optional STRUCTURE.
Element
If set to True, this attribute indicates that the
ImplementationDataType has been created with the
intention to define at least one element of the structure as
optional.
5

91 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class ImplementationDataType
subElement ImplementationData * aggr Specifies an element of an array, struct, or union data
(ordered) TypeElement type.
The aggregation of ImplementionDataTypeElement is
subject to variability with the purpose to support the
conditional existence of elements inside a Implementation
DataType representing a structure.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
symbolProps SymbolProps 0..1 aggr This represents the SymbolProps for the Implementation
DataType.
Stereotypes: atpSplitable
Tags:atp.Splitkey=symbolProps.shortName
typeEmitter NameToken 0..1 attr This attribute is used to control which part of the
AUTOSAR toolchain is supposed to trigger data type
definitions.
Table A.19: ImplementationDataType

Class ImplementationDataTypeElement
Package M2::AUTOSARTemplates::CommonStructure::ImplementationDataTypes
Note Declares a data object which is locally aggregated. Such an element can only be used within the scope
where it is aggregated.
This element either consists of further subElements or it is further defined via its swDataDefProps.
There are several use cases within the system of ImplementationDataTypes fur such a local declaration:
• It can represent the elements of an array, defining the element type and array size
• It can represent an element of a struct, defining its type
• It can be the local declaration of a debug element.
Base ARObject, AbstractImplementationDataTypeElement, AtpClassifier , AtpFeature, AtpStructureElement,
Identifiable, MultilanguageReferrable, Referrable
Attribute Type Mult. Kind Note
arrayImplPolicy ArrayImplPolicyEnum 0..1 attr This attribute controls the implementation of the payload
of an array. It shall only be used if the enclosing
ImplementationDataType constitutes an array.
arraySize PositiveInteger 0..1 attr The existence of this attributes (if bigger than 0) defines
the size of an array and declares that this Implementation
DataTypeElement represents the type of each single
array element.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
arraySize ArraySizeHandling 0..1 attr The way how the size of the array is handled in case of a
Handling Enum variable size array.
arraySize ArraySizeSemantics 0..1 attr This attribute controls the meaning of the value of the
Semantics Enum array size.
isOptional Boolean 0..1 attr This attribute represents the ability to declare the
enclosing ImplementationDataTypeElement as optional.
This means that, at runtime, the ImplementationDataType
Element may or may not have a valid value and shall
therefore be ignored.
The underlying runtime software provides means to set
the CppImplementationDataTypeElement as not valid at
the sending end of a communication and determine its
validity at the receiving end.
5

92 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class ImplementationDataTypeElement
subElement ImplementationData * aggr Element of an array, struct, or union in case of a nested
(ordered) TypeElement declaration (i.e. without using "typedefs").
The aggregation of ImplementionDataTypeElement is
subject to variability with the purpose to support the
conditional existence of elements inside a Implementation
DataType representing a structure.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
swDataDef SwDataDefProps 0..1 aggr The properties of this ImplementationDataTypeElement.
Props

Table A.20: ImplementationDataTypeElement

Class InternalBehavior (abstract)


Package M2::AUTOSARTemplates::CommonStructure::InternalBehavior
Note Common base class (abstract) for the internal behavior of both software components and basic software
modules/clusters.
Base ARObject, AtpClassifier , AtpFeature, AtpStructureElement, Identifiable, MultilanguageReferrable,
Referrable
Subclasses BswInternalBehavior, SwcInternalBehavior
Attribute Type Mult. Kind Note
constant ParameterData * aggr Describes a read only memory object containing
Memory Prototype characteristic value(s) implemented by this Internal
Behavior.
The shortName of ParameterDataPrototype has to be
equal to the ”C’ identifier of the described constant.
The characteristic value(s) might be shared between Sw
ComponentPrototypes of the same SwComponentType.
The aggregation of constantMemory is subject to
variability with the purpose to support variability in the
software component or module implementations.
Typically different algorithms in the implementation are
requiring different number of memory objects.
Stereotypes: atpSplitable; atpVariation
Tags:
atp.Splitkey=constantMemory.shortName, constant
Memory.variationPoint.shortLabel
vh.latestBindingTime=preCompileTime
constantValue ConstantSpecification * ref Reference to the ConstantSpecificationMapping to be
Mapping MappingSet applied for the particular InternalBehavior
Stereotypes: atpSplitable
Tags:atp.Splitkey=constantValueMapping
dataType DataTypeMappingSet * ref Reference to the DataTypeMapping to be applied for the
Mapping particular InternalBehavior
Stereotypes: atpSplitable
Tags:atp.Splitkey=dataTypeMapping
5

93 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class InternalBehavior (abstract)
exclusiveArea ExclusiveArea * aggr This specifies an ExclusiveArea for this InternalBehavior.
The exclusiveArea is local to the component resp.
module. The aggregation of ExclusiveAreas is subject to
variability. Note: the number of ExclusiveAreas might vary
due to the conditional existence of RunnableEntities or
BswModuleEntities.
Stereotypes: atpSplitable; atpVariation
Tags:
atp.Splitkey=exclusiveArea.shortName, exclusive
Area.variationPoint.shortLabel
vh.latestBindingTime=preCompileTime
exclusiveArea ExclusiveAreaNesting * aggr This represents the set of ExclusiveAreaNestingOrder
NestingOrder Order owned by the InternalBehavior.
Stereotypes: atpSplitable; atpVariation
Tags:
atp.Splitkey=exclusiveAreaNestingOrder.shortName,
exclusiveAreaNestingOrder.variationPoint.shortLabel
vh.latestBindingTime=preCompileTime
staticMemory VariableDataPrototype * aggr Describes a read and writeable static memory object
representing measurerment variables implemented by
this software component. The term "static" is used in the
meaning of "non-temporary" and does not necessarily
specify a linker encapsulation. This kind of memory is
only supported if supportsMultipleInstantiation is FALSE.
The shortName of the VariableDataPrototype has to be
equal with the ”C’ identifier of the described variable.
The aggregation of staticMemory is subject to variability
with the purpose to support variability in the software
component’s implementations.
Typically different algorithms in the implementation are
requiring different number of memory objects.
Stereotypes: atpSplitable; atpVariation
Tags:
atp.Splitkey=staticMemory.shortName, static
Memory.variationPoint.shortLabel
vh.latestBindingTime=preCompileTime

Table A.21: InternalBehavior

Class PortAPIOption
Package M2::AUTOSARTemplates::SWComponentTemplate::SwcInternalBehavior::PortAPIOptions
Note Options how to generate the signatures of calls for an AtomicSwComponentType in order to
communicate over a PortPrototype (for calls into a RunnableEntity as well as for calls from a Runnable
Entity to the PortPrototype).
Base ARObject
Attribute Type Mult. Kind Note
enableTake Boolean 0..1 attr If set to true, the software-component is able to use the
Address API reference for deriving a pointer to an object.
errorHandling DataTransformation 0..1 attr This specifies whether a RunnableEntity accessing a Port
ErrorHandlingEnum Prototype that is referenced by this PortAPIOption shall
specifically handle transformer errors or not.
5

94 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class PortAPIOption
indirectAPI Boolean 0..1 attr If set to true this attribute specifies an "indirect API" to be
generated for the associated port which means that the
software-component is able to access the actions on a
port via a pointer to an object representing a port. This
allows e.g. iterating over ports in a loop. This option has
no effect for PPortPrototypes of client/server interfaces.
port PortPrototype 0..1 ref The option is valid for generated functions related to
communication over this port
portArgValue PortDefinedArgument * aggr An argument value defined by this port.
(ordered) Value
supported SwcSupportedFeature * aggr This collection specifies which features are supported by
Feature the RunnableEntitys which access a PortPrototype that it
referenced by this PortAPIOption.
transformer DataTransformation 0..1 attr This specifies whether a RunnableEntity accessing a Port
Status StatusForwardingEnum Prototype that is referenced by this PortAPIOption shall
Forwarding be able to forward a status to the transformer chain.

Table A.22: PortAPIOption

Class PortDefinedArgumentValue
Package M2::AUTOSARTemplates::SWComponentTemplate::SwcInternalBehavior::PortAPIOptions
Note A PortDefinedArgumentValue is passed to a RunnableEntity dealing with the ClientServerOperations
provided by a given PortPrototype. Note that this is restricted to PPortPrototypes of a ClientServer
Interface.
Base ARObject
Attribute Type Mult. Kind Note
value ValueSpecification 0..1 aggr Specifies the actual value.
valueType ImplementationData 0..1 tref The implementation type of this argument value. It should
Type not be composite type or a pointer.
Stereotypes: isOfType

Table A.23: PortDefinedArgumentValue

Class SOMEIPTransformationProps
Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note The class SOMEIPTransformationProps specifies SOME/IP specific configuration properties.
Base ARObject, Identifiable, MultilanguageReferrable, Referrable, TransformationProps
Attribute Type Mult. Kind Note
alignment PositiveInteger 0..1 attr Defines the padding for alignment purposes that will be
added by the SOME/IP transformer after the serialized
data of the variable data length data element. The
alignment shall be specified in Bits.
sizeOfArray PositiveInteger 0..1 attr This attribute describes the size of the length field (in
LengthField Bytes) that will be put in front of the referenced Array in
the SOME/IP message.
sizeOfString PositiveInteger 0..1 attr This attribute describes the size of the length field (in
LengthField Bytes) that will be put in front of the referenced String in
the SOME/IP message.
sizeOfStruct PositiveInteger 0..1 attr This attribute describes the size of the length field (in
LengthField Bytes) that will be put in front of a Structure in the SOME/
IP message.
5

95 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class SOMEIPTransformationProps
sizeOfUnion PositiveInteger 0..1 attr This attribute describes the size of the length field (in
LengthField Bytes) that will be put in front of a Union in the SOME/IP
message.

Table A.24: SOMEIPTransformationProps

Enumeration SOMEIPTransformerSessionHandlingEnum
Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note Enables or disable session handling for SOME/IP transformer
Literal Description
sessionHandling The SOME/IP Transformer shall use session handling
Active
Tags:atp.EnumerationLiteralIndex=0
sessionHandling The SOME/IP Transformer doesn’t use session handling
Inactive
Tags:atp.EnumerationLiteralIndex=1

Table A.25: SOMEIPTransformerSessionHandlingEnum

Class SenderReceiverInterface
Package M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
Note A sender/receiver interface declares a number of data elements to be sent and received.
Tags:atp.recommendedPackage=PortInterfaces
Base ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType, CollectableElement,
DataInterface, Identifiable, MultilanguageReferrable, PackageableElement, PortInterface, Referrable
Attribute Type Mult. Kind Note
dataElement VariableDataPrototype * aggr The data elements of this SenderReceiverInterface.
invalidation InvalidationPolicy * aggr InvalidationPolicy for a particular dataElement
Policy
metaDataItem MetaDataItemSet * aggr This aggregation defines fixed sets of meta-data items
Set associated with dataElements of the enclosing Sender
ReceiverInterface
Table A.26: SenderReceiverInterface

Class SenderReceiverToSignalMapping
Package M2::AUTOSARTemplates::SystemTemplate::DataMapping
Note Mapping of a sender receiver communication data element to a signal.
Base ARObject, DataMapping
Attribute Type Mult. Kind Note
dataElement VariableDataPrototype 1 iref Reference to the data element.
InstanceRef implemented by:VariableDataPrototypeIn
SystemInstanceRef
senderToSignal TextTableMapping 0..1 aggr This mapping allows for the text-table translation between
TextTable the sending DataPrototype that is defined in the Port
Mapping Prototype and the physicalProps defined for the System
Signal.
5

96 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class SenderReceiverToSignalMapping
signalTo TextTableMapping 0..1 aggr This mapping allows for the text-table translation between
ReceiverText the physicalProps defined for the SystemSignal and a
TableMapping receiving DataPrototype that is defined in the Port
Prototype.
systemSignal SystemSignal 1 ref Reference to the system signal used to carry the data
element.
Table A.27: SenderReceiverToSignalMapping

Class SwBaseType
Package M2::MSR::AsamHdo::BaseTypes
Note This meta-class represents a base type used within ECU software.
Tags:atp.recommendedPackage=BaseTypes
Base ARElement, ARObject, AtpBlueprint, AtpBlueprintable, BaseType, CollectableElement, Identifiable,
MultilanguageReferrable, PackageableElement, Referrable
Attribute Type Mult. Kind Note
– – – – –
Table A.28: SwBaseType

Class <<atpVariation>> SwDataDefProps


Package M2::MSR::DataDictionary::DataDefProperties
Note This class is a collection of properties relevant for data objects under various aspects. One could
consider this class as a "pattern of inheritance by aggregation". The properties can be applied to all
objects of all classes in which SwDataDefProps is aggregated.
Note that not all of the attributes or associated elements are useful all of the time. Hence, the process
definition (e.g. expressed with an OCL or a Document Control Instance MSR-DCI) has the task of
implementing limitations.
SwDataDefProps covers various aspects:
• Structure of the data element for calibration use cases: is it a single value, a curve, or a map, but
also the recordLayouts which specify how such elements are mapped/converted to the Data
Types in the programming language (or in AUTOSAR). This is mainly expressed by properties
like swRecordLayout and swCalprmAxisSet
• Implementation aspects, mainly expressed by swImplPolicy, swVariableAccessImplPolicy, sw
AddrMethod, swPointerTagetProps, baseType, implementationDataType and additionalNative
TypeQualifier
• Access policy for the MCD system, mainly expressed by swCalibrationAccess
• Semantics of the data element, mainly expressed by compuMethod and/or unit, dataConstr,
invalidValue
• Code generation policy provided by swRecordLayout
Tags:vh.latestBindingTime=codeGenerationTime
Base ARObject
Attribute Type Mult. Kind Note
5

97 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class <<atpVariation>> SwDataDefProps
additionalNative NativeDeclarationString 0..1 attr This attribute is used to declare native qualifiers of the
TypeQualifier programming language which can neither be deduced
from the baseType (e.g. because the data object
describes a pointer) nor from other more abstract
attributes. Examples are qualifiers like "volatile", "strict" or
"enum" of the C-language. All such declarations have to
be put into one string.
Tags:xml.sequenceOffset=235
annotation Annotation * aggr This aggregation allows to add annotations (yellow pads
...) related to the current data object.
Tags:
xml.roleElement=true
xml.roleWrapperElement=true
xml.sequenceOffset=20
xml.typeElement=false
xml.typeWrapperElement=false
baseType SwBaseType 0..1 ref Base type associated with the containing data object.
Tags:xml.sequenceOffset=50
compuMethod CompuMethod 0..1 ref Computation method associated with the semantics of
this data object.
Tags:xml.sequenceOffset=180
dataConstr DataConstr 0..1 ref Data constraint for this data object.
Tags:xml.sequenceOffset=190
displayFormat DisplayFormatString 0..1 attr This property describes how a number is to be rendered
e.g. in documents or in a measurement and calibration
system.
Tags:xml.sequenceOffset=210
display DisplayPresentation 0..1 attr This attribute controls the presentation of the related data
Presentation Enum for measurement and calibration tools.
implementation AbstractImplementation 0..1 ref This association denotes the ImplementationDataType of
DataType DataType a data declaration via its aggregated SwDataDefProps. It
is used whenever a data declaration is not directly
referring to a base type. Especially
• redefinition of an ImplementationDataType via a
"typedef" to another ImplementationDatatype
• the target type of a pointer (see SwPointerTarget
Props), if it does not refer to a base type directly
• the data type of an array or record element within
an ImplementationDataType, if it does not refer to
a base type directly
• the data type of an SwServiceArg, if it does not
refer to a base type directly
Tags:xml.sequenceOffset=215
invalidValue ValueSpecification 0..1 aggr Optional value to express invalidity of the actual data
element.
Tags:xml.sequenceOffset=255
stepSize Float 0..1 attr This attribute can be used to define a value which is
added to or subtracted from the value of a DataPrototype
when using up/down keys while calibrating.
5

98 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class <<atpVariation>> SwDataDefProps
swAddrMethod SwAddrMethod 0..1 ref Addressing method related to this data object. Via an
association to the same SwAddrMethod it can be
specified that several DataPrototypes shall be located in
the same memory without already specifying the memory
section itself.
Tags:xml.sequenceOffset=30
swAlignment AlignmentType 0..1 attr The attribute describes the intended typical alignment of
the DataPrototype. If the attribute is not defined the
alignment is determined by the swBaseType size and the
memoryAllocationKeywordPolicy of the referenced Sw
AddrMethod.
Tags:xml.sequenceOffset=33
swBit SwBitRepresentation 0..1 aggr Description of the binary representation in case of a bit
Representation variable.
Tags:xml.sequenceOffset=60
swCalibration SwCalibrationAccess 0..1 attr Specifies the read or write access by MCD tools for this
Access Enum data object.
Tags:xml.sequenceOffset=70
swCalprmAxis SwCalprmAxisSet 0..1 aggr This specifies the properties of the axes in case of a
Set curve or map etc. This is mainly applicable to calibration
parameters.
Tags:xml.sequenceOffset=90
swComparison SwVariableRefProxy * aggr Variables used for comparison in an MCD process.
Variable
Tags:
xml.sequenceOffset=170
xml.typeElement=false
swData SwDataDependency 0..1 aggr Describes how the value of the data object has to be
Dependency calculated from the value of another data object (by the
MCD system).
Tags:xml.sequenceOffset=200
swHostVariable SwVariableRefProxy 0..1 aggr Contains a reference to a variable which serves as a
host-variable for a bit variable. Only applicable to bit
objects.
Tags:
xml.sequenceOffset=220
xml.typeElement=false
swImplPolicy SwImplPolicyEnum 0..1 attr Implementation policy for this data object.
Tags:xml.sequenceOffset=230
swIntended Numerical 0..1 attr The purpose of this element is to describe the requested
Resolution quantization of data objects early on in the design
process.
The resolution ultimately occurs via the conversion
formula present (compuMethod), which specifies the
transition from the physical world to the standardized
world (and vice-versa) (here, "the slope per bit" is present
implicitly in the conversion formula).
In the case of a development phase without a fixed
conversion formula, a pre-specification can occur through
swIntendedResolution.
The resolution is specified in the physical domain
according to the property "unit".
Tags:xml.sequenceOffset=240
5

99 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class <<atpVariation>> SwDataDefProps
swInterpolation Identifier 0..1 attr This is a keyword identifying the mathematical method to
Method be applied for interpolation. The keyword needs to be
related to the interpolation routine which needs to be
invoked.
Tags:xml.sequenceOffset=250
swIsVirtual Boolean 0..1 attr This element distinguishes virtual objects. Virtual objects
do not appear in the memory, their derivation is much
more dependent on other objects and hence they shall
have a swDataDependency .
Tags:xml.sequenceOffset=260
swPointerTarget SwPointerTargetProps 0..1 aggr Specifies that the containing data object is a pointer to
Props another data object.
Tags:xml.sequenceOffset=280
swRecord SwRecordLayout 0..1 ref Record layout for this data object.
Layout
Tags:xml.sequenceOffset=290
swRefresh MultidimensionalTime 0..1 aggr This element specifies the frequency in which the object
Timing involved shall be or is called or calculated. This timing
can be collected from the task in which write access
processes to the variable run. But this cannot be done by
the MCD system.
So this attribute can be used in an early phase to express
the desired refresh timing and later on to specify the real
refresh timing.
Tags:xml.sequenceOffset=300
swTextProps SwTextProps 0..1 aggr the specific properties if the data object is a text object.
Tags:xml.sequenceOffset=120
swValueBlock Numerical 0..1 attr This represents the size of a Value Block
Size
Stereotypes: atpVariation
Tags:
vh.latestBindingTime=preCompileTime
xml.sequenceOffset=80
swValueBlock Numerical * attr This attribute is used to specify the dimensions of a value
SizeMult block (VAL_BLK) for the case that that value block has
(ordered) more than one dimension.
The dimensions given in this attribute are ordered such
that the first entry represents the first dimension, the
second entry represents the second dimension, and so
on.
For one-dimensional value blocks the attribute swValue
BlockSize shall be used and this attribute shall not exist.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=preCompileTime
unit Unit 0..1 ref Physical unit associated with the semantics of this data
object. This attribute applies if no compuMethod is
specified. If both units (this as well as via compuMethod)
are specified the units shall be compatible.
Tags:xml.sequenceOffset=350
valueAxisData ApplicationPrimitive 0..1 ref The referenced ApplicationPrimitiveDataType represents
Type DataType the primitive data type of the value axis within a
compound primitive (e.g. curve, map). It supersedes
CompuMethod, Unit, and BaseType.
Tags:xml.sequenceOffset=355

Table A.29: SwDataDefProps

100 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Class SwTextProps
Package M2::MSR::DataDictionary::DataDefProperties
Note This meta-class expresses particular properties applicable to strings in variables or calibration
parameters.
Base ARObject
Attribute Type Mult. Kind Note
arraySize ArraySizeSemantics 0..1 attr This attribute controls the semantics of the arraysize for
Semantics Enum the array representing the string in an Implementation
DataType.
It is there to support a safe conversion between
ApplicationDatatype and ImplementationDatatype, even
for variable length strings as required e.g. for Support of
SAE J1939.
baseType SwBaseType 0..1 ref This is the base type of one character in the string. In
particular this baseType denotes the intended encoding of
the characters in the string on level of ApplicationData
Type.
Tags:xml.sequenceOffset=30
swFillCharacter Integer 0..1 attr Filler character for text parameter to pad up to the
maximum length swMaxTextSize.
The value will be interpreted according to the encoding
specified in the associated base type of the data object,
e.g. 0x30 (hex) represents the ASCII character zero as
filler character and 0 (dec) represents an end of string as
filler character.
The usage of the fill character depends on the arraySize
Semantics.
Tags:xml.sequenceOffset=40
swMaxTextSize Integer 0..1 attr Specifies the maximum text size in characters. Note the
size in bytes depends on the encoding in the
corresponding baseType.
Stereotypes: atpVariation
Tags:
vh.latestBindingTime=preCompileTime
xml.sequenceOffset=20

Table A.30: SwTextProps

Class SystemSignal
Package M2::AUTOSARTemplates::SystemTemplate::Fibex::FibexCore::CoreCommunication
Note The system signal represents the communication system’s view of data exchanged between SW
components which reside on different ECUs. The system signals allow to represent this communication
in a flattened structure, with exactly one system signal defined for each data element prototype sent and
received by connected SW component instances.
Tags:atp.recommendedPackage=SystemSignals
Base ARElement, ARObject, CollectableElement, Identifiable, MultilanguageReferrable, Packageable
Element, Referrable
Attribute Type Mult. Kind Note
dynamicLength Boolean 1 attr The length of dynamic length signals is variable in
run-time. Only a maximum length of such a signal is
specified in the configuration (attribute length in ISignal
element).
5

101 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

4
Class SystemSignal
physicalProps SwDataDefProps 0..1 aggr Specification of the physical representation.

Table A.31: SystemSignal

Class <<atpVariation>> TransformationISignalProps (abstract)


Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note TransformationISignalProps holds all the attributes for the different TransformationTechnologies that are
ISignal specific.
Tags:vh.latestBindingTime=postBuild
Base ARObject, Describable
Subclasses EndToEndTransformationISignalProps, SOMEIPTransformationISignalProps, UserDefinedTransformation
ISignalProps
Attribute Type Mult. Kind Note
csErrorReaction CSTransformerError 0..1 attr Defines whether the transformer chain of client/server
ReactionEnum communication coordinates an autonomous error reaction
together with the RTE or whether any error reaction is the
responsibility of the application.
dataPrototype DataPrototype * aggr Fine granular modeling of TransfromationProps on the
Transformation TransformationProps level of DataPrototypes.
Props
transformer Transformation 1 ref Reference to the TransformationTechnology description
Technology that contains transformer specific and ISignal
independent configuration properties.

Table A.32: TransformationISignalProps

Class TransformationTechnology
Package M2::AUTOSARTemplates::SystemTemplate::Transformer
Note A TransformationTechnology is a transformer inside a transformer chain.
Tags:xml.namePlural=TRANSFORMATION-TECHNOLOGIES
Base ARObject, Identifiable, MultilanguageReferrable, Referrable
Attribute Type Mult. Kind Note
bufferProperties BufferProperties 1 aggr Aggregation of the mandatory BufferProperties.
hasInternal Boolean 0..1 attr This attribute defines whether the Transformer has an
State internal state or not.
needsOriginal Boolean 0..1 attr Specifies whether this transformer gets access to the
Data SWC’s original data.
protocol String 1 attr Specifies the protocol that is implemented by this
transformer.
transformation Transformation 0..1 aggr A transformer can be configured with transformer specific
Description Description parameters which are represented by the Transformer
Description.
Stereotypes: atpVariation
Tags:vh.latestBindingTime=postBuild
transformer TransformerClassEnum 1 attr Specifies to which transformer class this transformer
Class belongs.
version String 1 attr Version of the implemented protocol.

Table A.33: TransformationTechnology

102 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Class TriggerToSignalMapping
Package M2::AUTOSARTemplates::SystemTemplate::DataMapping
Note This meta-class represents the ability to map a trigger to a SystemSignal of size 0. The Trigger does not
transport any other information than its existence, therefore the limitation in terms of signal length.
Base ARObject, DataMapping
Attribute Type Mult. Kind Note
systemSignal SystemSignal 1 ref This is the SystemSignal taken to transport the Trigger
over the network.
Tags:xml.sequenceOffset=20
trigger Trigger 1 iref This represents the Trigger that shall be used to trigger
RunnableEntities deployed to a remote ECU.
Tags:xml.sequenceOffset=10
InstanceRef implemented by:TriggerInSystemInstance
Ref
Table A.34: TriggerToSignalMapping

B Features of SOME/IP not supported by AUTOSAR


SOME/IP transformer
The following features of SOME/IP are currently not supported by the SOME/IP trans-
former:
• Exceptions and exception-specific error data structures
• Tunneling of SOME/IP messages through CAN and Flexray leads to SOME/IP
messages without parts of the header inserted by [4, SWS Socket Adaptor]
• Queued Fire&Forget methods without parameters are not supported by
AUTOSAR at all. (Unqueued Fire&Forget methods without parameters and
queued Fire&Forget methods with parameters are supported)
• The SOME/IP transformer doesn’t check whether variable size arrays contain a
minimal number of elements (reason: this is supported by SOME/IP protocol but
not by AUTOSAR)
• Optional method arguments: AUTOSAR Classic platform does not support the
existence of optional method arguments.

C Examples
This appendix contains examples which are suitable to help understanding details of
the SOME/IP Transformer.

103 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

C.1 Serialization of a Client/Server Operation


As the serialization of inter-ECU Client/Server communication is the most complex
scenario, this example will show the resulting APIs which exist in RTE and Transformer
both on the Client and the Server as well an overview of the resulting serialized data
on the network.
The example deals with two SWCs which are distributed to two ECUs which are con-
nected over some kind of network. The SOME/IP Transformer shall be used to se-
rialize the inter-ECU communication. The client calls a ClientServerOperation
which is provided by the server. For the server, there are two PortDefinedAr-
gumentValues defined which are applied to the runnable which implements the
ClientServerOperation. These PortDefinedArgumentValues are only visible
within the InternalBehavior of the server. They are not visible to the outside world
(ClientServerInterface) - neither to the client nor in the data on the network.
The following tables define the example ClientServerInterface used here.

Name SomeCSInterface
Comment A ClientServerInterface which contains anything needed to show
serialization of ClientServerOperations by SOME/IP Transformer.
IsService false
Variation –
Possible Errors 0 E_OK
1 E_DATA_INCONSISTENT
2 E_UNKNOWN_ERROR

Table C.1: ClientServerInterface SomeCSInterface

Operations

Name SomeCSOperation
Comments The ClientServerOperation which is used to demonstrate how the SOME/IP
serialization for Client/Sever communication works
Variation –
Parameters inputParam1

Comment A parameter which is handed over from the


Client to the Server
Type uint8
Variation –
Direction IN
inputParam2
Comment A parameter which is handed over from the
Client to the Server
Type uint16
Variation –
Direction IN
biDirectionalParam

104 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

Comment A parameter which is handed over from the


Client to the Server, modified by the Server
and handed back to the Client
Type someStruct
Variation –
Direction INOUT
outputParam1
Comment A parameter which is handed over from the
Server to the Client
Type uint16
Variation –
Direction OUT
outputParam2
Comment A parameter which is handed over from the
Server to the Client
Type uint32
Variation –
Direction OUT
Possible Errors E_OK Operation successful
E_DATA_ Data are inconsistent
INCONSISTENT
E_UNKNOWN_ERROR An unknown error occured

Table C.2: Operation SomeCSOperation

C.1.1 Client

On the client side, the following RTE-API is generated according to [SWS_Rte_01102]


based on the ClientServerInterface which is specified above and the attribute
errorHandling of PortAPIOption:
Std_ReturnType Rte_Call_ClientPort_SomeCSOperation
(uint8 inputParam1,
uint16 inputParam2,
someStruct *biDirectionalParam,
uint16 *outputParam1,
uint32 *outputParam2,
Rte_TransformerError *transformerError)

For this signature the attribute errorHandling of PortAPIOption is set to trans-


formerErrorHandling. If it would be set to noTransformerErrorHandling, the
parameter Rte_TransformerError *transformerError would not be included
in the signature above.
The signature above reflects an synchronous server call. For an asynchronous server
call all OUT parameters would be missing for Rte_Call but an Rte_Result would
be necessary instead. The examples for signatures and parameters shown here can
be transferred analogously to Rte_Result.
This is the API used in the runnable of the client to call the remote server operation.

105 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

The RTE executes for the serialization of the request the SOME/IP Transformer with
the following API which is specified in [SWS_SomeIpXf_00141]:
uint8 SomeIpXf_CSOpSerializer
(const Rte_Cs_TransactionHandleType *TransactionHandle,
uint8 *buffer,
uint16 *bufferLength,
uint8 inputParam1,
uint16 inputParam2,
someStruct biDirectionalParam)

This function will serialize the TransactionHandle and all IN/INOUT parameters for
the request into the following format:

input
SOME/IP Header Param1
inputParam2 biDirectionalParam

Figure C.1: Example for serialized data of the Client/Server Request

The SOME/IP Header contains the TransactionHandle (see [SWS_SomeIpXf_00025]


and [SWS_SomeIpXf_00026]).
To deserialize the response that is received by the client after execu-
tion of the ClientServerOperation on the server the API (according to
[SWS_SomeIpXf_00145]) is used:
uint8 SomeIpXf_Inv_CSOpSerializer
(Rte_Cs_TransactionHandleType *TransactionHandle,
const uint8 *buffer,
uint16 bufferLength,
Std_ReturnType *returnValue,
someStruct *biDirectionalParam,
uint16 *outputParam1,
uint32 *outputParam2)

C.1.2 Server

On the server side the ClientServerOperation is implemented by a runnable with


the following signature which now contains the PortDefinedArgumentValues (see
[SWS_Rte_01166]):
Std_ReturnType SomeCSOperation
(uint8 portDefArg1,
uint8 portDefArg2,
uint8 inputParam1,
uint16 inputParam2,
someStruct *biDirectionalParam,
uint16 *outputParam1,
uint32 *outputParam2)

106 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer


Specification of SOME/IP Transformer
AUTOSAR CP R21-11

For the deserialization of the received request, the SOME/IP Transformer on the server
side, provides according to [SWS_SomeIpXf_00141] this C-API:
uint8 SomeIpXf_Inv_CSOpSerializer
(Rte_Cs_TransactionHandleType *TransactionHandle,
const uint8 *buffer,
uint16 bufferLength,
uint8 *inputParam1,
uint16 *inputParam2,
someStruct *biDirectionalParam)

The function for serialization of the response is specified by [SWS_SomeIpXf_00145]:


uint8 SomeIpXf_CSOpSerializer
(const Rte_Cs_TransactionHandleType *TransactionHandle,
uint8 *buffer,
uint16 *bufferLength,
Std_ReturnType returnValue,
someStruct biDirectionalParam,
uint16 outputParam1,
uint32 outputParam2)

This function will serialize the TransactionHandle, the returnValue and all IN-
OUT/OUT parameters for the response into the following format:

SOME/IP Header biDirectionalParam outputParam1 outputParam2

Figure C.2: Example for serialized data of the Client/Server Response

The SOME/IP Header contains the TransactionHandle and returnValue (see


[SWS_SomeIpXf_00025], [SWS_SomeIpXf_00026] and [SWS_SomeIpXf_00115]).

107 of 107 Document ID 660: AUTOSAR_SWS_SOMEIPTransformer

You might also like