diff --git a/src/wifi/model/wifi-ppdu.cc b/src/wifi/model/wifi-ppdu.cc index 0404c38c7..f08f7b615 100644 --- a/src/wifi/model/wifi-ppdu.cc +++ b/src/wifi/model/wifi-ppdu.cc @@ -349,12 +349,12 @@ WifiPpdu::GetTxVector (void) const Ptr WifiPpdu::GetPsdu (uint8_t bssColor, uint16_t staId) const { - if (m_preamble != WIFI_PREAMBLE_HE_MU) //SU + if (!IsMu ()) { NS_ASSERT (m_psdus.size () == 1); return m_psdus.at (SU_STA_ID); } - else //HE MU + else { if (bssColor == m_heSig.GetBssColor ()) { @@ -443,6 +443,12 @@ WifiPpdu::GetTxDuration (void) const return ppduDuration; } +bool +WifiPpdu::IsMu (void) const +{ + return ((m_preamble == WIFI_PREAMBLE_VHT_MU) || (m_preamble == WIFI_PREAMBLE_HE_MU)); +} + void WifiPpdu::Print (std::ostream& os) const { diff --git a/src/wifi/model/wifi-ppdu.h b/src/wifi/model/wifi-ppdu.h index aa9d4baf2..cd15b9d63 100644 --- a/src/wifi/model/wifi-ppdu.h +++ b/src/wifi/model/wifi-ppdu.h @@ -70,6 +70,7 @@ public: * \return the TXVECTOR of the PPDU. */ WifiTxVector GetTxVector (void) const; + /** * Get the payload of the PPDU. * \param bssColor the BSS color of the PHY calling this function. @@ -77,21 +78,30 @@ public: * \return the PSDU */ Ptr GetPsdu (uint8_t bssColor = 64, uint16_t staId = SU_STA_ID) const; + /** * Return true if the PPDU's transmission was aborted due to transmitter switch off * \return true if the PPDU's transmission was aborted due to transmitter switch off */ bool IsTruncatedTx (void) const; + /** * Indicate that the PPDU's transmission was aborted due to transmitter switch off. */ void SetTruncatedTx (void); + /** * Get the total transmission duration of the PPDU. * \return the transmission duration of the PPDU */ Time GetTxDuration () const; + /** + * Return true if the PPDU is a MU PPDU + * \return true if the PPDU is a MU PPDU + */ + bool IsMu (void) const; + /** * \brief Print the PPDU contents. * \param os output stream in which the data should be printed.