首页 > 解决方案 > 运行模拟时复合模块中的 Ned 语法错误。意外之门

问题描述

这是实现网络层的基本模型 - 表现得像一个交换机。

我在第 37 行遇到错误。控制台打印Ned Syntax Error OMNeT++ IDE 告诉我:syntax error, unexpected GATES, expecting '}' - NED Syntax Problem

我不明白为什么我会收到此错误,也不知道如何修复它。

import inet.linklayer.ieee802154.Ieee802154Mac;
import inet.physicallayer.ieee802154.bitlevel.Ieee802154UwbIrRadio;


// Module to hold application down to Mac layers.
module Node
{
    submodules:
        Communication: Ieee802154UwbIrRadio;
        Link: Ieee802154Mac;
        Net: BroadcastRouting;
    connections:
        radioIn --> Communicataion.radioIn;
        Communication.upperLayerOut --> Link.lowerLayerIn;
        Communication.upperLayerIn <-- Link.lowerLayerOut;
        Link.upperLayerOut --> Net.fromMac;
        Link.upperLayerIn <-- Net.toMac;
    gates: //Error on this line
        input radioIn;
}

//Module to provide coarse routing
simple BroadcastRouting
{
    gates:
        input fromMac;
        output toMac;
}

如果相关,则此模块包含在具有 3 个它的实例和 1 个 radiomedium 实例的网络中。

标签: omnet++inet

解决方案


移动这两行

gates: //Error on this line
    input radioIn;

之前submodules:


推荐阅读