My approach: In the constructor of your network layer, send a delayed
selfmessage (use the second stage or so). This acts as a timer. When
receiving the message, schedule a new, delayed selfmessage (to get a
reminder every x seconds).
Also, when receiving the selfmesage, start a broadcast message. Use a
message type you defined that has fields for the node's id, maybe its
position and other data. Send it down in your network stack so it is
eventually sent over the radio.
When receiving a message from the lower layer (originating from another
node), check if it is of your broadcast type and if so, read data and
update the node's neighborhood in an array/vector.
Kind regards, Erik Becker
> > an email to
omnetpp+u...@googlegroups.com <javascript:>
> > <mailto:
omnetpp+u...@googlegroups.com <javascript:>>.
> <
https://groups.google.com/d/optout>.