Bug 2025

Summary: Changing the channel doesn't affect the Tx params
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: lr-wpanAssignee: Tom Henderson <tomh>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Tommaso Pecorella 2014-12-04 10:44:04 UTC
The bug is in this function:
void LrWpanPhy::PlmeSetAttributeRequest (LrWpanPibAttributeIdentifier id,
                                         LrWpanPhyPibAttributes* attribute)

if this function is used to change the channel, m_txPsd is not recomputed.

It should be recomputed. As a matter of fact using the same function to change the Tx power leads to...
            m_phyPIBAttributes.phyTransmitPower = attribute->phyTransmitPower;
            LrWpanSpectrumValueHelper psdHelper;
            m_txPsd = psdHelper.CreateTxPowerSpectralDensity (m_phyPIBAttributes.phyTransmitPower, m_phyPIBAttributes.phyCurrentChannel);

Notice the channel number in the last function call.
Comment 1 Tom Henderson 2015-03-14 15:59:13 UTC
+1
Comment 2 Tommaso Pecorella 2015-03-15 04:48:13 UTC
changeset:   11232:865dcb3bf5a0