SOME/IP Transformer
Overview
RAPIDSEA supports SOME/IP transformer module handles the serialization and deserialization of SOME/IP messages as explained in the SOME/IP Protocol page. The SOME/IP Transformer Module is a middleware-level component responsible for converting application-level data structures into SOME/IP wire-format byte streams (serialization) and reconstructing application-level data from received byte streams (deserialization). It acts as the translation layer between the service interface model and the underlying transport.
This module abstracts the encoding and decoding logic, enabling upper layers to interact with structured data without handling low-level byte manipulation.
The below diagram captures the block level diagram of the SOME/IP Transformer and how it interfaces with other modules.
Application Interface
The SOME/IP Transformer module ensures correct transformation of data by providing mechanisms for:
Serializing application data into SOME/IP-compliant message payloads.
Deserializing received SOME/IP payloads into application-level data structures.
Handling byte order conversion (endianness).
Managing data alignment as per SOME/IP specification.
Supporting primitive and complex data types.
Ensuring consistency between transmitted and received data formats.
Serialization
Serialization is the process of converting structured application data into a contiguous byte buffer conforming to the SOME/IP wire format, for transmission over the network.
The transformer module shall:
Convert each field of the application data structure into its binary representation.
Follow the SOME/IP payload format and data type encoding rules.
Apply network byte order (big-endian) for multi-byte data types.
Handle variable-length data such as arrays and strings.
Supported Data Types
The module shall support serialization of:
Unsigned and signed integers (8/16/32/64-bit)
Boolean values
Floating-point types (if applicable)
Arrays (fixed and dynamic length)
Strings (length-prefixed)
structures
High level flow chart is depicted below for serialization:
Deserialization
Deserialization is the process of parsing a received SOME/IP byte buffer and reconstructing the strongly-typed application data structures that represent the original transmitted values.
The transformer module shall:
Parse the incoming byte stream sequentially.
Extract fields based on predefined data types and structure definitions.
Perform byte order conversion from network to host format.
Validate payload length before extraction.
Handle variable-length data safely.
High level flow chart is depicted below for deserialization:
The RAPIDSEA SOME/IP Transformer module clearly defines API functions that are essential for users to implement and integrate serialization and deserialization mechanisms effectively.
The below table captures the function that are to be called from the application logic.
Function |
Description |
|---|---|
rs_someip_transformer_get_version_info |
To get the version information of SOME/IP Transformer module. |
rs_some_get_serialize_event_data |
To get the serialization fixed data type event data. |
rs_some_pack_struct_data |
To construct the payload data based on the given tag number from the given pointer |
rs_some_pack_union_data |
To construct the payload data for union datatype. |
rs_some_set_deserialize_event_data |
To set the deserialization payload data into event data. |
rs_some_unpack_struct_data |
To unpack the structure data with corresponding wire type. |
rs_some_unpack_union_data |
To unpack the union data. |
Implementation Guide
For serialization
Consturct the payload using
rs_some_get_serialize_event_dataorrs_some_pack_struct_dataorrs_some_pack_union_datacalled by application layer of SOME/IP server or client based on data type.Transmit the serialized SOME/IP payload through the SOME/IP server or client module.
For deserialization
Receive the SOME/IP payload from the transport/protocol layer.
Deserialize the received data using
rs_some_set_deserialize_event_dataorrs_some_unpack_struct_dataorrs_some_unpack_union_datacalled by SOME/IP server or client based on data type.Validate the deserialized data and ensure consistency before passing it to the application layer.
The below diagram captures the high level sequence of operations associated with the SOME/IP stack layer.
SOME/IP Transformer Stack Memory Usage
Platform |
Memory |
Size |
|---|---|---|
Micro controller (iMXRT) |
ROM |
TODO |
Micro controller (iMXRT) |
RAM |
TODO |
Dependency
This stack depends on the below RAPIDSEA interfaces that can be obtained or custom implemented.
SOME/IP Transformer Header Details
Documentation from the relevant header as follows:
SOME/IP Transformer Module.
This file contains the APIs for using defined SOME/IP Transformer(Serialization & Deserialization) Module
- Author
Embien RAPIDSEA Team
- Copyright
Embien Technologies India Pvt. Ltd.
Defines
-
RS_SOMEIP_WIRE_TYPE_8_BIT
SOME/IP serialization wire type - 8 Bit.
-
RS_SOMEIP_WIRE_TYPE_16_BIT
SOME/IP serialization wire type - 16 Bit.
-
RS_SOMEIP_WIRE_TYPE_32_BIT
SOME/IP serialization wire type - 32 Bit.
-
RS_SOMEIP_WIRE_TYPE_64_BIT
SOME/IP serialization wire type - 64 Bit.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_STATIC_LEN
SOME/IP serialization wire type - Data 0 Static length.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_1_BYTE_LEN
SOME/IP serialization wire type - Data 1 Static length.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_2_BYTE_LEN
SOME/IP serialization wire type - Data 2 Static length.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_4_BYTE_LEN
SOME/IP serialization wire type - Data 4 Static length.
-
RS_SOMEIP_TAG_LEN
SOME/IP Tag length.
-
RS_SOMEIP_WIRE_TYPE_BIT_SHIFT
SOME/IP Wire Type byte length.
-
RS_SOMEIP_GET_TAG(x, y)
SOME/IP get tag value.
-
RS_SOMEIP_UNION_UINT8_TYPE_SELECTOR
SOME/IP Union unit8 data type selector field.
-
RS_SOMEIP_UNION_UINT16_TYPE_SELECTOR
SOME/IP Union unit16 data type selector field.
-
RS_SOMEIP_UNION_UINT32_TYPE_SELECTOR
SOME/IP Union unit32 data type selector field.
Functions
-
rs_ret_val_t rs_someip_transformer_get_version_info(uint8_t *ptr_maj_ver, uint8_t *ptr_min_ver, uint8_t *ptr_build_ver)
Function to get the version information of SOME/IP Transformer module.
This function called to get the version information of SOME/IP Transformer module
- Parameters:
ptr_maj_ver – [out] - Pointer to the major version
ptr_min_ver – [out] - Pointer to the minor version
ptr_build_ver – [out] - Pointer to the build version
- Returns:
0 for success.
-
rs_ret_val_t rs_some_get_serialize_event_data(rs_someip_event_data_info_t *ptr_event, uint8_t *ptr_out_payload_data)
Called the function to get the serialization fixed data type event data.
This function called to get the serialization fixed data type event data.
- Parameters:
ptr_event – [in] - Pointer to the event data. information.
ptr_out_payload_data – [out] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_pack_struct_data(void *ptr_in_data, uint8_t *ptr_out_payload_data, uint16_t u16_tag_num, uint32_t u32_data_len)
Called the function to construct the payload data based on the given tag number from the given pointer data and length.
This function called to construct the payload data based on the given tag number from the given pointer data and length.
- Parameters:
ptr_in_data – [in] - Pointer to the data.
ptr_out_payload_data – [out] - Pointer to the payload data.
u16_tag_num – [in] - Tag ID number.
u32_data_len – [in] - Data length.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_pack_union_data(uint32_t u32_val, uint8_t u8_data_type, uint8_t *ptr_payload)
Called the function to pack the union data.
This function called to construct the pack the union data.
- Parameters:
u32_val – [in] - Union data value.
u8_data_type – [in] - Union Data type.
ptr_payload – [out] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_set_deserialize_event_data(rs_someip_event_data_info_t *ptr_event, uint8_t *ptr_in_payload_data)
Called the function to set the deserialization payload data into event data.
This function called to set the deserialization payload data into event data.
- Parameters:
ptr_event – [out] - Pointer to the event data. information.
ptr_in_payload_data – [in] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_unpack_struct_data(void *ptr_out_data, uint8_t *ptr_in_payload_data, uint8_t u8_wire_type, uint32_t u32_data_len)
Called the function to unpack the structure data with corresponding wire type.
This function called to to unpack the structure data with corresponding wire type.
- Parameters:
ptr_out_data – [out] - Pointer to the data.
ptr_in_payload_data – [in] - Pointer to the payload data.
u8_wire_type – [in] - Tag ID number.
u32_data_len – [in] - Data length.
- Returns:
Return length of the payload data in bytes or 0 for failure.
-
rs_ret_val_t rs_some_unpack_union_data(uint32_t *ptr_u32_val, uint8_t *ptr_data_type, uint8_t *ptr_payload)
Called the function to unpack the union data.
This function called to construct the unpack the union data.
- Parameters:
ptr_u32_val – [out] - Pointer to the union data value.
ptr_data_type – [out] - Pointer to the union data type.
ptr_payload – [in] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes or 0 for failure.