Skip to main content

A664InitMessage

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

long A664InitMessage (a664Message aMessage, dword srcIP, dword dstIP, word srcUDP, word dstUDP, word VLid, word payloadSize)

Description

The complete Ethernet, IP- and UDP headers for an AFDX message are consistently set based on the given parameters. The payload area is initialized with 0.

Parameters

  • aMessage: The message object to be initialized.
  • srcIP: Source IP address to be used for the Eth and IP headers.
  • dstIP: Destination IP address to be used for the IP headers.
  • srcUDP: Source UDP port for the UDP header.
  • dstUDP: Destination UDP port for the UDP header.
  • VLid: VLId to be used for the destination Eth header (see selector EthVlId).
  • payloadSize: Size of the message payload after UDP header without counting the sequence number.

Return Values

  • 0: Initialization failed.
  • 1: Initialization successful.

Example

// On prestart
A664Message * myAfdxMsg2;
A664InitMessage (myAfdxMsg2,  // a664Message to be initialized
    IpGetAddressAsNumber ("10.10.2.1"), // source IP - IpAdrSrc
    IpGetAddressAsNumber ("10.10.5.2"), // destination IP - IpAdrDst
    0x2300, // source UDP - UdpSrcPort
    0x2301, // destination UDP - UdpDstPort
    0x1111, // AfdxVlId
    800);  // UdpLength / AFDX-payload size

myAfdxMsg2.msgChannel = 2;