Skip to main content
Open topic with navigation CAPL Functions » Ethernet » Function Overview » ethernetPacket::GetProtocolErrorText

ethernetPacket::GetProtocolErrorText

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

  • word ethernetPacket.GetProtocolErrorText( char buffer[] ); // form 1
  • word ethernetPacket.GetProtocolErrorText( dword format, char buffer[] ); // form 2

Description

Copies an error text to the buffer for invalid Ethernet packets. For valid Ethernet packets, an empty string is returned. If format is specified, you can obtain corresponding information, e.g. Error [IPv4-005]: Checksum is not correct.

Parameters

  • buffer
    Char buffer where the error string is copied to.
  • format
    • 0: only error text (same as form 1)
    • 1: error text, severity and error number
    • 2: error number only

Return Values

Number of characters copied to buffer.

Example

on ethernetPacket *
{
  if (this.HasProtocolError())
  {
    char text[100];
    this.GetProtocolErrorText( text );
    // this.GetProtocolErrorText(1, text); // more information
    write( "Protocol error on Eth %d: %s", this.msgChannel, text );
  }
}