vsomeip icon indicating copy to clipboard operation
vsomeip copied to clipboard

how to segment and reassemble message? any example?

Open UItogether opened this issue 3 years ago • 1 comments
trafficstars

under the situation of big payload, how to segment and reassemble message?

UItogether avatar Jul 23 '22 08:07 UItogether

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.

feuillatte avatar Aug 19 '22 09:08 feuillatte

configure the SOME/IP-TP feature

ims0 avatar Nov 24 '22 08:11 ims0

@feuillatte I have a question about ser/deser functions. can we use some tools like cap'n proto or protobuf at this stage?

jafar75 avatar Sep 24 '23 15:09 jafar75

@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.

feuillatte avatar Sep 26 '23 18:09 feuillatte