|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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.");
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
WifiTxTimer m_txTimer
the timer set upon frame transmission
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< WifiPhy > m_phy
the PHY layer on this station
virtual void NotifyChannelReleased(void)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
WaveFrameExchangeManager()
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
uint8_t GetChannelNumber(void) const
Return current channel number.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
virtual void NotifyChannelAccessed(Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< ChannelScheduler > m_scheduler
the channel scheduler
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
virtual WifiTxVector GetDataTxVector(Ptr< const WifiMacQueueItem > item) const
Return a TXVECTOR for the DATA frame given the destination.
virtual void DoDispose(void)
Destructor implementation.
Ptr< ChannelScheduler > GetChannelScheduler(void) const
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
WifiPreamble GetPreambleType(void) const
Simulation virtual time values and global simulation resolution.
bool IsAdaptable(void) const
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
uint16_t GetChannelWidth(void) const
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual ~WaveFrameExchangeManager()
Ptr< MacTxMiddle > m_txMiddle
the MAC TX Middle on this station
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
void SendMpduWithProtection(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
Ptr< RegularWifiMac > m_mac
the MAC layer on this station
uint8_t GetTxPowerLevel(void) const
Ptr< ChannelCoordinator > m_coordinator
the channel coordinator
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void DoDispose() override
Destructor implementation.
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...
bool IsFragment(void) const
Return true if this item contains an MSDU fragment, false otherwise.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Time NeedTimeToGuardInterval(Time duration=Seconds(0.0)) const
WifiTxVector GetTxVector(void) const
void Cancel(void)
Cancel the timer.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
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.
Ptr< Txop > m_dcf
the DCF/EDCAF that gained channel access