Bug 844 - YansWifiPhy::GetPowerDbm off-by-one problem when calculating Tx power
YansWifiPhy::GetPowerDbm off-by-one problem when calculating Tx power
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P3 normal
Assigned To: Nicola Baldo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-14 22:15 UTC by Quincy Tse
Modified: 2010-06-07 11:10 UTC (History)
3 users (show)

See Also:


Attachments
Proposed patch. (Obsolete - Incorrect diff) (136.44 KB, patch)
2010-03-14 22:18 UTC, Quincy Tse
Details | Diff
Proposed patch. (539 bytes, patch)
2010-03-14 22:20 UTC, Quincy Tse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Quincy Tse 2010-03-14 22:15:16 UTC
For a system with n power levels, there are only (n - 1) intevals. Therefore the return value for YansWifiPhy::GetPowerDbm (uint8_t power) should be:
m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1), (ie. divide by (m_nTxPower - 1) instead of m_nTxPower)
Comment 1 Quincy Tse 2010-03-14 22:18:31 UTC
Created attachment 792 [details]
Proposed patch. (Obsolete - Incorrect diff)
Comment 2 Quincy Tse 2010-03-14 22:20:59 UTC
Created attachment 793 [details]
Proposed patch.
Comment 3 Quincy Tse 2010-05-23 21:50:38 UTC
Patch not yet applied to ns-3-dev or ns-3.8.
Comment 4 Quincy Tse 2010-06-03 08:20:13 UTC
Nicola - could you please review and comment/commit?
Comment 5 Nicola Baldo 2010-06-07 11:10:32 UTC
Thanks for catching this! I guess that nobody noticed so far because the power level feature is almost unused in practice, as of now. 

Anyway, that's fixed now 
changeset:   6342:a2bdd767bb67