-1

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) .

1 Answers1

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