I am really new to Omnet++
and Veins
.I find it really hard to progress through Omnet++
and Veins
even with all the documentations provided .Right now I am stuck at how .msg files are generated and how messages are handled in veins .Can someone please help me with some documentation/tutorials/pointers to really understand these concepts .It would really help me out a lot as I am trying to learn this on my own which as of now is a really daunting task for me.
Thanks in advance
Asked
Active
Viewed 784 times
1

Sreeram M
- 140
- 10
1 Answers
4
In OMNeT++ .msg
files are not generated, they are created by a developer.
Let's assume that one need a message that contains two fields: destination address (an integer) and sequence number (an integer). Let's name this type FooMessage
. One creates a new file called FooMessage.msg
with the following content:
// FooMessage.msg
message FooMessage {
int destAddress;
int seqNumber;
}
During building of this project two new files are automatically created: FooMessage_m.h
and FooMessage_m.cc
. They contain C++ class for the message as well as all setters and getters methods.
To use them one should write in own C++ code something like that:
#include "FooMessage_m.h"
FooMessage *msg = new FooMessage("First message");
msg->setDestAddress(230);
msg->setSeqNumber(1);
TicToc Tutorial contains more advance example. Moreover, OMNeT++ Simulation Manual, Section 6 describes process of message definition.

Jerzy D.
- 6,707
- 2
- 16
- 22
-
Thankyou very much for this answer .I was really stuck on this topic for a while and you have helped me in clarifying my doubts about this topic. Trying to learn this on my own has been a major challenge .Thanks again :) – Sreeram M Jan 03 '21 at 06:59