Maybe I am wrong, but I noticed that the function getSenderPos() was removed/moved from WaveShortMessage to BasicSafetyMessage in versions 4.5+
With version 4.4 - I was using getSenderPos() to calculate the distance between the 2 nodes, but was wondering what would be the best approach with version 4.6+?
Should I rewrite the code written for WSM exchanges in my VEINS app to do BSM exchanges instead or am I missing something?
Thank you for your help.
You are right: compared to earlier versions, Veins 4.6 mandates a much smaller set of fields to be passed from applications to the MAC layer. The base type implementing this set of fields is (somewhat confusingly) called
WaveShortMessage
. Feel free to extend the set of fields by inheriting from the base type as you see fit, then cast the received message to your type in theonWSM
method.For quick experimentation, the example application layer
BaseWaveApplLayer
that comes with Veins already implements messages to simulate WSAs and BSMs, but most likely you want to use an entirely new type of messages anyway, so I wouldn't recommend building on these types of messages for anything but the most simple investigations (and, even then, to check that you are setting parameters like message length appropriately).