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
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值