Skip to main content

C2xIsPacketValid

Open topic with navigation CAPL Functions » Car2x » C2xIsPacketValid

Function Syntax

long C2xIsPacketValid( long packet );

Description

This function checks if a received packet has a protocol error. Packets with a protocol error are marked with an error icon in the Trace Window.

Parameters

  • packet: Handle of a packet that should be checked.

Return Values

  • 0: Packet is valid.
  • !0: Packet has protocol errors.

Example

Node System - PreStart in CAPL Browser
on preStart
{
  C2xReceivePacket( "OnC2xPacket");
}
Node Callback Function in CAPL Browser
void OnC2xPacket( long channel, long dir, long radioChannel, long signalStrength, long signalQuality, long packet )
{
  if (C2xIsPacketValid( packet ) != 0)
  {
    write( "Receive packet with protocol error" );
  }
}