fixed bug 844
This commit is contained in:
1 parent
8a0c780062
commit
2d37660b5e
1 file changed
+10
-1
@@ -726,7 +726,16 @@ YansWifiPhy::GetPowerDbm (uint8_t power) const
|
||||
{
|
||||
NS_ASSERT (m_txPowerBaseDbm <= m_txPowerEndDbm);
|
||||
NS_ASSERT (m_nTxPower > 0);
|
||||
double dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / m_nTxPower;
|
||||
double dbm;
|
||||
if (m_nTxPower > 1)
|
||||
{
|
||||
dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_ASSERT_MSG (m_txPowerBaseDbm == m_txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1");
|
||||
dbm = m_txPowerBaseDbm;
|
||||
}
|
||||
return dbm;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user