Reputation: 47
I am working on the implementation of the following scenario using OMNET++ & VEINS simulators.
Issues regarding implementation:
WaveShortMessage.msg
file only ?.cc
, .h
, .ned
files for RSU and CAR or I
can amend the traci examples (of Veins).Upvotes: 0
Views: 1248
Reputation: 1565
Do I need to define a new .msg files for each of the above phases (for RSU broadcast, for vehicles query, and for vehicles responding) ? or I need to amend the WaveShortMessage.msg file only ?
It is highly recommended that you create a general message type for your specific application. You could extend the WaveShortMessage.msg
, and then add a type
field in your message, which would represent different types of messages for the application: RSUbroadcast
, VehicleQueryFrame
and so on. The decision in the end boils down to your choice. But having messages as specified as possible (keeping them atomic for a certain task) is good practice.
cplusplus {{
#include "veins/modules/heterogeneous/messages/WaveShortMessage_m.h" // include the base message
#define RSU_BROADCAST_FRAMETYPE 50
#define VEHICLE_QUERY_FRAMETYPE 51
}}
class WaveShortMessage; // Making the C++ Declarations Available
message MyAppGeneralMessage extends WaveShortMessage
{
int frameType;
}
Having the different types will allow you control over the behaviour of the application based on the different message type.
if(msg->getType() == foo)
{
/* do smth for foo */
}
Do I need to define my own .cc, .h, .ned files for RSU and CAR or I can amend the traci examples (of Veins).
In general yes. You will probably need to define .ned
, .cc
, .h
for the application(s) which you want to run on the RSU and the Car, but not for redefining what a RSU and a Car really is.
If you are reluctant you can start of by looking and the demo files and examples inside Veins.
Upvotes: 2