omnet++ - 使用 INET getContainingNicModule() : nic module not found 构建节点

标签 omnet++ inet

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

 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正在尝试做的是寻找作为链路层父级的网络接口(interface)卡模块。
我搜索了 nic属性(property),找不到任何东西。可能与interface有关属性(property),但 inet.LinkLayerNodeBase我正在镜像的没有这样的属性。

为什么会出现此错误?

最佳答案

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 .许多其他对 Nic 的引用s 没有改变。所以错误并不能准确地反射(reflect)问题。

现在的工作模块:

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;
}

关于omnet++ - 使用 INET getContainingNicModule() : nic module not found 构建节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54597785/

相关文章:

c++ - 如何将我的自定义模块与 Omnet++INET 的简单模块结合起来

linux - Ubuntu inet addr 不断变化

c++ - 消息的预定义路由接受 OMNeT++

c++ - OMNeT++ 反汇编收到的消息

c++ - OMNeT++中不同类型数据包之间的冲突

c++ - omn​​et 中对 ISO c++ 2011 标准的库支持

c++ - 从节点向其邻居发送消息

c++ - OMNET++ 如何保留 AODVRouting 类中的所有功能,但只覆盖 sendAODVPacket 功能?

c++ - OMNET++: .gdbinit: 没有这样的文件或目录?

c++ - 获取其他模块访问变量的路径