0

How to change the length of the WAVE message. Method setWsmLength doesn't work. From the answer in here I gather that it is not possible, as the functionality is not implemented in WAVE. But the answer provided is very vague. It asks to create a .msg file, which is clear. But the rest is not very clear. Can somebody clarify or explain it?

P.S: I couldn't comment in that thread, so had to ask new question.

Community
  • 1
  • 1
dutu
  • 15
  • 4

1 Answers1

2

WaveShortMessage is an OMNeT++ packet, so one can always use addByteLength() to increase its existing size or setByteLength() to set a new size of it, description in OMNeT++ manual. Defining a new message is not necessary.
An example:

WaveShortMessage* wsm = prepareWSM("data", dataLengthBits, channel, dataPriority, -1,2);
wsm->setWsmData(blockedRoadId.c_str());
int byteLen = blockedRoadId.length(); // assuming that one char = one byte
wsm->addByteLength(byteLen);
Jerzy D.
  • 6,707
  • 2
  • 16
  • 22
  • thanks for the reply. I tried doing it but it somehow doesn't change the result. I have set Veins channel capacity to 3Mbps, and I am trying to overload the system. But now matter how big I set the packet size, the system never gets overloaded. Might the problem be that Veins doesn't simulate the size change of packets? – dutu Apr 04 '16 at 14:49
  • Veins sends a `WaveShortMessage` in every `beaconInterval` period. By default `beaconInterval` is equal to 1 s. In order to consume 3 Mbps bandwidth by one car you should set size to ... approx. 370 kilobytes! So try to decrease `beaconInterval` in `omnetpp.ini`. – Jerzy D. Apr 04 '16 at 15:31