How to Manipulate Some/IP Message ID, Interface Version and Message Type?
The combination of all three header information allows CANoe for an explicit payload interpretation, according to the database definition (e.g. AUTOSAR XML, FIBEX). If one of them has been changed to a combination that is not defined within the database, no payload interpretation is possible.
Therefore the 1st prototype of the CAPL function SomeIpCreateMessage will return an error message for all combinations that are not defined in the database.
However for robustness test purpose it might be legitimate to falsify the SOME/IP message header. In this case it is necessary to work with the raw content of the SOME/IP message object using the 2nd or the 3rd prototype form:
- Create a raw copy of the SOME/IP message you want to manipulate by serializing its content into a byte buffer using SomeIpSerializeMessage.
- Falsify the content as you wish (for instance modifying the 10th byte in the buffer will modify the Interface Version)
- Create a new message using the manipulated buffer content and the 2nd or 3rd prototype form of SomeIpCreateMessage.
- Use the returned SOME/IP message handle from the previous step to finally send the manipulated message with SomeIpOutputMessage.