Skip to main content

AfdxOutputPacketRaw

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE Note
This function was renamed from AfdxOutputRawPacket in your CANoe DE product version 8.1.

Function Syntax

long AfdxOutputPacketRaw(long packet);

Description

The specified AFDX message is transmitted without considering the internal AFDX software stack.
This call is equivalent to AfdxOutputPacket( packet, SingleShot, NoIPFragmentation, NoAFDXVLScheduling, NoAFDXSeqNoManagement, MACIFRelated ).

Parameters

  • packet: handle of the message to send that has been created with AfdxInitPacket.

Return Values

Example

includes
{
  #include "AFDX/Utils.cin"
}

Node System - preStart in CAPL Browser

on preStart
{
  long result;
  result = AfdxRegisterReceiveCallback("OnAfdxRawPacket", BothDirections, NotDropped, EveryFrameAndPacket);
}

Node Callback Function in CAPL Browser

void OnAfdxRawPacket(long dir, long line, int64 timestamp, long bag, long afdxFlags, long packet)
{
  long packetHandle;

  if (afdxFlags & packetIsReassembled)
  {
    write("<%NODE_NAME%> OnAfdxRawPacket  packet is JumboPacket --> skip");
    return; // don't transfer Jumbo-frames
  }

  if (getBusContext() == gContextAfdx1)
  {
    setBusContext(gContextAfdx2);
  }
  else
  {
    setBusContext(gContextAfdx1);
  }

  packetHandle = AfdxInitPacket(packet);
  if (packetHandle == 0) {
    write("<%NODE_NAME%> AfdxInitPacket failed");
    return;
  }

  // modify signals only if not a fragment
  if (!(packetIsFragmented & afdxFlags))
  {
    // TBD
  }
  else
  {
    // must use direct byte access to manipulate
  }

  AfdxOutputPacketRaw(packetHandle);
  AfdxReleasePacket(packetHandle);
}