Using RSSI for distance comparisons
A simple way to obtain a value directly proportional to the RSSI of a message is editing the files ns-2.30/common/packet.h and ns-2.30/mac/wireless-phy.cc.
On packet.h just add a double type myRSSI variable on the class Packet. Then, add p->myRSSI = (double) Pr * 10e10 on file wireless-phy.cc, as on the following piece of the code:
[...] |
Then you can access the rssi-like field from a Packet *p variable with p->myRSSI.