vsomeip
vsomeip copied to clipboard
how to segment and reassemble message? any example?
under the situation of big payload, how to segment and reassemble message?
You will have to create your own serialization and deserialization functions for your payloads. SOME/IP is not a high-level protocol.
In the simplest case, you can recast a 4-byte payload to a 4-byte variable like an uint64_t. Anything more complex requires you to start incrementing pointer addresses based on the payload byte array traversal and extract out your data objects based on predefined byte-offsets from the start of the byte array.
configure the SOME/IP-TP feature
@feuillatte I have a question about ser/deser functions. can we use some tools like cap'n proto or protobuf at this stage?
@jafar75 I haven't personally worked with protobuf or cap'n proto but any serialization-deserialization library should work in principle. SOME/IP only sees the message payload as an array of bytes, and it's up to the user to deal with the serialization and deserialization. In automotive, one typically has some kind of message layout definitions in an Interface Definition Language (IDL) that is then used by a code-generator to produce the ser-des code to and from the byte-representations.
Dealing with packets beyond the single message limit (some 1400 bytes) requires SOME/IP-TP to be used to reassemble the total payload before deserializing it.