GetEthernetPacket
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
long GetEthernetPacket(this, ethernetPacket * packet);
Function
This function can only be called inside of anon PDUhandler. The function will return in its second parameter the Ethernet packet, the PDU was contained.
Parameters
this Handle to the currently handled (received) PDU object.
packet
Reference to anEthernet Packet objectthat will contain the overall received packet data and information.
Return Values
0: Data access successful.
-1: Wrong bus type; Ethernet packet is not available.
-2: Packet does not support this info.
-3: The PDU object is invalid.
-4: PDU is not of Rx type.
-5: Parameter too small (e.g. array has too less bytes)
-6: Packet or PDU is not available (any more)
Reference example from the CANoe 12 help. Check the required configuration, database objects and API availability in your installed version; this is not a recorded compiler or runtime test.
on PDU PDU_B
{
ethernetPacket * aPacket_01;
long result;
result = GetEthernetPacket(this, aPacket_01); // PDU is assumed to be sent on ETH
if (result == 0)
{
write("Received PDU 'PDU_B' in ETH packet with FCS %lu", aPacket_01.FCS);
}
else
{
write("Error accessing PDU!");
}
}
Related APIs
on PDU | GetFrFrame | GetCANMessage | GetPDUsTPIPv6SrcAddr | GetPDUsTPIPv6DstAddr | GetPDUsTPIPv4SrcAddr | GetPDUsTPIPv4DstAddr | GetPDUsTPUDPSrcPort | GetPDUsTPUDPDstPort | GetPDUsTPTCPSrcPort | GetPDUsTPTCPDstPort