_DoIP_UDPPreSend
Valid for: CANoe DE NoteThe following DoIP CAPL function is only available with the modeling library DoIP.dll and eventually an appropriate implementation of the CAPL Callback Interface. Information about the DoIP DLL and the CAPL Callback Interface you find here:
Function Syntax
Description
The DoIP implementation is about to send an UDP DoIP packet with the given content. It is possible to change the values in header and data, and to change the total length of the UDP packet. NoteNote that packets sent by DoIP_UDPSend are NOT indicated here since it is possible to provide any data using these calls anyway.
Parameters
- DoIPVersion: Protocol version value to send, defaults to configured value.
- inverseVersion: Inverse protocol version value to send.
- payloadType: Type of the PDU sent. The value is converted from and to network byte order automatically.
- payloadLen: Length of the payload as indicated in the header. The value is converted from and to network byte order automatically.
- payload: Payload itself. Elcount(payload) indicates the maximum number of bytes that can be accessed in the callback which might be longer than payloadLen, i.e. more bytes might be available than used for DoIP.
Return Values
- -1: Drop this UDP packet, i.e. it is NOT sent. This may cause errors in the protocol state machine.
- 0: The total length of the UDP packet is computed from the payload length value.
- > 0: Send a UDP packet with this length. For example, values < 8 will cut the DoIP header, i.e. the announced payload is not actually sent.
- Others: Reserved