Skip to main content
Open topic with navigation

ethernetPacket::CompletePacket

CAPL Functions » Ethernet » Function Overview » ethernetPacket::CompletePacket Valid for: CANoe DE • CANoe4SW DE

Method Syntax

word ethernetPacket.CompletePacket();

Description

Calculates the checksum and length field for all protocols contained in the packet. The protocols will be valid after calling this method and the packet can be sent.

Parameters

Return Values

  • 0: Success
  • -1: Error

Example

ethernetPacket pkt;

// initialize with IPv4 and UDP protocol
pkt.udp.Init();

// recalculate checksum and length fields of IPv4 and UDP
pkt.CompletePacket();

// send packet
output( pkt );