Skip to main content
Open topic with navigation

ethernetPacket::protocol::IsAvailable

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

Method Syntax

long ethernetPacket.<protocol>.IsAvailable();

Description

Checks if a protocol or protocol field is contained in the Ethernet packet.

Parameters

Return Values

  • 1: Ethernet packet contains the protocol
  • 0: Ethernet packet does not contain the protocol

Example

on ethernetPacket *
{
  if (this.udp.IsAvailable())
  {
    write("Packet has UDP protocol with port %d to %d!", this.udp.source, this.udp.destination);
  }
}