Basic Data types
The following basic datatypes shall be supported:
| Type | Description | Size [bit] | Remark |
|---|---|---|---|
| boolean | TRUE/FALSE value | 8 | FALSE(0),TURE(1) |
| uint8 | unsigned Integer | 8 | |
| uint16 | unsigned Integer | 16 | |
| uint32 | unsigned Integer | 32 | |
| sint8 | signed Integer | 8 | |
| sint16 | signed Integer | 16 | |
| sint32 | signed Integer | 32 | |
| ?oat32 | ?oating point number | 32 | IEEE 754 binary32 (Single Precision) |
| ?oat64 | ?oating point number | 64 | IEEE 754 binary64 (Double Precision) |
The Byte Order is speci?ed for each parameter by the interface de?nition.
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的默認(rèn)序列化布局。 - 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的長度字段描述聯(lián)合中的字節(jié)數(shù)。 這允許deserializer快速計算串行數(shù)據(jù)流中union開始后的數(shù)據(jù)的位置。 如果聯(lián)合包含比預(yù)期更大的數(shù)據(jù),則這是必要的,例如,如果一個結(jié)構(gòu)體擴(kuò)展了附加的新成員,并且只有第一個“舊”成員被SOME / IP transformer反序列化。

- Example:
Union of uint8/uint16 both padded to 32 bit.
uint8 / uint16的聯(lián)合都填充為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應(yīng)支持uint8和uint16作為元素。 兩者都填充到32位邊界(長度= 4字節(jié))。
A uint8 will be serialized like this:
uint8將會像這樣被序列化:
| Lentgh =4 Bytes | Type =1 | uint 8 | Padding 0x00 | Padding 0x00 | Padding 0x00 |
|---|
A uint16 will be serialized like this:
uint16將會像這樣被序列化:
| Lentgh =4 Bytes | Type =2 | uint 16 | Padding 0x00 | Padding 0x00 |
|---|
