在接口表模块的路径上找不到模块

时间:2020-01-08 10:21:13

标签: c++ omnet++ inet

我遇到以下错误

在由参数'GPSSim.satellite [0] .wlan [0] .interfaceTableModule'定义的路径'GPSSim.satellite [0] .interfaceTable'上找不到模块–在模块(inet :: InterfaceEntry)GPSSim.satellite [ 0] .wlan [0](id = 51),在网络初始化期间

有很多代码,但我将展示我认为很重要的代码。如果需要更多代码,请告诉我,谢谢!

GPSSIM.ned 该文件是网络文件

network GPSSim
{
    parameters:

        int numOfSats; // Number of satellites

    submodules:

        satellite[numOfSats]: GPSSatellite {
            parameters:
                @display("p=505.835,100.085;r=10,,#707070;i=device/satellite_l");
        }

}

GPSSatellite.ned

module GPSSatellite extends StandardSatellite
{
    submodules:

        gpsApp[numGpsApps]: <default("GPSApp")> like IGPSApp {  //default("UdpApp")
            parameters:
                @display("p=100,284,row,60");
        }
}

StandardSatellite.ned

module StandardSatellite extends Satellite
{
    parameters:
        @node; //because of MobilityBase initialization'
        @networkNode();
        int numRadios = default(1); 
        **.interfaceTableModule = default(absPath(".interfaceTable"));
        //wlan[*].mgmt.typename = default("Ieee80211MgmtAp");
        //wlan[*].interfaceTableModule = default(absPath(".interfaceEntry"));
        //wlan[*].mgmtType = default("Ieee80211MgmtAdhoc");  // use adhoc management

    submodules:

        interfaceTable: InterfaceTable {
            parameters:
                @display("p=407,69");
        }

        routingTable: Ipv4RoutingTable {
            parameters:
                @display("p=45,178");
                //IPForward = IPForward;
                //forwardMulticast = forwardMulticast;
                routingFile = routingFile;
        }
        wlan[numRadios]: <default("Ieee80211Interface")> like IWirelessInterface {
            parameters:
                @display("p=301.35,379.05;q=queue");
        }

        ext[numExtInterfaces]: <default("ExtInterface")> like IExternalInterface {
            parameters:
                @display("p=217,421,row,10;q=txQueue;i=block/ifcard");
        }

        networkLayer: NetworkLayerNodeBase {
            parameters:
                @display("p=226.8,198.45;q=queue");
        }
        lo0: LoopbackInterface {
            @display("p=78,406");
        }
        App: <default("UdpBasicBurst")> like IApp {
            @display("p=469.35,198.45");
        }
    connections allowunconnected:

        wlan[0].upperLayerOut --> networkLayer.radioIn[0];
        //ext[0].upperLayerOut --> networkLayer.radioIn[0];
        //lo0.upperLayerOut --> networkLayer.radioIn[0];

}

当我将接口表模块放在顶级网络(GPSSim)中时,我没有收到此错误,但是在接口已被注册的情况下却收到了另一个错误,原因恰恰是因为我这样做了,因为我告诉卫星的每个实例使用相同的接口表。

我不知道从这里去哪里。任何帮助将不胜感激!预先感谢。

1 个答案:

答案 0 :(得分:0)

尝试更改行

**.interfaceTableModule = default(absPath(".interfaceTable"));

进入:

interfaceTableModule = default("interfaceTable");

参数interfaceTableModule应该指向该节点中的接口表。