使用INET构建节点getContainingNicModule():找不到nic模块

问题描述 投票:3回答:1

我正在构建一个无线节点,它目前看起来像这样

 module Node extends NodeBase
 {
    parameters:
        mobility.typename = default("StationaryMobility");
        Physical.antenna.mobilityModule = default("^.^.mobility");
        @display("bgl=8;bgb=230.31801,357.28");
        *.interfaceTableModule = default(absPath(".interfaceTable"));
    gates:
        input radioIn @directIn;
    submodules:
        //Don't know what this does but need interfaceTableModule to be defined
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=125,240;is=s");
        }
        Physical: Ieee802154UwbIrRadio{
            @display("p=41,74");
        }
        Link: <default("Ieee802154Mac")> like IMacProtocol {
            @display("p=41,169");
        }
        Net: BroadcastRouting {
            @display("p=41,248");
        }
    connections allowunconnected:
        radioIn --> Physical.radioIn;
        Physical.upperLayerOut --> Link.lowerLayerIn;
        Physical.upperLayerIn <-- Link.lowerLayerOut;
        Link.upperLayerOut --> Net.fromMac;
        Link.upperLayerIn <-- Net.toMac;
}

模拟器尝试加载LinkLayer时会产生运行时错误。

运行时错误:getContainingNicModule(): nic module not found (it should have a property named nic) for module 'network.componenet1.Link' ... during network initialisation

我认为getContainingNicModule尝试做的功能是寻找一个网络接口卡模块,它是链路层的父级。我搜索了nic属性,找不到任何东西。它可能与interface财产有关,但我反映的inet.LinkLayerNodeBase没有这样的财产。

为什么会出现此错误?

omnet++ inet
1个回答
0
投票

任何like IMacProtocol模块都必须是IWirelessInterface的子模块

通过将IRadioIMacProtocol实现更改为IWirelessInterface中组合的Ieee802154UwbIrInterface实现,它不再给我nic module not found error.

抛出错误的函数是findContainingNicModule。它查找是否可以将父模块转换为InterfaceEntry类型。如果它失败则会使错误与nic属性有关,但是没有模块具有该属性。

自从inet 3.6.4(我认为)Nic types have been replaced with Interface types。尽管如此,很多其他对Nics的引用都没有改变。因此错误无法准确反映问题。

工作模块现在:

module Node extends NodeBase
{

    parameters:
        mobility.typename = default("StationaryMobility");
        wlan.radio.antenna.mobilityModule = default("^.^.^.mobility");
        @display("bgl=8;bgb=230.31801,357.28");
    gates:
        input radioIn @directIn;
    submodules:
        //Don't know what this does but need interfaceTableModule to be defined
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=125,240;is=s");
        }
        wlan: <default("Ieee802154UwbIrInterface")> like IWirelessInterface{
            parameters:
                @display("p=41,248,row,150;q=queue");
        }
        Net: BroadcastRouting {
            @display("p=41,148");
        }
    connections allowunconnected:
        radioIn --> wlan.radioIn;
        wlan.upperLayerOut --> Net.fromMac;
        wlan.upperLayerIn <-- Net.toMac;
}
© www.soinside.com 2019 - 2024. All rights reserved.