How Can I Change the VLAN Id and IP Address at Run Time?
The VLAN Id and IP Address might be adapted before an Ethernet frame is sent if all possible VLAN Ids have been previously configured in the IP Stack like for instance:
In this case it is possible at run time to change for each of the configured VLAN the IP Address using the CAPL function IpAddAdapterAddress.
To identify the ifIndex corresponding to the each VLAN out of the CANoe Configuration, use the IpGetAdapterDescription CAPL function that will deliver for each adapter a description containing the VLAN ID:
For exact syntax description of CAPL function, please consult CANoe Online Help (Key”F1")
With RTP the VLAN ID might be changed like indicated above.
If you use the AVB_IL for AVTP, the Talker/Listener connection directly takes place on the MAC layer and not on the IP layer. Therefore the following CAPL function shall be used to adapt the VLAN ID of each concerned Talker/Listener:
AvbSetProperty(talkerOrListenerHandle, „VlanId“, Integer)
Example: AvbSetProperty(talkerOrListenerHandle, „VlanId“, 3)
With RTP the VLAN ID might be from CANoe 10.0 on changed like indicated above.