2
votes

I'm not able to import channel types from one .ned file to another in OMNet++.

I have A.ned where I define a channel called Ether.

channel Ether extends ned.DatarateChannel
    {
        datarate = 10bps;
        delay = 10ms;
        ber = 1e-10;
    }

I want to then use that channel in B.ned without having to repeat the definition. I've tried:

import A;

module B extends A
{
    ...  
}

Both files are in the same package. A.ned contains a network and not a compound module but I tried making it a module and adding the @isNetwork tag and that did not work. The error is "Cannot resolve channel type Ether" when I use it as such:

router.port[i] <--> Ether <--> switch[i].port[0];

I feel like this should be easy but I haven't been able to find much help online or in the Simulation Manual. Any help is greatly appreciated!

1
Maybe you could help us by providing the whole ned files? For example with included package definition? - Ventu
I can but my question is more general. I'm basically just asking how to import channel types so that I don't have to keep creating the same channels in every module that I make. I just tried to provide an example. - Triton

1 Answers

0
votes

You need to link the project that includes the A.ned to the project that includes B.ned using the project references.