Getting RX power?

427 views
Skip to first unread message

David Taylor

unread,
Feb 22, 2011, 5:48:59 AM2/22/11
to ns-3-users
Searching the forum I found 2 ways to do this:

1. Modify or subclass YansWifiChannel to add a tag with RX power info
to the packet.
2. Use DoCalcRxPower(...) to calculate the power directly.

Any alternative methods? Specifically, whats the best/easiest way to
get RX power from the information in a ReceiveCallback:

/**
* \param device a pointer to the net device which is calling this
callback
* \param packet the packet received
* \param protocol the 16 bit protocol number associated with this
packet.
* This protocol number is expected to be the same protocol
number
* given to the Send method by the user on the sender side.
* \param address the address of the sender
* \returns true if the callback could handle the packet
successfully,
* false otherwise.
*/
typedef Callback<bool, Ptr<NetDevice>, Ptr<Packet>, uint16_t,
const Address &> ReceiveCallback;

I assume I can somehow get the RX Power from Ptr<NetDevice>, but how?

David Taylor

unread,
Feb 23, 2011, 4:55:45 AM2/23/11
to ns-3-users
I think I found the way to do this. Using a callback to WifiChannel:

typedef Callback<void,Packet,double,WifiMode,WifiPreamble>
ns3::WifiChannel::ReceiveCallback
//arg1: the packet to receive arg2: the rx power of the packet to
receive (dbm) arg3: the tx mode of the packet to receive arg4: the //
preamble of the packet to receive

I understand this will be called on the receive end and arg2 is what I
am looking for... Can anybody confirm please?




On Feb 22, 12:48 pm, David Taylor <david.taylor.cy...@gmail.com>
wrote:

Fidbek

unread,
Feb 23, 2011, 10:04:37 AM2/23/11
to ns-3-users
I cannot confirm, but I am looking for a solution like yours...
If this works, please say it to me :)
I'll appreciate your help
Tomé

David Taylor

unread,
Feb 23, 2011, 10:17:54 AM2/23/11
to ns-3-users
I previously didn't notice that this callback is not implemented yet
in NS-3.10 (I found it googling), so it's irrelevant. I ended up
adding a packet tag with rx power at YansWifiModel... It's ugly, but
it works.
Reply all
Reply to author
Forward
0 new messages