I made my own application to implemente a scheduling algorithm instead of traCIDemo11p , and I want to understand what is the differences between these two functions , the onData() and handleSelfMsg(). And also when a WSM message received from another node(other vehicle) is it handled in the first function or the second one because I think that the message received decapsulated in the lower layer fist then it is sent to the upper layer(MAC layer) .
Asked
Active
Viewed 162 times
-1
-
Which version of Veins are you using? In latest Veins 4.7, there is no function `onData()`. – Julian Heinovski May 31 '18 at 07:32
-
I'm using veins 4.4 – ismail bouhariche May 31 '18 at 10:58
-
Is this question answered? – Julian Heinovski Jul 22 '18 at 12:34
1 Answers
0
onData()
and handleSelfMsg()
have a completely different purpose. The first one is called upon receiving a packet from another node in the simulation, the latter is called upon receiving a self-message (e.g. a timer event).

Julian Heinovski
- 1,822
- 3
- 16
- 27
-
Thanks for your reply, but when i get the wsm sender module in onData (), it gave me the name of the module mac1609.4, and when i tried to get the send time i found it similar to the receive time which means that WSM came from a higher layer module and not from another node, now where WSM exactly handled at the first reception? – ismail bouhariche Jun 01 '18 at 15:41
-
The mac layer also _sends_ the packet to the application layer. Therefore, assuming you are talking about the omnet++ method, the sender module is the mac layer and the send time is the current time (or pretty similar). It the packet came from a higher layer, this layer would be the sender module. – Julian Heinovski Jun 01 '18 at 17:18