3

I am building a wireless node and it currently looks like this

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

The runtime error is produced when the simulator tries to load the LinkLayer.

Runtime Error: getContainingNicModule(): nic module not found (it should have a property named nic) for module 'network.componenet1.Link' ... during network initialisation

What I believe the function getContainingNicModule is trying to do is look for a network interface card module that is a parent of the link layer. I have searched for the nic property and cannot find anything. It may be related to the interface property but the inet.LinkLayerNodeBase that I am mirroring off has no such property.

Why does it give this error?

EdL
  • 367
  • 4
  • 12

1 Answers1

0

Any module that is like IMacProtocol must be a submodule of a IWirelessInterface

By changing the IRadio and IMacProtocol implementations to the combined IWirelessInterface implementation in Ieee802154UwbIrInterface it no longer gave me the nic module not found error.

The function that threw the error is findContainingNicModule. It looks for if it can to a cast of a parent module to the InterfaceEntry type. If it fails then it thows the error to do with the nic property however no module has that property any longer.

Since inet 3.6.4 (I think) Nic types have been replaced with Interface types. A lot of the other references to Nics were not changed though. So the error doesn't accurately reflect the problem.

The working module now:

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;
}
EdL
  • 367
  • 4
  • 12