Skip to main content

<OnC2xTransmitPacket> (Callback)

Valid for: CANoe DE Note
This callback must be implemented in the CAPL program by the user to use the function C2xRegisterCallback for Pre Transmit Indications.

Function Syntax

void <OnC2xTransmitPacket>(long packet); // form 1
long <OnC2xTransmitPacket>(long packet); // form 2

Description

This callback is invoked before a database defined packet is transmitted (by this network node). Within this callback the Token functions from the Packet API and all Signal functions from the Car2x IL API can be used. Modifications are persistent between invocations of the callback. When using the form 2 of the callback it is possible to skip the current transmission by returning a 0.

Parameters

  • packet: Handle of the packet

Return Values

Form 1
  • 0: don’t transmit the message
  • 1: transmit the message

Example

on start
{
  C2xRegisterCallback(1, "OnTxBSM", "BasicSafetyMessage");
}
void OnTxBSM(LONG packet)
{
// do something here
}