ethernetPacket::SetVlanId
Valid for: CANoe DE • CANoe4SW DEMethod Syntax
long ethernetPacket.SetVlanId(word vlanId); // form 1long ethernetPacket.SetVlanId(dword vlanIndex, word vlanId); // form 2
Description
Sets the VLAN ID of an Ethernet packet. If the packets do not contain a VLAN tag, a new VLAN tag is added. For double-tagged VLAN, form 2 can be used.Parameters
-
vlanId: The VLAN ID to set.
Range: 0..0FFFh -
vlanIndex: Index of the VLAN tag for double-tagged VLANs. Index 0 is the inner VLAN, index 1 the outer VLAN.
Range: 0..2
Return Values
- 0: Success
- 1: Failed to add VLAN tag
- 2: VLAN ID out of range