22 #include "ns3/abort.h" 23 #include "ns3/wifi-protection.h" 24 #include "ns3/wifi-acknowledgment.h" 38 static TypeId tid =
TypeId (
"ns3::WaveFrameExchangeManager")
40 .AddConstructor<WaveFrameExchangeManager> ()
41 .SetGroupName (
"Wave")
70 found = ConstCast<Packet> (item->GetPacket ())->PeekPacketTag (datatag);
75 return m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader ());
88 WifiTxVector txMac =
m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader ());
127 if (queue->IsEmpty ())
150 if (!
TryAddMpdu (mpdu, txParams, remainingTime))
154 NS_LOG_DEBUG (
"Because the required transmission time exceeds the remainingTime = " 156 <<
", currently this packet will not be transmitted.");
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
WaveFrameExchangeManager()
static TypeId GetTypeId(void)
Get the type ID.
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 "...
bool IsAdaptable(void) const
WifiTxTimer m_txTimer
the timer set upon frame transmission
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SendMpduWithProtection(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
Ptr< WifiPhy > m_phy
the PHY layer on this station
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time NeedTimeToGuardInterval(Time duration=Seconds(0.0)) const
Ptr< ChannelScheduler > GetChannelScheduler(void) const
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Ptr< RegularWifiMac > m_mac
the MAC layer on this station
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission...
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode...
WifiPreamble GetPreambleType(void) const
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
virtual void DoDispose(void)
Destructor implementation.
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
WifiTxVector GetTxVector(void) const
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the DATA frame given the destination.
virtual void NotifyChannelReleased(void)
Called by the FrameExchangeManager to notify the completion of the transmissions. ...
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
Ptr< ChannelScheduler > m_scheduler
the channel scheduler
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
bool IsFragment(void) const
Return true if this item contains an MSDU fragment, false otherwise.
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
void DoDispose() override
Destructor implementation.
void Cancel(void)
Cancel the timer.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
uint8_t GetChannelNumber(void) const
Return current channel number.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
virtual void NotifyChannelAccessed(Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism...
Ptr< Txop > m_dcf
the DCF/EDCAF that gained channel access
uint8_t GetTxPowerLevel(void) const
uint16_t GetChannelWidth(void) const
Ptr< ChannelCoordinator > m_coordinator
the channel coordinator
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
bool TryAddMpdu(Ptr< const WifiMacQueueItem > mpdu, WifiTxParameters &txParams, Time availableTime) const
Recompute the protection and acknowledgment methods to use if the given MPDU is added to the frame be...
Ptr< MacTxMiddle > m_txMiddle
the MAC TX Middle on this station
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
virtual ~WaveFrameExchangeManager()