DEENESPTFRRUARHIKOZHNL

SOME/IP Transformer (SomeIpXf)

ModulSomeIpXf (SOME/IP Transformer)
BSW-Modul-ID174
Standard-Header#include "SomeIpXf.h"
SWS-SpezifikationAUTOSAR_CP_SWS_SOMEIPTransformer.pdf, AUTOSAR_SWS_SOMEIPTransformer.pdf
Umfang197 Records · 6 Snippets
ClusterKommunikationsdienste (COM)

SOME/IP Transformer (SomeIpXf)

AUTOSAR Classic Communication Services-Modul SOME/IP Transformer (SomeIpXf, Spezifikation: AUTOSAR_CP_SWS_SOMEIPTransformer.pdf, AUTOSAR_SWS_SOMEIPTransformer.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

دالة SomeIpXf_<transformerId> [SWS_SomeIpXf_00138] 📄 PDF

uint8 SomeIpXf_<transformerId>(uint8* buffer, uint32* bufferLength, <paramtype> dataElement);

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.

دالة SomeIpXf_<transformerId> [SWS_SomeIpXf_00141] 📄 PDF

uint8 SomeIpXf_<transformerId>(const Rte_Cs_TransactionHandleType* TransactionHandle, uint8* buffer, uint32* bufferLength, [ Std_ReturnType returnValue ], <paramtype> data_1, ... <paramtype> data_n);

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.

دالة SomeIpXf_Inv_<transformerId> [SWS_SomeIpXf_00144] 📄 PDF

uint8 SomeIpXf_Inv_<transformerId>(const uint8* buffer, uint32 bufferLength, <type>* dataElement);

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.

دالة SomeIpXf_Inv_<transformerId> [SWS_SomeIpXf_00145] 📄 PDF

uint8 SomeIpXf_Inv_<transformerId>(Rte_Cs_TransactionHandleType* TransactionHandle, const uint8* buffer, uint32 bufferLength, [ Std_ReturnType* returnValue ], [ <paramtype> data ]);

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.

دالة SomeIpXf_Init [SWS_SomeIpXf_00181] 📄 PDF

void SomeIpXf_Init(const SomeIpXf_ConfigType* config);

This service initializes the transformer for the further processing.

دالة SomeIpXf_<transformerId> [SWS_SomeIpXf_00206] 📄 PDF

uint8 SomeIpXf_<transformerId>(uint8* buffer, uint32* bufferLength);

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.

دالة SomeIpXf_Inv_<transformerId> [SWS_SomeIpXf_00209] 📄 PDF

uint8 SomeIpXf_Inv_<transformerId>(const uint8* buffer, uint32 bufferLength);

This function deserializes an external trigger event using the deserialization of SOME/IP.

دالة SomeIpXf_ExtractProtocolHeaderFields [SWS_SomeIpXf_91001] 📄 PDF

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

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

نوع SomeIpXf_ConfigType [SWS_SomeIpXf_00183] 📄 PDF

This is the type of the data structure containing the initialization data for the transformer.

requirement SWS_SomeIPxf_00184 [SWS_SomeIPxf_00184] 📄 PDF

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

requirement SWS_SomeIpXf_00007 [SWS_SomeIpXf_00007] 📄 PDF

Service-Instance-IDs shall be of type 16 bit length un- signed integer (uint16).

requirement SWS_SomeIpXf_00009 [SWS_SomeIpXf_00009] 📄 PDF

Different service instances within the same vehicle shall have different Service-Instance-IDs.

requirement SWS_SomeIpXf_00010 [SWS_SomeIpXf_00010] 📄 PDF

Methods and events shall be identified inside a service us- ing a 16bit Method-ID, which is called Event-ID for events and notifications.

requirement SWS_SomeIpXf_00011 [SWS_SomeIpXf_00011] 📄 PDF

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

requirement SWS_SomeIpXf_00013 [SWS_SomeIpXf_00013] 📄 PDF

All headers shall be encoded in network byte order Big Endian (MostSignificantByteFirst) [RFC 791].

requirement SWS_SomeIpXf_00015 [SWS_SomeIpXf_00015] 📄 PDF

The SOME/IP transformer shall implement all fields of the header except Message ID and Length.

requirement SWS_SomeIpXf_00016 [SWS_SomeIpXf_00016] 📄 PDF

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

requirement SWS_SomeIpXf_00017 [SWS_SomeIpXf_00017] 📄 PDF

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

requirement SWS_SomeIpXf_00024 [SWS_SomeIpXf_00024] 📄 PDF

The Request ID shall be constructed of the Client ID and Session ID as shown in Table 7.5.

requirement SWS_SomeIpXf_00025 [SWS_SomeIpXf_00025] 📄 PDF

The clientId inside the Rte_Cs_TransactionHandleType handed over from RTE shall be used for the value of the Client ID.

requirement SWS_SomeIpXf_00026 [SWS_SomeIpXf_00026] 📄 PDF

The sequenceCounter inside the Rte_Cs_TransactionHandleType handed over from RTE shall be used for the value of the Session ID.

requirement SWS_SomeIpXf_00033 [SWS_SomeIpXf_00033] 📄 PDF

Messages of Type REQUEST, REQUEST_NO_RETURN, and Notification have to set the Return Code to 0x00 (E_OK).

requirement SWS_SomeIpXf_00034 [SWS_SomeIpXf_00034] 📄 PDF

The serialization shall be based on the Sender- ReceiverInterface or ClientServerInterface of the data.

requirement SWS_SomeIpXf_00036 [SWS_SomeIpXf_00036] 📄 PDF

The SwBaseType s 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.

requirement SWS_SomeIpXf_00053 [SWS_SomeIpXf_00053] 📄 PDF

Strings 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".

requirement SWS_SomeIpXf_00054 [SWS_SomeIpXf_00054] 📄 PDF

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

requirement SWS_SomeIpXf_00055 [SWS_SomeIpXf_00055] 📄 PDF

UTF-16LE and UTF-16BE strings shall be zero terminated with a "\textbackslash0"-character . This means they shall end with (at least) two 0x00 Bytes.

requirement SWS_SomeIpXf_00057 [SWS_SomeIpXf_00057] 📄 PDF

For UTF-16LE and UTF-16BE strings having an odd length the last byte shall be silently removed by the receiving SOME/IP transformer.

requirement SWS_SomeIpXf_00058 [SWS_SomeIpXf_00058] 📄 PDF

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

requirement SWS_SomeIpXf_00059 [SWS_SomeIpXf_00059] 📄 PDF

The receiving SOME/IP transformer implementation shall check the BOM and handle a missing BOM or a malformed BOM as an error.

requirement SWS_SomeIpXf_00070 [SWS_SomeIpXf_00070] 📄 PDF

A one-dimensional array with fixed length shall be serial- ized by concatenating the array elements in order.

requirement SWS_SomeIpXf_00072 [SWS_SomeIpXf_00072] 📄 PDF

The serialization of multidimensional arrays shall happen in row-major order(in-memory layout of multidimensional arrays in the C programming language)

requirement SWS_SomeIpXf_00076 [SWS_SomeIpXf_00076] 📄 PDF

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

requirement SWS_SomeIpXf_00099 [SWS_SomeIpXf_00099] 📄 PDF

The 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].

requirement SWS_SomeIpXf_00106 [SWS_SomeIpXf_00106] 📄 PDF

For the SOME/IP request message, the SOME/IP trans- former on the client-ECU has to do the following for payload and header: • 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

requirement SWS_SomeIpXf_00107 [SWS_SomeIpXf_00107] 📄 PDF

The 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 ) • 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 .

requirement SWS_SomeIpXf_00108 [SWS_SomeIpXf_00108] 📄 PDF

The 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 – REQUEST_NO_RETURN ( 0x01 ) shall be used in the header if attribute mes- sageType is set to requestNoReturn • Set the Return Code to 0x00

requirement SWS_SomeIpXf_00115 [SWS_SomeIpXf_00115] 📄 PDF

The Return Codes of Table 7.11 are currently defined and shall be implemented as described:

requirement SWS_SomeIpXf_00120 [SWS_SomeIpXf_00120] 📄 PDF

To construct the payload of a request message all argu- ment s of the ClientServerOperation which have direction IN or INOUT shall be serialized according to the order of the ArgumentDataPrototype s within the ClientServerOperation .

requirement SWS_SomeIpXf_00121 [SWS_SomeIpXf_00121] 📄 PDF

To construct the payload of a response message all argu- ment s of the ClientServerOperation which have direction INOUT or OUT shall be serialized in the following order: The ArgumentDataPrototype s with a direction of INOUT or OUT shall be serialized according to the order of the ArgumentDataPrototype s within the ClientServer- Operation .

requirement SWS_SomeIpXf_00134 [SWS_SomeIpXf_00134] 📄 PDF

Besides "otherserv" other names are supported by the con- figuration option. Table 7.16 gives an overview of the reserved names

requirement SWS_SomeIpXf_00136 [SWS_SomeIpXf_00136] 📄 PDF

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

requirement SWS_SomeIpXf_00139 [SWS_SomeIpXf_00139] 📄 PDF

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

requirement SWS_SomeIpXf_00140 [SWS_SomeIpXf_00140] 📄 PDF

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

requirement SWS_SomeIpXf_00142 [SWS_SomeIpXf_00142] 📄 PDF

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

requirement SWS_SomeIpXf_00143 [SWS_SomeIpXf_00143] 📄 PDF

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

requirement SWS_SomeIpXf_00146 [SWS_SomeIpXf_00146] 📄 PDF

The function SomeIpXf_Inv_<transformerId> speci- fied in [SWS_SomeIpXf_00144] 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 SenderReceiverToSignalMapping .

requirement SWS_SomeIpXf_00147 [SWS_SomeIpXf_00147] 📄 PDF

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

requirement SWS_SomeIpXf_00148 [SWS_SomeIpXf_00148] 📄 PDF

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 .

requirement SWS_SomeIpXf_00149 [SWS_SomeIpXf_00149] 📄 PDF

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

requirement SWS_SomeIpXf_00150 [SWS_SomeIpXf_00150] 📄 PDF

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

requirement SWS_SomeIpXf_00151 [SWS_SomeIpXf_00151] 📄 PDF

The 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

requirement SWS_SomeIpXf_00152 [SWS_SomeIpXf_00152] 📄 PDF

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

requirement SWS_SomeIpXf_00160 [SWS_SomeIpXf_00160] 📄 PDF

The Interface Version field shall contain the Version of the Service Interface.

requirement SWS_SomeIpXf_00164 [SWS_SomeIpXf_00164] 📄 PDF

The Return Code field shall be used to signal whether a request has been successfully processed.

requirement SWS_SomeIpXf_00168 [SWS_SomeIpXf_00168] 📄 PDF

The allowed Return Codes for specific message types are specified in Table 7.7.

requirement SWS_SomeIpXf_00169 [SWS_SomeIpXf_00169] 📄 PDF

To allow migration the deserialization shall ignore parame- ters attached to the end of previously known parameter list.

requirement SWS_SomeIpXf_00170 [SWS_SomeIpXf_00170] 📄 PDF

In case of Client/Server communication the Return Code shall transport the ApplicationError s of the executed ClientServerOperation if no SOME/IP error occurred.

requirement SWS_SomeIpXf_00172 [SWS_SomeIpXf_00172] 📄 PDF

The byte order of the parameters inside the payload shall be defined by byteOrder of SOMEIPTransformationDescription .

requirement SWS_SomeIpXf_00176 [SWS_SomeIpXf_00176] 📄 PDF

The payload of a message for Sender/Receiver communi- cation shall consists of the serialized data element that is transported.

requirement SWS_SomeIpXf_00185 [SWS_SomeIpXf_00185] 📄 PDF

The apiServicePrefix of the SOME/IP transformer's EcuC shall be set to SomeIpXf .

requirement SWS_SomeIpXf_00200 [SWS_SomeIpXf_00200] 📄 PDF

If 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].

requirement SWS_SomeIpXf_00201 [SWS_SomeIpXf_00201] 📄 PDF

The 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 � 0 x 80 ) • Place the adaptedReturnValue into the Return Code field.

requirement SWS_SomeIpXf_00202 [SWS_SomeIpXf_00202] 📄 PDF

A 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]).

requirement SWS_SomeIpXf_00203 [SWS_SomeIpXf_00203] 📄 PDF

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

requirement SWS_SomeIpXf_00204 [SWS_SomeIpXf_00204] 📄 PDF

The 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

requirement SWS_SomeIpXf_00205 [SWS_SomeIpXf_00205] 📄 PDF

The payload of a message for external trigger event com- munication shall be empty.

requirement SWS_SomeIpXf_00207 [SWS_SomeIpXf_00207] 📄 PDF

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

requirement SWS_SomeIpXf_00208 [SWS_SomeIpXf_00208] 📄 PDF

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

requirement SWS_SomeIpXf_00210 [SWS_SomeIpXf_00210] 📄 PDF

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

requirement SWS_SomeIpXf_00211 [SWS_SomeIpXf_00211] 📄 PDF

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

requirement SWS_SomeIpXf_00212 [SWS_SomeIpXf_00212] 📄 PDF

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

requirement SWS_SomeIpXf_00214 [SWS_SomeIpXf_00214] 📄 PDF

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

requirement SWS_SomeIpXf_00215 [SWS_SomeIpXf_00215] 📄 PDF

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

requirement SWS_SomeIpXf_00216 [SWS_SomeIpXf_00216] 📄 PDF

If attribute sizeOfStructLengthFields of SOMEIP- TransformationISignalProps is set to a value greater 0, a length field shall be inserted in front of every serialized struct.

requirement SWS_SomeIpXf_00217 [SWS_SomeIpXf_00217] 📄 PDF

The 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

requirement SWS_SomeIpXf_00218 [SWS_SomeIpXf_00218] 📄 PDF

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

requirement SWS_SomeIpXf_00219 [SWS_SomeIpXf_00219] 📄 PDF

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

requirement SWS_SomeIpXf_00220 [SWS_SomeIpXf_00220] 📄 PDF

If attribute sizeOfArrayLengthFields of SOMEIP- TransformationISignalProps is set to a value greater 0, a length field shall be inserted in front of every serialized array.

requirement SWS_SomeIpXf_00221 [SWS_SomeIpXf_00221] 📄 PDF

The 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

requirement SWS_SomeIpXf_00222 [SWS_SomeIpXf_00222] 📄 PDF

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

requirement SWS_SomeIpXf_00223 [SWS_SomeIpXf_00223] 📄 PDF

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

requirement SWS_SomeIpXf_00224 [SWS_SomeIpXf_00224] 📄 PDF

If attribute sizeOfUnionLengthFields of SOMEIP- TransformationISignalProps is set to a value greater 0, a length field shall be inserted in front of every serialized union.

requirement SWS_SomeIpXf_00225 [SWS_SomeIpXf_00225] 📄 PDF

The 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

requirement SWS_SomeIpXf_00226 [SWS_SomeIpXf_00226] 📄 PDF

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

requirement SWS_SomeIpXf_00227 [SWS_SomeIpXf_00227] 📄 PDF

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

requirement SWS_SomeIpXf_00228 [SWS_SomeIpXf_00228] 📄 PDF

In 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])

requirement SWS_SomeIpXf_00229 [SWS_SomeIpXf_00229] 📄 PDF

In function SomeIpXf_<transformerId> defined in [SWS_SomeIpXf_00141] • 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]).

requirement SWS_SomeIpXf_00230 [SWS_SomeIpXf_00230] 📄 PDF

In 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]).

requirement SWS_SomeIpXf_00231 [SWS_SomeIpXf_00231] 📄 PDF

In 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]).

requirement SWS_SomeIpXf_00232 [SWS_SomeIpXf_00232] 📄 PDF

In 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]).

requirement SWS_SomeIpXf_00233 [SWS_SomeIpXf_00233] 📄 PDF

In 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]).

requirement SWS_SomeIpXf_00234 [SWS_SomeIpXf_00234] 📄 PDF

A 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 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].

requirement SWS_SomeIpXf_00235 [SWS_SomeIpXf_00235] 📄 PDF

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

requirement SWS_SomeIpXf_00236 [SWS_SomeIpXf_00236] 📄 PDF

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

requirement SWS_SomeIpXf_00237 [SWS_SomeIpXf_00237] 📄 PDF

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

requirement SWS_SomeIpXf_00238 [SWS_SomeIpXf_00238] 📄 PDF

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

requirement SWS_SomeIpXf_00239 [SWS_SomeIpXf_00239] 📄 PDF

The String specific serialization will only be triggered if an Unicode String is detected and implementsLegacyStringSerialization is false .

requirement SWS_SomeIpXf_00240 [SWS_SomeIpXf_00240] 📄 PDF

Recognition of UTF-8 Fixed Length Strings An 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

requirement SWS_SomeIpXf_00241 [SWS_SomeIpXf_00241] 📄 PDF

Recognition of UTF-16 Fixed Length Strings An 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 – 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

requirement SWS_SomeIpXf_00242 [SWS_SomeIpXf_00242] 📄 PDF

Recognition of UTF-8 Variable Length Strings An 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- DataTypeElement s 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

requirement SWS_SomeIpXf_00243 [SWS_SomeIpXf_00243] 📄 PDF

Recognition of UTF-16 Variable Length Strings An 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 • ImplementationDataType The ImplementationDataType shall be defined according to [TPS_SWCT_- 01650] as a STRUCTURE that contains exactly two Implementation- DataTypeElement s 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

requirement SWS_SomeIpXf_00244 [SWS_SomeIpXf_00244] 📄 PDF

Serialization of fixed length strings Serialization 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

requirement SWS_SomeIpXf_00245 [SWS_SomeIpXf_00245] 📄 PDF

Serialization of dynamic length strings Serialization 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

requirement SWS_SomeIpXf_00246 [SWS_SomeIpXf_00246] 📄 PDF

Deserialization of fixed length strings Deserialization 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 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.

requirement SWS_SomeIpXf_00248 [SWS_SomeIpXf_00248] 📄 PDF

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

requirement SWS_SomeIpXf_00249 [SWS_SomeIpXf_00249] 📄 PDF

A 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- plementationDataTypeElement s: • 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

requirement SWS_SomeIpXf_00250 [SWS_SomeIpXf_00250] 📄 PDF

The 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].

requirement SWS_SomeIpXf_00251 [SWS_SomeIpXf_00251] 📄 PDF

The 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].

requirement SWS_SomeIpXf_00252 [SWS_SomeIpXf_00252] 📄 PDF

If 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])

requirement SWS_SomeIpXf_00253 [SWS_SomeIpXf_00253] 📄 PDF

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

requirement SWS_SomeIpXf_00254 [SWS_SomeIpXf_00254] 📄 PDF

If 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]).

requirement SWS_SomeIpXf_00256 [SWS_SomeIpXf_00256] 📄 PDF

If 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])

requirement SWS_SomeIpXf_00257 [SWS_SomeIpXf_00257] 📄 PDF

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

requirement SWS_SomeIpXf_00258 [SWS_SomeIpXf_00258] 📄 PDF

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

requirement SWS_SomeIpXf_00259 [SWS_SomeIpXf_00259] 📄 PDF

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

requirement SWS_SomeIpXf_00260 [SWS_SomeIpXf_00260] 📄 PDF

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

requirement SWS_SomeIpXf_00262 [SWS_SomeIpXf_00262] 📄 PDF

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

requirement SWS_SomeIpXf_00263 [SWS_SomeIpXf_00263] 📄 PDF

After serialized fixed data length data elements, the SOME/IP transformer shall never add automatically a padding for alignment.

requirement SWS_SomeIpXf_00264 [SWS_SomeIpXf_00264] 📄 PDF

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

requirement SWS_SomeIpXf_00265 [SWS_SomeIpXf_00265] 📄 PDF

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

requirement SWS_SomeIpXf_00266 [SWS_SomeIpXf_00266] 📄 PDF

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

requirement SWS_SomeIpXf_00268 [SWS_SomeIpXf_00268] 📄 PDF

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

requirement SWS_SomeIpXf_00269 [SWS_SomeIpXf_00269] 📄 PDF

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

requirement SWS_SomeIpXf_00270 [SWS_SomeIpXf_00270] 📄 PDF

The wire type shall determine the type of the following data of the member. The value shall be assigned as shown in Table 7.9.

requirement SWS_SomeIpXf_00271 [SWS_SomeIpXf_00271] 📄 PDF

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

requirement SWS_SomeIpXf_00272 [SWS_SomeIpXf_00272] 📄 PDF

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

requirement SWS_SomeIpXf_00273 [SWS_SomeIpXf_00273] 📄 PDF

A deserializer shall always be able to handle the wire types 4, 5, 6 and 7 independent of the setting of SOMEIPTransformationISignalProps . isDynamicLengthFieldSize

requirement SWS_SomeIpXf_00274 [SWS_SomeIpXf_00274] 📄 PDF

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

requirement SWS_SomeIpXf_00275 [SWS_SomeIpXf_00275] 📄 PDF

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

requirement SWS_SomeIpXf_00276 [SWS_SomeIpXf_00276] 📄 PDF

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

requirement SWS_SomeIpXf_00277 [SWS_SomeIpXf_00277] 📄 PDF

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

requirement SWS_SomeIpXf_00278 [SWS_SomeIpXf_00278] 📄 PDF

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

requirement SWS_SomeIpXf_00279 [SWS_SomeIpXf_00279] 📄 PDF

If the member itself is of type struct, there shall be exactly one length field.

requirement SWS_SomeIpXf_00280 [SWS_SomeIpXf_00280] 📄 PDF

If the member itself is of type dynamic length string, there shall be exactly one length field.

requirement SWS_SomeIpXf_00281 [SWS_SomeIpXf_00281] 📄 PDF

If the member itself is of type fixed length string, there shall be exactly one length field corresponding to dynamic length strings.

requirement SWS_SomeIpXf_00282 [SWS_SomeIpXf_00282] 📄 PDF

⌊ DRAFT g If the member itself is of type dynamic length ar- ray, there shall be exactly one length field.

requirement SWS_SomeIpXf_00283 [SWS_SomeIpXf_00283] 📄 PDF

If the member itself is of type fixed length array, there shall be exactly one length field.

requirement SWS_SomeIpXf_00284 [SWS_SomeIpXf_00284] 📄 PDF

If the member itself is of type union, there shall be exactly one length field.

requirement SWS_SomeIpXf_00285 [SWS_SomeIpXf_00285] 📄 PDF

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

requirement SWS_SomeIpXf_00286 [SWS_SomeIpXf_00286] 📄 PDF

A member of a non-extensible (standard) struct which is of type extensible struct, shall be serialized according to the requirements for extensible structs.

requirement SWS_SomeIpXf_00287 [SWS_SomeIpXf_00287] 📄 PDF

A member of an extensible struct which is of type non- extensible (standard) struct, shall be serialized according to the requirements for stan- dard structs.

requirement SWS_SomeIpXf_00288 [SWS_SomeIpXf_00288] 📄 PDF

For the serialization of extensible structs and methods no alignment shall be applied.

requirement SWS_SomeIpXf_00289 [SWS_SomeIpXf_00289] 📄 PDF

If the attribute isStructWithOptionalElement of the ImplementationDataType representing the extensible struct is set to true, the transformer shall ignore the first ImplementationDataTypeElement and shall not se- rialize or deserialize it.

requirement SWS_SomeIpXf_00290 [SWS_SomeIpXf_00290] 📄 PDF

The 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

requirement SWS_SomeIpXf_00291 [SWS_SomeIpXf_00291] 📄 PDF

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

requirement SWS_SomeIpXf_00292 [SWS_SomeIpXf_00292] 📄 PDF

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

requirement SWS_SomeIpXf_00293 [SWS_SomeIpXf_00293] 📄 PDF

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

requirement SWS_SomeIpXf_00294 [SWS_SomeIpXf_00294] 📄 PDF

If 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].

requirement SWS_SomeIpXf_00295 [SWS_SomeIpXf_00295] 📄 PDF

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

requirement SWS_SomeIpXf_00296 [SWS_SomeIpXf_00296] 📄 PDF

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

requirement SWS_SomeIpXf_00297 [SWS_SomeIpXf_00297] 📄 PDF

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

requirement SWS_SomeIpXf_00298 [SWS_SomeIpXf_00298] 📄 PDF

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

requirement SWS_SomeIpXf_00299 [SWS_SomeIpXf_00299] 📄 PDF

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

requirement SWS_SomeIpXf_00301 [SWS_SomeIpXf_00301] 📄 PDF

The function SomeIpXf_ExtractProtocolHeader- Fields specified in [SWS_SomeIpXf_91001] shall return E_OK in all other cases.

requirement SWS_SomeIpXf_00302 [SWS_SomeIpXf_00302] 📄 PDF

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

requirement SWS_SomeIpXf_00303 [SWS_SomeIpXf_00303] 📄 PDF

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

requirement SWS_SomeIpXf_00304 [SWS_SomeIpXf_00304] 📄 PDF

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

requirement SWS_SomeIpXf_00305 [SWS_SomeIpXf_00305] 📄 PDF

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

requirement SWS_SomeIpXf_00306 [SWS_SomeIpXf_00306] 📄 PDF

Serialization based on NetworkRepresentation If a networkRepresentationProps is defined according to [TPS_SYST_02136] on the ISignal , then the SOME/IP serialization shall be based on the networkRepresen- tationProps .

requirement SWS_SomeIpXf_00307 [SWS_SomeIpXf_00307] 📄 PDF

Serialization based on ImplementationDataTypes If no networkRepresentationProps is defined on the ISignal , then (according to [TPS_SYST_02137]) the SOME/IP serialization shall be based on the Implementa- tionDataType s.

requirement SWS_SomeIpXf_CONSTR_0001 [SWS_SomeIpXf_CONSTR_0001] 📄 PDF

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

requirement SWS_SomeIpXf_CONSTR_0002 [SWS_SomeIpXf_CONSTR_0002] 📄 PDF

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

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_SomeIpXf
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_SomeIpXf@rel:R20-11#bdbddf75
Content hash
bdbddf75
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_SOMEIPTransformer.pdf#nameddest=SWS_SomeIpXf_00138

خريطة المواضيع

الأنواع

1

المتطلبات

186
SWS_SomeIpXf_00001SWS_SomeIpXf_00002SWS_SomeIpXf_00005SWS_SomeIpXf_00006SWS_SomeIpXf_00007SWS_SomeIpXf_00009SWS_SomeIpXf_00010SWS_SomeIpXf_00011SWS_SomeIpXf_00013SWS_SomeIpXf_00015SWS_SomeIpXf_00016SWS_SomeIpXf_00017SWS_SomeIpXf_00024SWS_SomeIpXf_00025SWS_SomeIpXf_00026SWS_SomeIpXf_00029SWS_SomeIpXf_00030SWS_SomeIpXf_00031SWS_SomeIpXf_00033SWS_SomeIpXf_00034SWS_SomeIpXf_00036SWS_SomeIpXf_00037SWS_SomeIpXf_00042SWS_SomeIpXf_00053SWS_SomeIpXf_00054SWS_SomeIpXf_00055SWS_SomeIpXf_00056SWS_SomeIpXf_00057SWS_SomeIpXf_00058SWS_SomeIpXf_00059SWS_SomeIpXf_00060SWS_SomeIpXf_00069SWS_SomeIpXf_00070SWS_SomeIpXf_00072SWS_SomeIpXf_00076SWS_SomeIpXf_00088SWS_SomeIpXf_00098SWS_SomeIpXf_00099SWS_SomeIpXf_00106SWS_SomeIpXf_00107SWS_SomeIpXf_00108SWS_SomeIpXf_00111SWS_SomeIpXf_00112SWS_SomeIpXf_00113SWS_SomeIpXf_00115SWS_SomeIpXf_00120SWS_SomeIpXf_00121SWS_SomeIpXf_00130SWS_SomeIpXf_00131SWS_SomeIpXf_00132SWS_SomeIpXf_00133SWS_SomeIpXf_00134SWS_SomeIpXf_00136SWS_SomeIpXf_00139SWS_SomeIpXf_00140SWS_SomeIpXf_00142SWS_SomeIpXf_00143SWS_SomeIpXf_00146SWS_SomeIpXf_00147SWS_SomeIpXf_00148SWS_SomeIpXf_00149SWS_SomeIpXf_00150SWS_SomeIpXf_00151SWS_SomeIpXf_00152SWS_SomeIpXf_00154SWS_SomeIpXf_00155SWS_SomeIpXf_00156SWS_SomeIpXf_00160SWS_SomeIpXf_00161SWS_SomeIpXf_00163SWS_SomeIpXf_00164SWS_SomeIpXf_00165SWS_SomeIpXf_00166SWS_SomeIpXf_00168SWS_SomeIpXf_00169SWS_SomeIpXf_00170SWS_SomeIpXf_00172SWS_SomeIpXf_00176SWS_SomeIPxf_00184SWS_SomeIpXf_00185SWS_SomeIpXf_00200SWS_SomeIpXf_00201SWS_SomeIpXf_00202SWS_SomeIpXf_00203SWS_SomeIpXf_00204SWS_SomeIpXf_00205SWS_SomeIpXf_00207SWS_SomeIpXf_00208SWS_SomeIpXf_00210SWS_SomeIpXf_00211SWS_SomeIpXf_00212SWS_SomeIpXf_00213SWS_SomeIpXf_00214SWS_SomeIpXf_00215SWS_SomeIpXf_00216SWS_SomeIpXf_00217SWS_SomeIpXf_00218SWS_SomeIpXf_00219SWS_SomeIpXf_00220SWS_SomeIpXf_00221SWS_SomeIpXf_00222SWS_SomeIpXf_00223SWS_SomeIpXf_00224SWS_SomeIpXf_00225SWS_SomeIpXf_00226SWS_SomeIpXf_00227SWS_SomeIpXf_00228SWS_SomeIpXf_00229SWS_SomeIpXf_00230SWS_SomeIpXf_00231SWS_SomeIpXf_00232SWS_SomeIpXf_00233SWS_SomeIpXf_00234SWS_SomeIpXf_00235SWS_SomeIpXf_00236SWS_SomeIpXf_00237SWS_SomeIpXf_00238SWS_SomeIpXf_00239SWS_SomeIpXf_00240SWS_SomeIpXf_00241SWS_SomeIpXf_00242SWS_SomeIpXf_00243SWS_SomeIpXf_00244SWS_SomeIpXf_00245SWS_SomeIpXf_00246SWS_SomeIpXf_00247SWS_SomeIpXf_00248SWS_SomeIpXf_00249SWS_SomeIpXf_00250SWS_SomeIpXf_00251SWS_SomeIpXf_00252SWS_SomeIpXf_00253SWS_SomeIpXf_00254SWS_SomeIpXf_00256SWS_SomeIpXf_00257SWS_SomeIpXf_00258SWS_SomeIpXf_00259SWS_SomeIpXf_00260SWS_SomeIpXf_00262SWS_SomeIpXf_00263SWS_SomeIpXf_00264SWS_SomeIpXf_00265SWS_SomeIpXf_00266SWS_SomeIpXf_00267SWS_SomeIpXf_00268SWS_SomeIpXf_00269SWS_SomeIpXf_00270SWS_SomeIpXf_00271SWS_SomeIpXf_00272SWS_SomeIpXf_00273SWS_SomeIpXf_00274SWS_SomeIpXf_00275SWS_SomeIpXf_00276SWS_SomeIpXf_00277SWS_SomeIpXf_00278SWS_SomeIpXf_00279SWS_SomeIpXf_00280SWS_SomeIpXf_00281SWS_SomeIpXf_00282SWS_SomeIpXf_00283SWS_SomeIpXf_00284SWS_SomeIpXf_00285SWS_SomeIpXf_00286SWS_SomeIpXf_00287SWS_SomeIpXf_00288SWS_SomeIpXf_00289SWS_SomeIpXf_00290SWS_SomeIpXf_00291SWS_SomeIpXf_00292SWS_SomeIpXf_00293SWS_SomeIpXf_00294SWS_SomeIpXf_00295SWS_SomeIpXf_00296SWS_SomeIpXf_00297SWS_SomeIpXf_00298SWS_SomeIpXf_00299SWS_SomeIpXf_00300SWS_SomeIpXf_00301SWS_SomeIpXf_00302SWS_SomeIpXf_00303SWS_SomeIpXf_00304SWS_SomeIpXf_00305SWS_SomeIpXf_00306SWS_SomeIpXf_00307SWS_SomeIpXf_CONSTR_0001SWS_SomeIpXf_CONSTR_0002

عرض التفاصيل

اختر عنصرًا من المخطط.

التهيئة والحالة

This service deinitializes the transformer.

void SomeIpXf_DeInit(void);

This service returns the version information of the called transformer module.

void SomeIpXf_GetVersionInfo(Std_VersionInfoType* VersionInfo);
SomeIpXf_Init دالة

This service initializes the transformer for the further processing.

void SomeIpXf_Init(const SomeIpXf_ConfigType* config);

الخدمات

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

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

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.

uint8 SomeIpXf_Inv_<transformerId>(const uint8* buffer, uint32 bufferLength, <type>* dataElement);

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.

uint8 SomeIpXf_Inv_<transformerId>(Rte_Cs_TransactionHandleType* TransactionHandle, const uint8* buffer, uint32 bufferLength, [ Std_ReturnType* returnValue ], [ <paramtype> data ]);

This function deserializes an external trigger event using the deserialization of SOME/IP.

uint8 SomeIpXf_Inv_<transformerId>(const uint8* buffer, uint32 bufferLength);

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.

uint8 SomeIpXf_<transformerId>(uint8* buffer, uint32* bufferLength, <paramtype> dataElement);

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.

uint8 SomeIpXf_<transformerId>(const Rte_Cs_TransactionHandleType* TransactionHandle, uint8* buffer, uint32* bufferLength, [ Std_ReturnType returnValue ], <paramtype> data_1, ... <paramtype> data_n);

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.

uint8 SomeIpXf_<transformerId>(uint8* buffer, uint32* bufferLength);

الأنواع

This is the type of the data structure containing the initialization data for the transformer.

المتطلبات

SWS_SomeIpXf_00001 requirement

A service shall be identified using the Service-ID.

SWS_SomeIpXf_00002 requirement

Service-IDs shall be of type 16 bit length unsigned integer (uint16).

SWS_SomeIpXf_00005 requirement

Different services within the same vehicle shall have differ- ent Service-IDs.

SWS_SomeIpXf_00006 requirement

A service instance shall be identified using the Service- Instance-ID.

SWS_SomeIpXf_00007 requirement

Service-Instance-IDs shall be of type 16 bit length un- signed integer (uint16).

SWS_SomeIpXf_00009 requirement

Different service instances within the same vehicle shall have different Service-Instance-IDs.

SWS_SomeIpXf_00010 requirement

Methods and events shall be identified inside a service us- ing a 16bit Method-ID, which is called Event-ID for events and notifications.

SWS_SomeIpXf_00011 requirement

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

SWS_SomeIpXf_00013 requirement

All headers shall be encoded in network byte order Big Endian (MostSignificantByteFirst) [RFC 791].

SWS_SomeIpXf_00015 requirement

The SOME/IP transformer shall implement all fields of the header except Message ID and Length.

SWS_SomeIpXf_00016 requirement

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

SWS_SomeIpXf_00017 requirement

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

SWS_SomeIpXf_00024 requirement

The Request ID shall be constructed of the Client ID and Session ID as shown in Table 7.5.

SWS_SomeIpXf_00025 requirement

The clientId inside the Rte_Cs_TransactionHandleType handed over from RTE shall be used for the value of the Client ID.

SWS_SomeIpXf_00026 requirement

The sequenceCounter inside the Rte_Cs_TransactionHandleType handed over from RTE shall be used for the value of the Session ID.

SWS_SomeIpXf_00029 requirement

The Protocol Version shall be set to 0x01.

SWS_SomeIpXf_00030 requirement

The Interface Version field shall be 8 bit long.

SWS_SomeIpXf_00031 requirement

The Message Type field shall be filled with one of the values of Table 7.6.

SWS_SomeIpXf_00033 requirement

Messages of Type REQUEST, REQUEST_NO_RETURN, and Notification have to set the Return Code to 0x00 (E_OK).

SWS_SomeIpXf_00034 requirement

The serialization shall be based on the Sender- ReceiverInterface or ClientServerInterface of the data.

SWS_SomeIpXf_00036 requirement

The SwBaseType s 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.

SWS_SomeIpXf_00037 requirement

Alignment shall always be calculated from start of SOME/IP message.

SWS_SomeIpXf_00042 requirement

A struct shall be serialized in order of depth-first traversal.

SWS_SomeIpXf_00053 requirement

Strings 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".

SWS_SomeIpXf_00054 requirement

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

SWS_SomeIpXf_00055 requirement

UTF-16LE and UTF-16BE strings shall be zero terminated with a "\textbackslash0"-character . This means they shall end with (at least) two 0x00 Bytes.

SWS_SomeIpXf_00056 requirement

UTF-16LE and UTF-16BE strings shall have an even length.

SWS_SomeIpXf_00057 requirement

For UTF-16LE and UTF-16BE strings having an odd length the last byte shall be silently removed by the receiving SOME/IP transformer.

SWS_SomeIpXf_00058 requirement

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

SWS_SomeIpXf_00059 requirement

The receiving SOME/IP transformer implementation shall check the BOM and handle a missing BOM or a malformed BOM as an error.

SWS_SomeIpXf_00060 requirement

The BOM shall be added by the SOME/IP sending trans- former implementation.

SWS_SomeIpXf_00069 requirement

The length of fixed length arrays is defined by the datatype definition.

SWS_SomeIpXf_00070 requirement

A one-dimensional array with fixed length shall be serial- ized by concatenating the array elements in order.

SWS_SomeIpXf_00072 requirement

The serialization of multidimensional arrays shall happen in row-major order(in-memory layout of multidimensional arrays in the C programming language)

SWS_SomeIpXf_00076 requirement

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

SWS_SomeIpXf_00088 requirement

The default serialization layout of unions in SOME/IP is shown in Table 7.10.

SWS_SomeIpXf_00098 requirement

Spezifikationsanforderung SWS_SomeIpXf_00098.

SWS_SomeIpXf_00099 requirement

The 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].

SWS_SomeIpXf_00106 requirement

For the SOME/IP request message, the SOME/IP trans- former on the client-ECU has to do the following for payload and header: • 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

SWS_SomeIpXf_00107 requirement

The 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 ) • 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 .

SWS_SomeIpXf_00108 requirement

The 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 – REQUEST_NO_RETURN ( 0x01 ) shall be used in the header if attribute mes- sageType is set to requestNoReturn • Set the Return Code to 0x00

SWS_SomeIpXf_00111 requirement

The SOME/IP transformer shall use the Return Code error handling.

SWS_SomeIpXf_00112 requirement

The Error Handling via Return Code shall be based on the Std_ReturnType .

SWS_SomeIpXf_00113 requirement

The Return Codes shall only be used for Client/Server communication

SWS_SomeIpXf_00115 requirement

The Return Codes of Table 7.11 are currently defined and shall be implemented as described:

SWS_SomeIpXf_00120 requirement

To construct the payload of a request message all argu- ment s of the ClientServerOperation which have direction IN or INOUT shall be serialized according to the order of the ArgumentDataPrototype s within the ClientServerOperation .

SWS_SomeIpXf_00121 requirement

To construct the payload of a response message all argu- ment s of the ClientServerOperation which have direction INOUT or OUT shall be serialized in the following order: The ArgumentDataPrototype s with a direction of INOUT or OUT shall be serialized according to the order of the ArgumentDataPrototype s within the ClientServer- Operation .

SWS_SomeIpXf_00130 requirement

Reserved and special Service-IDs are defined in Table 7.12.

SWS_SomeIpXf_00131 requirement

Reserved and special Instance-IDs are defined in Table 7.13.

SWS_SomeIpXf_00132 requirement

Reserved and special Method-IDs/Event-IDs are defined in Table 7.14.

SWS_SomeIpXf_00133 requirement

Method-IDs and Event-IDs of Service 0xFFFF are defined in Table 7.15.

SWS_SomeIpXf_00134 requirement

Besides "otherserv" other names are supported by the con- figuration option. Table 7.16 gives an overview of the reserved names

SWS_SomeIpXf_00136 requirement

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

SWS_SomeIpXf_00139 requirement

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

SWS_SomeIpXf_00140 requirement

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

SWS_SomeIpXf_00142 requirement

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

SWS_SomeIpXf_00143 requirement

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

SWS_SomeIpXf_00146 requirement

The function SomeIpXf_Inv_<transformerId> speci- fied in [SWS_SomeIpXf_00144] 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 SenderReceiverToSignalMapping .

SWS_SomeIpXf_00147 requirement

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

SWS_SomeIpXf_00148 requirement

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 .

SWS_SomeIpXf_00149 requirement

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

SWS_SomeIpXf_00150 requirement

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

SWS_SomeIpXf_00151 requirement

The 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

SWS_SomeIpXf_00152 requirement

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

SWS_SomeIpXf_00154 requirement

The Request ID field shall be 32 bit long.

SWS_SomeIpXf_00155 requirement

The Protocol Version field shall be 8 bit long.

SWS_SomeIpXf_00156 requirement

The Protocol Version field shall contain the SOME/IP pro- tocol version.

SWS_SomeIpXf_00160 requirement

The Interface Version field shall contain the Version of the Service Interface.

SWS_SomeIpXf_00161 requirement

The Message Type field shall be 8 bit long.

SWS_SomeIpXf_00163 requirement

The Return Code field shall be 8 bit long.

SWS_SomeIpXf_00164 requirement

The Return Code field shall be used to signal whether a request has been successfully processed.

SWS_SomeIpXf_00165 requirement

The Payload field shall have variable size.

SWS_SomeIpXf_00166 requirement

The Payload field shall contain the transported data.

SWS_SomeIpXf_00168 requirement

The allowed Return Codes for specific message types are specified in Table 7.7.

SWS_SomeIpXf_00169 requirement

To allow migration the deserialization shall ignore parame- ters attached to the end of previously known parameter list.

SWS_SomeIpXf_00170 requirement

In case of Client/Server communication the Return Code shall transport the ApplicationError s of the executed ClientServerOperation if no SOME/IP error occurred.

SWS_SomeIpXf_00172 requirement

The byte order of the parameters inside the payload shall be defined by byteOrder of SOMEIPTransformationDescription .

SWS_SomeIpXf_00176 requirement

The payload of a message for Sender/Receiver communi- cation shall consists of the serialized data element that is transported.

SWS_SomeIPxf_00184 requirement

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

SWS_SomeIpXf_00185 requirement

The apiServicePrefix of the SOME/IP transformer's EcuC shall be set to SomeIpXf .

SWS_SomeIpXf_00200 requirement

If 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].

SWS_SomeIpXf_00201 requirement

The 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 � 0 x 80 ) • Place the adaptedReturnValue into the Return Code field.

SWS_SomeIpXf_00202 requirement

A 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]).

SWS_SomeIpXf_00203 requirement

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

SWS_SomeIpXf_00204 requirement

The 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

SWS_SomeIpXf_00205 requirement

The payload of a message for external trigger event com- munication shall be empty.

SWS_SomeIpXf_00207 requirement

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

SWS_SomeIpXf_00208 requirement

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

SWS_SomeIpXf_00210 requirement

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

SWS_SomeIpXf_00211 requirement

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

SWS_SomeIpXf_00212 requirement

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

SWS_SomeIpXf_00213 requirement

All Session Handling ID counters shall be initialized with 0x0001 .

SWS_SomeIpXf_00214 requirement

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

SWS_SomeIpXf_00215 requirement

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

SWS_SomeIpXf_00216 requirement

If attribute sizeOfStructLengthFields of SOMEIP- TransformationISignalProps is set to a value greater 0, a length field shall be inserted in front of every serialized struct.

SWS_SomeIpXf_00217 requirement

The 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

SWS_SomeIpXf_00218 requirement

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

SWS_SomeIpXf_00219 requirement

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

SWS_SomeIpXf_00220 requirement

If attribute sizeOfArrayLengthFields of SOMEIP- TransformationISignalProps is set to a value greater 0, a length field shall be inserted in front of every serialized array.

SWS_SomeIpXf_00221 requirement

The 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

SWS_SomeIpXf_00222 requirement

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

SWS_SomeIpXf_00223 requirement

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

SWS_SomeIpXf_00224 requirement

If attribute sizeOfUnionLengthFields of SOMEIP- TransformationISignalProps is set to a value greater 0, a length field shall be inserted in front of every serialized union.

SWS_SomeIpXf_00225 requirement

The 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

SWS_SomeIpXf_00226 requirement

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

SWS_SomeIpXf_00227 requirement

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

SWS_SomeIpXf_00228 requirement

In 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])

SWS_SomeIpXf_00229 requirement

In function SomeIpXf_<transformerId> defined in [SWS_SomeIpXf_00141] • 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]).

SWS_SomeIpXf_00230 requirement

In 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]).

SWS_SomeIpXf_00231 requirement

In 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]).

SWS_SomeIpXf_00232 requirement

In 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]).

SWS_SomeIpXf_00233 requirement

In 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]).

SWS_SomeIpXf_00234 requirement

A 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 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].

SWS_SomeIpXf_00235 requirement

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

SWS_SomeIpXf_00236 requirement

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

SWS_SomeIpXf_00237 requirement

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

SWS_SomeIpXf_00238 requirement

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

SWS_SomeIpXf_00239 requirement

The String specific serialization will only be triggered if an Unicode String is detected and implementsLegacyStringSerialization is false .

SWS_SomeIpXf_00240 requirement

Recognition of UTF-8 Fixed Length Strings An 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

SWS_SomeIpXf_00241 requirement

Recognition of UTF-16 Fixed Length Strings An 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 – 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

SWS_SomeIpXf_00242 requirement

Recognition of UTF-8 Variable Length Strings An 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- DataTypeElement s 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

SWS_SomeIpXf_00243 requirement

Recognition of UTF-16 Variable Length Strings An 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 • ImplementationDataType The ImplementationDataType shall be defined according to [TPS_SWCT_- 01650] as a STRUCTURE that contains exactly two Implementation- DataTypeElement s 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

SWS_SomeIpXf_00244 requirement

Serialization of fixed length strings Serialization 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

SWS_SomeIpXf_00245 requirement

Serialization of dynamic length strings Serialization 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

SWS_SomeIpXf_00246 requirement

Deserialization of fixed length strings Deserialization 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 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.

SWS_SomeIpXf_00247 requirement

. byteOrder have different values.

SWS_SomeIpXf_00248 requirement

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

SWS_SomeIpXf_00249 requirement

A 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- plementationDataTypeElement s: • 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

SWS_SomeIpXf_00250 requirement

The 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].

SWS_SomeIpXf_00251 requirement

The 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].

SWS_SomeIpXf_00252 requirement

If 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])

SWS_SomeIpXf_00253 requirement

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

SWS_SomeIpXf_00254 requirement

If 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]).

SWS_SomeIpXf_00256 requirement

If 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])

SWS_SomeIpXf_00257 requirement

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

SWS_SomeIpXf_00258 requirement

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

SWS_SomeIpXf_00259 requirement

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

SWS_SomeIpXf_00260 requirement

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

SWS_SomeIpXf_00262 requirement

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

SWS_SomeIpXf_00263 requirement

After serialized fixed data length data elements, the SOME/IP transformer shall never add automatically a padding for alignment.

SWS_SomeIpXf_00264 requirement

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

SWS_SomeIpXf_00265 requirement

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

SWS_SomeIpXf_00266 requirement

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

SWS_SomeIpXf_00267 requirement

The length of a tag shall be two bytes.

SWS_SomeIpXf_00268 requirement

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

SWS_SomeIpXf_00269 requirement

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

SWS_SomeIpXf_00270 requirement

The wire type shall determine the type of the following data of the member. The value shall be assigned as shown in Table 7.9.

SWS_SomeIpXf_00271 requirement

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

SWS_SomeIpXf_00272 requirement

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

SWS_SomeIpXf_00273 requirement

A deserializer shall always be able to handle the wire types 4, 5, 6 and 7 independent of the setting of SOMEIPTransformationISignalProps . isDynamicLengthFieldSize

SWS_SomeIpXf_00274 requirement

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

SWS_SomeIpXf_00275 requirement

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

SWS_SomeIpXf_00276 requirement

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

SWS_SomeIpXf_00277 requirement

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

SWS_SomeIpXf_00278 requirement

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

SWS_SomeIpXf_00279 requirement

If the member itself is of type struct, there shall be exactly one length field.

SWS_SomeIpXf_00280 requirement

If the member itself is of type dynamic length string, there shall be exactly one length field.

SWS_SomeIpXf_00281 requirement

If the member itself is of type fixed length string, there shall be exactly one length field corresponding to dynamic length strings.

SWS_SomeIpXf_00282 requirement

⌊ DRAFT g If the member itself is of type dynamic length ar- ray, there shall be exactly one length field.

SWS_SomeIpXf_00283 requirement

If the member itself is of type fixed length array, there shall be exactly one length field.

SWS_SomeIpXf_00284 requirement

If the member itself is of type union, there shall be exactly one length field.

SWS_SomeIpXf_00285 requirement

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

SWS_SomeIpXf_00286 requirement

A member of a non-extensible (standard) struct which is of type extensible struct, shall be serialized according to the requirements for extensible structs.

SWS_SomeIpXf_00287 requirement

A member of an extensible struct which is of type non- extensible (standard) struct, shall be serialized according to the requirements for stan- dard structs.

SWS_SomeIpXf_00288 requirement

For the serialization of extensible structs and methods no alignment shall be applied.

SWS_SomeIpXf_00289 requirement

If the attribute isStructWithOptionalElement of the ImplementationDataType representing the extensible struct is set to true, the transformer shall ignore the first ImplementationDataTypeElement and shall not se- rialize or deserialize it.

SWS_SomeIpXf_00290 requirement

The 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

SWS_SomeIpXf_00291 requirement

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

SWS_SomeIpXf_00292 requirement

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

SWS_SomeIpXf_00293 requirement

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

SWS_SomeIpXf_00294 requirement

If 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].

SWS_SomeIpXf_00295 requirement

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

SWS_SomeIpXf_00296 requirement

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

SWS_SomeIpXf_00297 requirement

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

SWS_SomeIpXf_00298 requirement

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

SWS_SomeIpXf_00299 requirement

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

SWS_SomeIpXf_00300 requirement

Bitfields shall be transported as basic datatypes uint8/uint16/uint32.

SWS_SomeIpXf_00301 requirement

The function SomeIpXf_ExtractProtocolHeader- Fields specified in [SWS_SomeIpXf_91001] shall return E_OK in all other cases.

SWS_SomeIpXf_00302 requirement

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

SWS_SomeIpXf_00303 requirement

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

SWS_SomeIpXf_00304 requirement

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

SWS_SomeIpXf_00305 requirement

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

SWS_SomeIpXf_00306 requirement

Serialization based on NetworkRepresentation If a networkRepresentationProps is defined according to [TPS_SYST_02136] on the ISignal , then the SOME/IP serialization shall be based on the networkRepresen- tationProps .

SWS_SomeIpXf_00307 requirement

Serialization based on ImplementationDataTypes If no networkRepresentationProps is defined on the ISignal , then (according to [TPS_SYST_02137]) the SOME/IP serialization shall be based on the Implementa- tionDataType s.

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

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