ethernetPacket::protocol::SetData
Valid for: CANoe DE • CANoe4SW DEMethod Syntax
word ethernetPacket.<protocol>.SetData( word offset, char[]data, word length ); // form 1word ethernetPacket.<protocol>.SetData( word offset, byte[]data, word length ); // form 2word ethernetPacket.<protocol>.SetData( word offset, struct * data); // form 3word ethernetPacket.<protocol>.SetData( word offset, sysvarStruct data); // form 4word ethernetPacket.<protocol>.SetData( char[]data, word length ); // form 5word ethernetPacket.<protocol>.SetData( byte[]data, word length ); // form 6word ethernetPacket.<protocol>.SetData( struct * data); form // 7word ethernetPacket.<protocol>.SetData( sysvarStruct data); form // 8
Description
Sets payload data of a protocol within an Ethernet packet. If<protocol> is not available in the packet, no data is set and 0 is returned.
For form 1-4 (with parameter offset):
If the data is greater than the length of the Ethernet packet, the Ethernet packet is enlarged. If data is smaller as the current length of the payload the length is not changed.
For form 5-8 (without parameter offset):
The length of the data is resized to the given length of the new data.
Parameters
- data: Buffer where the data is copied from.
- length: Number of bytes to copy to the protocol payload.
- offset: Byte offset in the payload where it starts to copy data.