Search code examples
omnet++veinssumo

How to send message from RSU periodically In the RSUExampleScenario in Veins 4.6?


In my simulation, I want to make RSU (RoadSide Unit) send message every 30 seconds to the vehicles in the range. In another work, the WSM messages are generated by RSU, and will be received by vehicles. How can I possibly change the provided TraCIDemoRSU11p.cc in Veins 4.6 to do this? I know handlePositionUpdate is used for the mobility module. But since the position of RSU is not changing, does this function work for RSU?


Solution

  • You can schedule an event as a self-message (e.g. BaseWaveApplLayer.cc:106) and upon receiving this event send your WSM and re-schedule the event (e.g. BaseWaveApplLayer.cc:239).