SomeIpCreateMessage
Valid for: CANoe DE • CANoe4SW DEFunction Syntax
dword SomeIpCreateMessage( dword messageId, dword requestId, dword protocolVersion, dword interfaceVersion, dword messageType, dword returnCode ); // form 1dword SomeIpCreateMessage( dword bufferLength, byte buffer[] ); // form 2dword SomeIpCreateMessage( dword bufferLength, byte buffer[], dword offset ); // form 3
Description
This function is used to create a SOME/IP message that can then be sent with SomeIpOutputMessage or SomeIpPostMessage. Form 1If a FIBEX database is assigned to the CANoe configuration, a check is made to determine whether the message ID (
messageId parameter) is contained in this database. If so, the payload is created according to the database description and initialized with 0. The length field in the SOME/IP message header is set automatically. If a corresponding message ID is not found in the database, only the SOME/IP message header is created. In this case, the payload must be created with SomeIpSetData. If no payload is available an empty payload must be specified in SomeIpSetData.
Form 2During creation, the message header length is taken from the data stream specified in the
buffer parameter. In so doing, incorrect length values are not corrected.
If the message is successfully accessed later with a SomeIpGetValue… or SomeIpSetValue… function, the length is adapted in the message, if necessary, if a FIBEX database is assigned to the CANoe configuration and the message ID is contained in the database.
The created message can be deleted again with SomeIpReleaseMessage.
Parameters
- messageId: The message identifier of the SOME/IP message.
- requestId: The request identifier of the SOME/IP message header.
- protocolVersion: The protocol version of the SOME/IP message header.
- interfaceVersion: The interface version of the SOME/IP message header.
- messageType: The message type of the SOME/IP message header.
- returnCode: The return code of the SOME/IP message header.
- bufferLength: Length of the buffer parameter in bytes.
- buffer: Buffer that contains the complete SOME/IP message as byte stream.
- offset: This parameter can be used to specify the start of a SOME/IP message in the byte stream. The specification is in bytes (see example code).
Return Values
- 0: An error occurred. The error can be evaluated using the SomeIpGetLastError function.
- >0: Handle of the created message