24 #include "ns3/packet.h" 31 : m_preamble (txVector.GetPreambleType ()),
34 m_truncatedTx (false),
35 m_txPowerLevel (txVector.GetTxPowerLevel ())
42 : m_preamble (txVector.GetPreambleType ()),
45 m_truncatedTx (false),
46 m_txPowerLevel (txVector.GetTxPowerLevel ()),
47 m_txAntennas (txVector.GetNTx ())
74 NS_FATAL_ERROR (
"This method should not be called for the base WifiPpdu class. Use the overloaded version in the amendment-specific PPDU subclasses instead!");
81 return m_psdus.begin ()->second;
111 uint16_t p20MaxFreq)
const 116 uint16_t minTxFreq = txCenterFreq - txChannelWidth / 2;
117 uint16_t maxTxFreq = txCenterFreq + txChannelWidth / 2;
119 if (minTxFreq > p20MinFreq || maxTxFreq < p20MaxFreq)
121 NS_LOG_INFO (
"Received PPDU does not overlap with the primary20 channel");
155 NS_FATAL_ERROR (
"This method should not be called for the base WifiPpdu class. Use the overloaded version in the amendment-specific PPDU subclasses instead!");
173 std::ostringstream ss;
174 ss <<
"PSDU=" <<
GetPsdu () <<
" ";
181 NS_FATAL_ERROR (
"This method should not be called for the base WifiPpdu class. Use the overloaded version in the amendment-specific PPDU subclasses instead!");
185 std::ostream & operator << (std::ostream &os, const Ptr<const WifiPpdu> &ppdu)
193 for (
auto const& psdu : psdus)
195 os <<
"PSDU for STA_ID=" << psdu.first
196 <<
" (" << *psdu.second <<
") ";
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802...
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint64_t GetUid(void) const
Get the UID of the PPDU.
virtual uint16_t GetStaId(void) const
Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
void SetTruncatedTx(void)
Indicate that the PPDU's transmission was aborted due to transmitter switch off.
WifiPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint64_t uid=UINT64_MAX)
Create a PPDU storing a PSDU.
WifiTxVector GetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
uint64_t m_uid
the unique ID of this PPDU
virtual WifiTxVector DoGetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiModulationClass GetModulation(void) const
Get the modulation used for the PPDU.
Modulation class unknown or unspecified.
std::ostream & operator<<(std::ostream &os, const Angles &a)
WifiPreamble GetPreamble(void) const
Get the preamble of the PPDU.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
virtual bool CanBeReceived(uint16_t txCenterFreq, uint16_t p20MinFreq, uint16_t p20MaxFreq) const
Check whether the given PPDU can be received on the specified primary channel.
uint8_t m_txAntennas
the number of antennas used to transmit this PPDU
virtual Time GetTxDuration(void) const
Get the total transmission duration of the PPDU.
void Print(std::ostream &os) const
Print the PPDU contents.
WifiPreamble m_preamble
the PHY preamble
bool IsTruncatedTx(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~WifiPpdu()
Destructor for WifiPpdu.
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
uint8_t m_txPowerLevel
the transmission power level (used only for TX and initializing the returned WifiTxVector) ...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
bool m_truncatedTx
flag indicating whether the frame's transmission was aborted due to transmitter switch off ...
WifiConstPsduMap m_psdus
the PSDUs contained in this PPDU
virtual uint16_t GetTransmissionChannelWidth(void) const
Get the channel width over which the PPDU will effectively be transmitted.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
uint16_t GetChannelWidth(void) const
virtual Ptr< WifiPpdu > Copy(void) const
Copy this instance.
WifiModulationClass m_modulation
the modulation used for the transmission of this PPDU
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
virtual WifiPpduType GetType(void) const
Return the PPDU type (.
virtual std::string PrintPayload(void) const
Print the payload of the PPDU.