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

ethernetPacket::GetInt

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

int ethernetPacket.GetInt(char protocol[], char field[])

Description

Returns the value of the specified field as int. If protocol or field is not contained in the packet, the measurement is stopped with a runtime error. ethernetPacket::IsAvailable can be used to find out if the field is available.

Parameters

  • protocol: Name of the protocol.
  • field: Name of the field.

Return Values

Value of the field.

Example

on ethernetPacket *
{
  if(this.IsAvailable("icmpv4", "echo.identifier"))
  {
    Write("icmpv4.echo.identifier has value %d", this.GetInt("icmpv4", "echo.identifier"));
  }
}