Skip to main content

AfdxGetPacketData

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

Description

This function copies the packet content (including protocol header and payload) to a local buffer.

Parameters

  • packet: Handle of the message that has been created with AfdxInitPacket or from within a callback.
  • offset: This is the offset from the beginning of the Ethernet packet. If this is 0, data is copied starting at byte 0 frame (destination MAC address).
  • length: This is the number of bytes to be copied from Ethernet packet to the specified buffer.
  • buffer: Buffer in which the requested data are copied. Make sure that the size of the buffer is at least length bytes.

Return Values

  • Number of copied data bytes.
  • With AfdxGetLastError you can check if the function has been processed successfully.

Example