25#include "ns3/packet.h"
34 uint16_t txCenterFreq,
36 : m_preamble(txVector.GetPreambleType()),
38 m_txCenterFreq(txCenterFreq),
41 m_txPowerLevel(txVector.GetTxPowerLevel())
49 uint16_t txCenterFreq,
51 : m_preamble(txVector.GetPreambleType()),
52 m_modulation(txVector.IsValid() ? txVector.GetMode(psdus.begin()->
first).GetModulationClass()
54 m_txCenterFreq(txCenterFreq),
57 m_txPowerLevel(txVector.GetTxPowerLevel()),
58 m_txAntennas(txVector.GetNTx())
68 psdu.second =
nullptr;
85 NS_FATAL_ERROR(
"This method should not be called for the base WifiPpdu class. Use the "
86 "overloaded version in the amendment-specific PPDU subclasses instead!");
157 if (minTxFreq >= maxFreq || maxTxFreq <= minFreq)
171 NS_LOG_INFO(
"Received PPDU does not overlap with the primary20 channel");
204 NS_FATAL_ERROR(
"This method should not be called for the base WifiPpdu class. Use the "
205 "overloaded version in the amendment-specific PPDU subclasses instead!");
220 std::ostringstream ss;
221 ss <<
"PSDU=" <<
GetPsdu() <<
" ";
228 NS_FATAL_ERROR(
"This method should not be called for the base WifiPpdu class. Use the "
229 "overloaded version in the amendment-specific PPDU subclasses instead!");
243 for (
const auto& psdu : psdus)
245 os <<
"PSDU for STA_ID=" << psdu.first <<
" (" << *psdu.second <<
") ";
Simulation virtual time values and global simulation resolution.
void Print(std::ostream &os) const
Print the PPDU contents.
virtual Time GetTxDuration() const
Get the total transmission duration of the PPDU.
bool IsTruncatedTx() const
WifiPreamble GetPreamble() const
Get the preamble of the PPDU.
virtual uint16_t GetStaId() const
Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
virtual bool CanBeReceived(uint16_t p20MinFreq, uint16_t p20MaxFreq) const
Check whether the given PPDU can be received on the specified primary channel.
uint16_t m_txCenterFreq
the center frequency (MHz) used for the transmission of this PPDU
virtual WifiPpduType GetType() const
Return the PPDU type (.
WifiModulationClass m_modulation
the modulation used for the transmission of this PPDU
WifiPreamble m_preamble
the PHY preamble
virtual ~WifiPpdu()
Destructor for WifiPpdu.
Ptr< const WifiPsdu > GetPsdu() const
Get the payload of the PPDU.
virtual WifiTxVector DoGetTxVector() const
Get the TXVECTOR used to send the PPDU.
uint64_t m_uid
the unique ID of this PPDU
void SetTruncatedTx()
Indicate that the PPDU's transmission was aborted due to transmitter switch off.
WifiPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint16_t txCenterFreq, uint64_t uid=UINT64_MAX)
Create a PPDU storing a PSDU.
uint64_t GetUid() const
Get the UID of the PPDU.
WifiModulationClass GetModulation() const
Get the modulation used for the PPDU.
virtual uint16_t GetTransmissionChannelWidth() const
Get the channel width over which the PPDU will effectively be transmitted.
WifiConstPsduMap m_psdus
the PSDUs contained in this PPDU
WifiTxVector GetTxVector() const
Get the TXVECTOR used to send the PPDU.
virtual std::string PrintPayload() const
Print the payload of the PPDU.
uint8_t m_txAntennas
the number of antennas used to transmit this PPDU
bool DoesOverlapChannel(uint16_t minFreq, uint16_t maxFreq) const
Check whether the given PPDU overlaps a given channel.
uint8_t m_txPowerLevel
the transmission power level (used only for TX and initializing the returned WifiTxVector)
virtual Ptr< WifiPpdu > Copy() const
Copy this instance.
bool m_truncatedTx
flag indicating whether the frame's transmission was aborted due to transmitter switch off
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint16_t GetChannelWidth() const
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_MOD_CLASS_UNKNOWN
Modulation class unknown or unspecified.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.