wifi: Add attribute to WifiSpectrumSignalParameters so as to differentiate OFDMA from non-OFDMA

This commit is contained in:
Rediet
2020-07-06 12:04:45 +02:00
committed by Sébastien Deronne
parent ec91858b92
commit cbb97e5baf
5 changed files with 43 additions and 2 deletions

View File

@@ -29,7 +29,6 @@
#include "ns3/net-device.h"
#include "ns3/node.h"
#include "spectrum-wifi-phy.h"
#include "wifi-spectrum-signal-parameters.h"
#include "wifi-spectrum-phy-interface.h"
#include "wifi-utils.h"
#include "wifi-ppdu.h"

View File

@@ -31,6 +31,7 @@
#include "ns3/spectrum-model.h"
#include "ns3/wifi-spectrum-value-helper.h"
#include "wifi-phy.h"
#include "wifi-spectrum-signal-parameters.h"
namespace ns3 {

View File

@@ -37,6 +37,7 @@ WifiSpectrumSignalParameters::WifiSpectrumSignalParameters (const WifiSpectrumSi
{
NS_LOG_FUNCTION (this << &p);
ppdu = p.ppdu;
txPsdFlag = p.txPsdFlag;
}
Ptr<SpectrumSignalParameters>

View File

@@ -28,6 +28,44 @@ namespace ns3 {
class WifiPpdu;
/**
* \ingroup wifi
*
* The transmit power spectral density flag, namely used
* to correctly build PSD for HE TB PPDU non-OFDMA and
* OFDMA portions.
*/
enum TxPsdFlag
{
PSD_NON_HE_TB = 0, //!< non-HE TB PPDU transmissions
PSD_HE_TB_NON_OFDMA_PORTION, //!< preamble of HE TB PPDU, which should only be sent on minimum subset of 20 MHz channels containing RU
PSD_HE_TB_OFDMA_PORTION //!< OFDMA portion of HE TB PPDU, which should only be sent on RU
};
/**
* \brief Stream insertion operator.
*
* \param os the stream
* \param flag the transmit power spectral density flag
* \returns a reference to the stream
*/
inline std::ostream& operator<< (std::ostream& os, TxPsdFlag flag)
{
switch (flag)
{
case PSD_NON_HE_TB:
return (os << "PSD_NON_HE_TB");
case PSD_HE_TB_NON_OFDMA_PORTION:
return (os << "PSD_HE_TB_NON_OFDMA_PORTION");
case PSD_HE_TB_OFDMA_PORTION:
return (os << "PSD_HE_TB_OFDMA_PORTION");
default:
NS_FATAL_ERROR ("Invalid PSD flag");
return (os << "INVALID");
}
}
/**
* \ingroup wifi
*
@@ -51,7 +89,8 @@ struct WifiSpectrumSignalParameters : public SpectrumSignalParameters
*/
WifiSpectrumSignalParameters (const WifiSpectrumSignalParameters& p);
Ptr<WifiPpdu> ppdu; ///< The PPDU being transmitted
Ptr<WifiPpdu> ppdu; ///< The PPDU being transmitted
TxPsdFlag txPsdFlag {PSD_NON_HE_TB}; ///< The transmit power spectral density flag
};
} // namespace ns3

View File

@@ -1299,6 +1299,7 @@ TestMultipleHeTbPreambles::RxHeTbPpdu (uint64_t uid, uint16_t staId, double txPo
rxParams->txPhy = 0;
rxParams->duration = ppduDuration;
rxParams->ppdu = ppdu;
rxParams->txPsdFlag = PSD_HE_TB_NON_OFDMA_PORTION;
m_phy->StartRx (rxParams);
}