Omnet++ 我想在基于Omnet的静脉中使用UDPBasicApp,但无法实现

Omnet++ 我想在基于Omnet的静脉中使用UDPBasicApp,但无法实现,omnet++,inet,Omnet++,Inet,我想在Velse中实现UDPBASICBurst应用程序,但我面临着一些问题。我已经做了如下工作,但我不知道我是否正确。有人能解释这件事吗 import inet.applications.udpapp.UDPBasicBurst; import org.car2x.veins.base.modules.*; import org.car2x.veins.modules.nic.Nic80211p; udpBasicBurst:udpBasicBurst{ @显示(“p=130,56”);

我想在Velse中实现
UDPBASICBurst
应用程序,但我面临着一些问题。我已经做了如下工作,但我不知道我是否正确。有人能解释这件事吗

import inet.applications.udpapp.UDPBasicBurst;
import org.car2x.veins.base.modules.*;
import org.car2x.veins.modules.nic.Nic80211p;

udpBasicBurst:udpBasicBurst{
@显示(“p=130,56”);
}`在这里输入代码`
允许未连接的连接:
nic.upperLayerOut-->appl.LOWERLLAYERIN;
nic.upperLayerIn appl.lowercontrollin;
nic.upperControlIn-nic.radio;
udpBasicBurst.udpOut-->nic.upperControlIn;
udpBasicBurst.udpIn appl.lowerLayerIn;
nic.upperLayerIn appl.lowercontrollin;
nic.upperControlIn-nic.radio;
udpBasicBurst.udpOut-->nic.upperControlIn;

udpBasicBurst.udpIn您正在同一模块中导入
inet.applications.udpapp.udpBasicBurst
org.car2x.venves.modules.nic.Nic80211p
。这可能不会像您希望的那样起作用:

简单地说,
inet.*
名称空间中的模块只希望与此名称空间中的其他模块交换消息。在Veners 4a2之前(包括Veners 4a2),org.car2x.Veners.*
名称空间中的模块也是如此,但有一个显著的例外:Veners 4a2
TracisCanarioManager
将检查实例化模块是否使用inet 2.3.0
TraCIMobility
模块作为其移动性子模块。如果它这样做,它将相应地移动模块


这允许您在INET 2.3.0主机中使用Vevels 4a2 mobility。

您正在同一模块中导入
INET.applications.udpapp.UDPBasicBurst
org.car2x.Vevels.modules.nic.Nic80211p
。这可能不会像您希望的那样起作用:

简单地说,
inet.*
名称空间中的模块只希望与此名称空间中的其他模块交换消息。在Veners 4a2之前(包括Veners 4a2),org.car2x.Veners.*名称空间中的模块也是如此,但有一个显著的例外:Veners 4a2
TracisCanarioManager
将检查实例化模块是否使用inet 2.3.0
TraCIMobility
模块作为其移动性子模块。如果它这样做,它将相应地移动模块


这允许您在INET 2.3.0主机中使用Velse4A2移动性。

亲爱的Christoph;我在INET 2.3.0主机上重新安装了Veners 4a2 mobility,并分别安装了SUMO和Omnet4.6版本。我使用的UDP和网络层模块现在位于应用程序和nic模块之间。它运行了一段时间,但当它尝试发送UDP消息时,出现了一个错误:模块(UDP)EScenario.node[0]中出错。事件#369,t=35.704289728099时UDP(id=9):check_and_cast():无法将空指针转换为类型“UDPSendCommand*”。如何解决这个问题……亲爱的克里斯托夫;我在INET 2.3.0主机上重新安装了Veners 4a2 mobility,并分别安装了SUMO和Omnet4.6版本。我使用的UDP和网络层模块现在位于应用程序和nic模块之间。它运行了一段时间,但当它尝试发送UDP消息时,出现了一个错误:模块(UDP)EScenario.node[0]中出错。事件#369,t=35.704289728099时UDP(id=9):check_and_cast():无法将空指针转换为类型“UDPSendCommand*”。如何解决这个问题。。。
    udpBasicBurst: UDPBasicBurst {
        @display("p=130,56");
    }`enter code here`
connections allowunconnected:
    nic.upperLayerOut --> appl.lowerLayerIn;
    nic.upperLayerIn <-- appl.lowerLayerOut;
    nic.upperControlOut --> appl.lowerControlIn;
    nic.upperControlIn <-- appl.lowerControlOut;

    veinsradioIn --> nic.radioIn;


    udpBasicBurst.udpOut --> nic.upperControlIn;
    udpBasicBurst.udpIn <-- nic.upperControlOut;
}

import inet.applications.udpapp.UDPBasicBurst;
import org.car2x.veins.base.modules.*;
import org.car2x.veins.modules.nic.Nic80211p;

module Car
{
    parameters:
        string applType; //type of the application layer
        string nicType = default("Nic80211p"); // type of network interface card
        string veinsmobilityType; //type of the mobility module
    gates:
    input veinsradioIn; // gate for sendDirect
submodules:
    appl: <applType> like org.car2x.veins.base.modules.IBaseApplLayer {
        parameters:
            @display("p=60,50");
    }

    nic: <nicType> like org.car2x.veins.modules.nic.INic80211p {
        parameters:
            @display("p=60,166");
    }

    veinsmobility: <veinsmobilityType> like org.car2x.veins.base.modules.IMobility {
        parameters:
            @display("p=130,172;i=block/cogwheel");
    }

    udpBasicBurst: UDPBasicBurst {
        @display("p=130,56");
    }
connections allowunconnected:
    nic.upperLayerOut --> appl.lowerLayerIn;
    nic.upperLayerIn <-- appl.lowerLayerOut;
    nic.upperControlOut --> appl.lowerControlIn;
    nic.upperControlIn <-- appl.lowerControlOut;

    veinsradioIn --> nic.radioIn;


    udpBasicBurst.udpOut --> nic.upperControlIn;
    udpBasicBurst.udpIn <-- nic.upperControlOut;
}