Skip to main content

DoIP_ForceLocalUDPSendPort

Valid for: CANoe DE Note
The 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

long DoIP_ForceLocalUDPSendPort(dword forcedPort);

Description

According to ISO 13400, the local send port for UDP messages should be dynamically selected. This function allows forcing the local UDP send port to a specific value, typically to 13400 to indicate DoIP. Note that specifying a “well-known” or system port (1..1023) might not work on most systems.

Parameters

  • forcedPort
    • 0: use a dynamically assigned value (default)
    • 1..65535: bind to this local UDP port
    • other: reserved.

Return Values

Error code

Example

On preStart
{
  // Make sure that in an ECU simulation all UDP packets are sent from the standard port
  DoIP_ForceLocalUDPSendPort(13400);
}
DoIP_ForceLocalTCPSendPortDoIP_SetLocalIPaddress