我正在构建一个无线节点,它目前看起来像这样
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
的子模块
通过更改 IRadio
和 IMacProtocol
组合 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/