我正在尝试通过连接到路由器的TSN交换机从omnet++ TSN设备发送UDP数据包到标准主机。然而,我得到以下check_and_cast错误:-
check_and_cast(): Cannot cast(inet::physicallayer::signal*)app[0]-0 to type 'inet::physicallayer::EthernetSignalBase *' in module (inet::EthernetMac) of router.eth[0].mac
我的omnetpp.ini udp应用程序设置如下。
extends = omnetpptsnnetworksample
#Source application
*.tsnDevice1.numApps = 1
*.tsnDevice1.app[0].typename = "UdpSourceApp"
*.tsnDevice1.app[0].source.packetLength = 10B
*.tsnDevice1.app[0].source.productionInterval = 1ms
*.tsnDevice1.app[0].io.destAddress = "ue[0]"
*.tsnDevice1.app[0].io.destPort = 1000
*.tsnDevice1.app[0].source.clockModule = "^.^.clock"
#Sink application
*.standardHost[*].numApps = 1
*.standardHost[*].app[*].typename = "UdpSinkApp"
*.standardHost[*].app[*].io.localPort = 1000
我哪里做错了?
TsnDevice
和TsnSwitch
默认有LayeredEthernetInterface
,StandardHost
默认有EthernetInterface
。这两个接口不兼容(不确定它们是否应该兼容)。因此,通过将standardHost的以太网接口类型设置为LayeredEthernetInterface
,它应该工作:
*.standardHost[*].eth[*].typename = "LayeredEthernetInterface"