我正在构建一个无线节点,目前看起来像这样
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
没有这样的属性。
为什么会出现此错误?
答案 0 :(得分:0)
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
的许多其他引用并未更改。因此,该错误无法准确反映问题。
当前工作模块:
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;
}