diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index f9a40ffaa..8ecb05827 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -394,6 +394,7 @@ WifiPhy::WifiPhy () m_initialFrequency (0), m_frequencyChannelNumberInitialized (false), m_channelWidth (0), + m_powerRestricted (false), m_channelAccessRequested (false), m_txSpatialStreams (0), m_rxSpatialStreams (0), diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index 48a908dc3..05d7e0b4c 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -1964,7 +1964,7 @@ private: bool m_powerRestricted; //!< Flag whether transmit power is restricted by OBSS PD SR double m_txPowerMaxSiso; //!< SISO maximum transmit power due to OBSS PD SR power restriction double m_txPowerMaxMimo; //!< MIMO maximum transmit power due to OBSS PD SR power restriction - bool m_channelAccessRequested; //!< Flag if channels access has been requestd (used for OBSS_PD SR) + bool m_channelAccessRequested; //!< Flag if channels access has been requested (used for OBSS_PD SR) bool m_greenfield; //!< Flag if GreenField format is supported (deprecated) bool m_shortGuardInterval; //!< Flag if HT/VHT short guard interval is supported (deprecated) diff --git a/src/wifi/model/wifi-ppdu.cc b/src/wifi/model/wifi-ppdu.cc index 4f720f70b..9286364fc 100644 --- a/src/wifi/model/wifi-ppdu.cc +++ b/src/wifi/model/wifi-ppdu.cc @@ -35,7 +35,8 @@ WifiPpdu::WifiPpdu (Ptr psdu, WifiTxVector txVector, Time ppduDu m_psdu (psdu), m_truncatedTx (false), m_frequency (frequency), - m_channelWidth (txVector.GetChannelWidth ()) + m_channelWidth (txVector.GetChannelWidth ()), + m_txPowerLevel (txVector.GetTxPowerLevel ()) { NS_LOG_FUNCTION (this << psdu << txVector << ppduDuration << frequency); if (!txVector.IsValid ()) @@ -502,6 +503,7 @@ WifiPpdu::GetTxVector (void) const NS_FATAL_ERROR ("unsupported modulation class"); break; } + txVector.SetTxPowerLevel (m_txPowerLevel); return txVector; } diff --git a/src/wifi/model/wifi-ppdu.h b/src/wifi/model/wifi-ppdu.h index 5fd8aa39d..9cb8fb50d 100644 --- a/src/wifi/model/wifi-ppdu.h +++ b/src/wifi/model/wifi-ppdu.h @@ -94,6 +94,7 @@ private: bool m_truncatedTx; //!< flag indicating whether the frame's transmission was aborted due to transmitter switch off uint16_t m_frequency; //!< the frequency used to transmit that PPDU uint16_t m_channelWidth; //!< the channel width used to transmit that PPDU + uint8_t m_txPowerLevel; //!< the transmission power level (used only for Tx and initializing the returned WifiTxVector) }; /** diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 8bd255215..7d6ebe7c8 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -582,6 +582,7 @@ WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHe } txVector.SetMode (mgtMode); txVector.SetPreambleType (GetPreambleForTransmission (mgtMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address))); + txVector.SetTxPowerLevel (m_defaultTxPowerLevel); txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ())); txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast (m_wifiPhy->GetDevice ()))); } diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index 5bb6033cc..5bd560a70 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -1326,7 +1326,7 @@ private: uint32_t m_rtsCtsThreshold; //!< Threshold for RTS/CTS uint32_t m_fragmentationThreshold; //!< Current threshold for fragmentation uint32_t m_nextFragmentationThreshold; //!< Threshold for fragmentation that will be used for the next transmission - uint8_t m_defaultTxPowerLevel; //!< Default tranmission power level + uint8_t m_defaultTxPowerLevel; //!< Default transmission power level WifiMode m_nonUnicastMode; //!< Transmission mode for non-unicast DATA frames bool m_useNonErpProtection; //!< flag if protection for non-ERP stations against ERP transmissions is enabled bool m_useNonHtProtection; //!< flag if protection for non-HT stations against HT transmissions is enabled