I would like to know why I can build this project, but as soon as RSU receives the message I get an error 139. Even if I try to solve by removing the code inserted in onData function and run the project again, still doesn't work.
TraCIDemoRSU11p.h
TraCIScenarioManager* manager;
TraCICommandInterface* traci;
TraCIDemoRSU11p.cc
void TraCIDemoRSU11p::initialize(int stage)
{
BaseWaveApplLayer::initialize(stage);
if (stage == 0) {
manager = TraCIScenarioManagerAccess().get();
traci = manager->getCommandInterface();
traci->trafficlight("0").setProgram("tram_is_not_passing");
}
}
void TraCIDemoRSU11p::onData(WaveShortMessage* wsm)
{
traci->trafficlight("0").setProgram("tram_is_passing");
}
veins version is 4.4 and omnet++ version is 5. I think the problem might be how I got traci interface in the initialize function, can anyone please explain how two modules use traci interface at the same time?
Edit:
As requested I am adding more information to the question.
Cross.net.xml
....
<tlLogic id="0" type="static" programID="1" offset="0">
<phase duration="500" state="rGrG"/>
</tlLogic>
....
Cross.tls.xml
<tls>
<tlLogic id="0" type="static" programID="tram_is_passing" offset="0">
<phase duration="4" state="ryry"/>
<phase duration="20" state="GrGr"/>
</tlLogic>
<tlLogic id="0" type="static" programID="tram_is_not_passing" offset="0">
<phase duration="999" state="rGrG"/>
</tlLogic>
</tls>