0

I'm trying to learn veins, this is the initialization in the RSU application class :

void rsuApp::initialize(int stage) {
   BaseWaveApplLayer::initialize(stage);
   if(stage == 0){
       event = new cMessage("event");
       EV << "Scheduling first send to t=5.0s\n";
       scheduleAt(200.0, event);
   }
}

I scheduled a self-message at second 200 this is the handleSelfMsg() function code:

void rsuApp::handleSelfMsg(cMessage* msg) {
    BaseWaveApplLayer::handleSelfMsg(msg);
    findHost()->getDisplayString().updateWith("r=360,pink");
}

during simulation before the rsu receives the selfMsg (before second 200 ) nothing happened but when the RSU receives the self message at second 200 it starts to sends BSM to other nodes even though i didn't implement any BSM sending

I don't know if BSM and beacons are the same things but I set the sendBeacons parameter in omnetpp.ini to false but the RSU still send BSM messages after receiving the self message

*.rsu[*].appl.sendBeacons = false

so I want to know why the RSU start sending BSM to other nodes after receiving the self message is there a relation between scheduled events and BSM?

Nina
  • 109
  • 8

1 Answers1

1

In your method handleSelfMsg you call BaseWaveApplLayer::handleSelfMsg(msg). This method is populating and transmitting a Basic Safety Message (BSM) as a broadcast to all other nodes in the scenario.

sendBeacons just controls whether this is being done regularly in order to send periodic beacons. If enabled, the same method as above is called and a BSM is transmitted (see here).

Julian Heinovski
  • 1,822
  • 3
  • 16
  • 27