21 #ifndef WIFI_TX_TIMER_H
22 #define WIFI_TX_TIMER_H
24 #include "ns3/event-id.h"
25 #include "ns3/nstime.h"
26 #include "ns3/simulator.h"
27 #include "ns3/traced-callback.h"
29 #include <unordered_map>
33 class WifiMacQueueItem;
38 typedef std::unordered_map <uint16_t , Ptr<WifiPsdu> >
WifiPsduMap;
86 template<
typename MEM,
typename OBJ,
typename... Args>
87 void Set (
Reason reason,
const Time &delay, MEM mem_ptr, OBJ obj, Args... args);
184 template<
typename MEM,
typename OBJ,
typename... Args>
185 void Timeout (MEM mem_ptr, OBJ obj, Args... args);
219 std::size_t nTotalStations);
244 template<
typename MEM,
typename OBJ,
typename... Args>
248 typedef void (
WifiTxTimer::*TimeoutType)(MEM, OBJ, Args...);
256 std::forward<Args> (args)... ),
false);
259 template<
typename MEM,
typename OBJ,
typename... Args>
266 ((*obj).*mem_ptr)(std::forward<Args> (args)...);
An identifier for simulation events.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now(void)
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
This class is used to handle the timer that a station starts when transmitting a frame that solicits ...
void Timeout(MEM mem_ptr, OBJ obj, Args... args)
This method is called when the timer expires.
Reason GetReason(void) const
Get the reason why the timer was started.
void Set(Reason reason, const Time &delay, MEM mem_ptr, OBJ obj, Args... args)
This method is called when a frame soliciting a response is transmitted.
Time GetDelayLeft(void) const
Get the remaining time until the timer will expire.
bool IsRunning(void) const
Return true if the timer is running.
Reason
The reason why the timer was started.
@ WAIT_BLOCK_ACK_AFTER_TB_PPDU
@ WAIT_NORMAL_ACK_AFTER_DL_MU_PPDU
@ WAIT_QOS_NULL_AFTER_BSRP_TF
@ WAIT_TB_PPDU_AFTER_BASIC_TF
@ WAIT_BLOCK_ACKS_IN_TB_PPDU
MpduResponseTimeout m_mpduResponseTimeoutCallback
the MPDU response timeout callback
void Expire(void)
Internal callback invoked when the timer expires.
void FeedTraceSource(Ptr< WifiMacQueueItem > item, WifiTxVector txVector)
This method is called when the timer expires to feed the MPDU response timeout callback.
void Cancel(void)
Cancel the timer.
PsduMapResponseTimeout m_psduMapResponseTimeoutCallback
the PSDU map response timeout callback
Callback< void, uint8_t, WifiPsduMap *, const std::set< Mac48Address > *, std::size_t > PsduMapResponseTimeout
PSDU map response timeout callback typedef.
Callback< void, uint8_t, Ptr< const WifiMacQueueItem >, const WifiTxVector & > MpduResponseTimeout
MPDU response timeout callback typedef.
Reason m_reason
the reason why the timer was started
Callback< void, uint8_t, Ptr< const WifiPsdu >, const WifiTxVector & > PsduResponseTimeout
PSDU response timeout callback typedef.
void SetPsduMapResponseTimeoutCallback(PsduMapResponseTimeout callback) const
Set the callback to invoke when the TX timer following the transmission of a PSDU map expires.
WifiTxTimer()
Default constructor.
PsduResponseTimeout m_psduResponseTimeoutCallback
the PSDU response timeout callback
std::string GetReasonString(Reason reason) const
Get a string associated with the given reason.
void SetMpduResponseTimeoutCallback(MpduResponseTimeout callback) const
Set the callback to invoke when the TX timer following the transmission of an MPDU expires.
Time m_end
the absolute time when the timer will expire
void SetPsduResponseTimeoutCallback(PsduResponseTimeout callback) const
Set the callback to invoke when the TX timer following the transmission of a PSDU expires.
void Reschedule(const Time &delay)
Reschedule the timer to time out the given amount of time from the moment this function is called.
Ptr< EventImpl > m_impl
the timer implementation, which contains the bound callback function and arguments
EventId m_timeoutEvent
the timeout event after a missing response
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.