Skip to main content

C2xGetLastErrorText

Valid for: CANoe DE

Function Syntax

long C2xGetLastErrorText( dword bufferSize, char[] buffer );

Description

Gets the error code description of the last called C2x… function.

Parameters

  • bufferSize: Size of buffer in which the description text is copied
  • buffer: Buffer in which the description text is copied

Return Values

Number of copied bytes.

Example

char error[100];
long value;
long packetHandle;

value = C2xGetTokenInt( packetHandle, "eth", "type" );
if (C2xGetLastError() == 0)
{
  write("Ethernet Type is 0x%x", value );
}
else
{
  C2xGetLastErrorText( elCount(error), error );
  write("Error: %s", error );
}
See Also