SOME/IP报文格式-Serialization of Parameters

Basic Data types

The following basic datatypes shall be supported:

TypeDescriptionSize [bit]Remark
booleanTRUE/FALSE value8FALSE(0),TURE(1)
uint8unsigned Integer8
uint16unsigned Integer16
uint32unsigned Integer32
sint8signed Integer8
sint16signed Integer16
sint32signed Integer32
float32floating point number32IEEE 754 binary32 (Single Precision)
float64floating point number64IEEE 754 binary64 (Double Precision)

The Byte Order is specified for each parameter by the interface definition.
In addition, uint64 and sint64 types shall be supported at least on infotainment ECUs.

Structured Datatypes (structs)

在这里插入图片描述

String

  • Serialization of string (fixed length)
    在这里插入图片描述
  • Serialization of string (dynamic length)
    在这里插入图片描述

Arrays (fixed length)

  • One-dimensional array, fixed length: a[n]
    在这里插入图片描述
  • Multi-dimensional array, fixed length: a[n][m]
    在这里插入图片描述

Dynamic Length Arrays / Variable Size Arrays

  • One-dimensional array, dynamic length在这里插入图片描述
  • Multi-dimensional array, dynamic length
    在这里插入图片描述

Union

  • The default serialization layout of unions in SOME/IP is shown as following.
    SOME / IP中 union的默认序列化布局。

  • SOME/IP allows to add a length field of 8, 16 or 32 bit in front of unions.
    SOME / IP允许在union前添加8,16或32位的长度字段。

  • The length field of a union describes the number of bytes in the union. This allows the deserializer to quickly calculate the position where the data after the union begin in the serialized data stream. This gets necessary if the union contains data which are larger than expected, for example if a struct was extended with appended new members and only the first “old” members are deserialized by the SOME/IP transformer.
    union的长度字段描述联合中的字节数。 这允许deserializer快速计算串行数据流中union开始后的数据的位置。 如果联合包含比预期更大的数据,则这是必要的,例如,如果一个结构体扩展了附加的新成员,并且只有第一个“旧”成员被SOME / IP transformer反序列化。
    在这里插入图片描述

  • Example:
    Union of uint8/uint16 both padded to 32 bit.
    uint8 / uint16的联合都填充为32位。

    In this example a length of the length field is specified as 32 bits. The union shall support a uint8 and a uint16 as elements. Both are padded to the 32 bit boundary (length=4 Bytes).

    在这个例子中,长度字段的长度被指定为32位。 union应支持uint8和uint16作为元素。 两者都填充到32位边界(长度= 4字节)。

A uint8 will be serialized like this:
uint8将会像这样被序列化:

Lentgh =4 BytesType =1uint 8Padding 0x00Padding 0x00Padding 0x00

A uint16 will be serialized like this:
uint16将会像这样被序列化:

Lentgh =4 BytesType =2uint 16Padding 0x00Padding 0x00
### SOME/IP Protocol ARXML Configuration and Usage In automotive software development, the SOME/IP (Scalable service-Oriented MiddlewarE over IP) protocol plays a crucial role in enabling communication between different components within vehicles. The configuration of this protocol through ARXML files is essential for defining how these communications are structured. #### Definition of Communication Interfaces The definition of communication interfaces using ARXML involves specifying various parameters that control message exchange behavior. For instance: - **Application Endpoints**: These define where messages can be sent or received. - **Service Instances**: Each service has unique identifiers such as Service ID and Instance ID which must be configured correctly to ensure proper routing of requests and responses[^1]. ```xml <COM-SPEC> <SERVICE-ID>0x07D0</SERVICE-ID> <INSTANCE-ID>0x8001</INSTANCE-ID> </COM-SPEC> ``` #### Message Definitions Messages exchanged via SOME/IP need detailed descriptions including their structure, type definitions, and serialization formats. This information ensures all nodes understand what data they should expect when communicating with each other. For example, configuring a method call might look like this: ```xml <METHOD-PROTOTYPE> <SHORT-NAME>RequestVehicleSpeed</SHORT-NAME> <PARAMETERS> <!-- Parameter details here --> </PARAMETERS> </METHOD-PROTOTYPE> ``` #### Event Handling Events allow asynchronous notifications from one component to another without requiring an explicit request-response cycle. Configuring events includes setting up event groups and associating them with specific services. An illustrative snippet could appear as follows: ```xml <EVENT-GROUP> <EVENTS> <EVENT REF="/EventDefinitions/VehicleStarted"/> </EVENTS> </EVENT-GROUP> ``` #### Field Accessors Fields represent continuously updated values shared among multiple clients. Defining field access methods allows efficient polling mechanisms while minimizing network traffic overhead. Example configuration may include: ```xml <FIELD> <GETTER> <OPERATION-REF>/Operations/GetEngineTemperature</OPERATION-REF> </GETTER> </FIELD> ``` These configurations provide comprehensive guidance on integrating SOME/IP into automotive systems following AUTOSAR standards. By adhering closely to these guidelines during implementation phases, developers achieve reliable inter-component interactions critical for modern vehicle functionalities.
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值