diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index 515f207b3..49b274468 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -1378,17 +1378,13 @@ HePhy::StartTx(Ptr ppdu, const WifiTxVector& txVector) Transmit(nonOfdmaDuration, ppdu, txVector, "non-OFDMA transmission"); // OFDMA part - auto hePpdu = DynamicCast(ppdu->Copy()); // since flag will be modified - NS_ASSERT(hePpdu); - hePpdu->SetTxPsdFlag(HePpdu::PSD_HE_PORTION); Time ofdmaDuration = ppdu->GetTxDuration() - nonOfdmaDuration; Simulator::Schedule(nonOfdmaDuration, - &PhyEntity::Transmit, + &HePhy::StartTxOfdma, this, - ofdmaDuration, - hePpdu, + ppdu, txVector, - "OFDMA transmission"); + ofdmaDuration); } else { @@ -1396,6 +1392,15 @@ HePhy::StartTx(Ptr ppdu, const WifiTxVector& txVector) } } +void +HePhy::StartTxOfdma(Ptr ppdu, const WifiTxVector& txVector, Time ofdmaDuration) +{ + auto hePpdu = DynamicCast(ppdu); + NS_ASSERT(hePpdu); + hePpdu->SetTxPsdFlag(HePpdu::PSD_HE_PORTION); + Transmit(ofdmaDuration, ppdu, txVector, "OFDMA transmission"); +} + Time HePhy::CalculateTxDuration(WifiConstPsduMap psduMap, const WifiTxVector& txVector, diff --git a/src/wifi/model/he/he-phy.h b/src/wifi/model/he/he-phy.h index 68dbd11c4..5c38bc927 100644 --- a/src/wifi/model/he/he-phy.h +++ b/src/wifi/model/he/he-phy.h @@ -475,9 +475,9 @@ class HePhy : public VhtPhy virtual PhyFieldRxStatus ProcessSigB(Ptr event, PhyFieldRxStatus status); /** - * Start receiving the PSDU (i.e. the first symbol of the PSDU has arrived) of an UL-OFDMA + * Start receiving the PSDU (i.e. the first symbol of the PSDU has arrived) of an OFDMA * transmission. This function is called upon the RX event corresponding to the OFDMA part of - * the UL MU PPDU. + * the MU PPDU. * * \param event the event holding incoming OFDMA part of the PPDU's information */ @@ -527,6 +527,15 @@ class HePhy : public VhtPhy uint8_t GetNumberBccEncoders(const WifiTxVector& txVector) const override; Time GetSymbolDuration(const WifiTxVector& txVector) const override; + /** + * Start the transmission of the OFDMA part of the MU PPDU. + * + * \param ppdu the PPDU + * \param txVector the TXVECTOR + * \param ofdmaDuration the duration of the OFDMA part + */ + void StartTxOfdma(Ptr ppdu, const WifiTxVector& txVector, Time ofdmaDuration); + /** * Notify PHY state helper to switch to CCA busy state, * diff --git a/src/wifi/model/he/he-ppdu.cc b/src/wifi/model/he/he-ppdu.cc index 46dc8a6f7..37a76d361 100644 --- a/src/wifi/model/he/he-ppdu.cc +++ b/src/wifi/model/he/he-ppdu.cc @@ -303,7 +303,7 @@ HePpdu::GetTxPsdFlag() const } void -HePpdu::SetTxPsdFlag(TxPsdFlag flag) +HePpdu::SetTxPsdFlag(TxPsdFlag flag) const { NS_LOG_FUNCTION(this << flag); m_txPsdFlag = flag; diff --git a/src/wifi/model/he/he-ppdu.h b/src/wifi/model/he/he-ppdu.h index 8efefcb5a..76f1777d1 100644 --- a/src/wifi/model/he/he-ppdu.h +++ b/src/wifi/model/he/he-ppdu.h @@ -230,7 +230,7 @@ class HePpdu : public OfdmPpdu * * \see TxPsdFlag */ - void SetTxPsdFlag(TxPsdFlag flag); + void SetTxPsdFlag(TxPsdFlag flag) const; /** * Check if STA ID is in HE SIG-B Content Channel ID @@ -275,8 +275,8 @@ class HePpdu : public OfdmPpdu */ virtual void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration); - HeSigHeader m_heSig; //!< the HE-SIG PHY header - TxPsdFlag m_txPsdFlag; //!< the transmit power spectral density flag + HeSigHeader m_heSig; //!< the HE-SIG PHY header + mutable TxPsdFlag m_txPsdFlag; //!< the transmit power spectral density flag WifiTxVector::HeMuUserInfoMap m_muUserInfos; //!< HE MU specific per-user information (to be //!< removed once HE-SIG-B headers are implemented)