Skip to main content
Open topic with navigation CAPL Functions » Ethernet » Function Overview » ethernetPacket::SetData

ethernetPacket::SetData

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

  • word ethernetPacket.SetData(word offset, char source[], word length); // form 1
  • word ethernetPacket.SetData(word offset, byte source[], word length); // form 2
  • word ethernetPacket.SetData(word offset, struct * source); // form 3
  • word ethernetPacket.SetData(word offset, sysvarStruct source); // form 4
  • word ethernetPacket.SetData(char protocol[], char field[], char data[], word length); // form 5
  • word ethernetPacket.SetData(char protocol[], char field[], byte data[], word length); // form 6

Description

Copies bytes from a char array, byte array, CAPL struct or system variable struct to the data of an Ethernet packet.

Parameters

  • offset: Byte offset of the data in the ethernetPacket. Offset 0 is the byte directly after the Ethertype.
  • source: Source where the data is copied from.
  • length: Number of bytes to copy.
  • protocol: Name of the protocol.
  • field: Name of the field.

Return Values

Number of bytes copied to the ethernetPacket.

Example

See Also