Hi,
looking at this code from FiCo4OMNeT [1], I understand that the
sourceApp submodule defaults to a CanTrafficSourceAppBase, so I suppose
that it may be possible to customize the CanNode module in order to put
a custom sourceApp, by writing a module which implementes the
ISourceApplication interface.
module CanNode
{
parameters:
[...]
int numSourceApps = default(1);
[...]
submodules:
[...]
sourceApp[numSourceApps]: <default("CanTrafficSourceAppBase")>
like ISourceApplication {
@display("p=98,32,row,70");
}
[...]
}
Is my understanding right?
But, reading Omnet++ documentation, it is unclear to me how I can
override the sourceApp submodule, in order to replace with mine.
I tried several options, and in the end I came up with this:
network MyNetwork
{
submodules:
bus: CanBus {
gates:
gate[1];
}
myNode : CanNode {
gates:
gate;
submodules:
sourceApp : mySourceApp;
}
connections:
bus.gate[0] <--> myNode.gate;
}
But it doesn't work and just tells me an unuseful "syntax error" at
submodule: line.
Also tried:
- with/without square brackets for array notation []
- writing a custom module which implements CanNode (but CanNode is not
an interface)
How am I supposed to override the sourceApp with my custom one?
Is there any example hidden in Omnet++ docs that I am unable to find?
Thanks for your help.
[1]
https://github.com/CoRE-RG/FiCo4OMNeT
--
Giovan Battista