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);
185 template<
typename MEM,
typename OBJ,
typename... Args>
186 void Timeout (MEM mem_ptr, OBJ obj, Args... args);
215 std::size_t nTotalStations);
239 template<
typename MEM,
typename OBJ,
typename... Args>
243 typedef void (
WifiTxTimer::*TimeoutType)(MEM, OBJ, Args...);
251 std::forward<Args> (args)... ),
false);
254 template<
typename MEM,
typename OBJ,
typename... Args>
261 ((*obj).*mem_ptr)(std::forward<Args> (args)...);
std::string GetReasonString(Reason reason) const
Get a string associated with the given reason.
Simulation virtual time values and global simulation resolution.
Callback< void, uint8_t, Ptr< const WifiMacQueueItem >, const WifiTxVector & > MpduResponseTimeout
MPDU response timeout callback typedef.
Callback< void, uint8_t, Ptr< const WifiPsdu >, const WifiTxVector & > PsduResponseTimeout
PSDU response timeout callback typedef.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Reason
The reason why the timer was started.
void SetMpduResponseTimeoutCallback(MpduResponseTimeout callback) const
Set the callback to invoke when the TX timer following the transmission of an MPDU expires...
PsduMapResponseTimeout m_psduMapResponseTimeoutCallback
the PSDU map response timeout callback
EventId m_timeoutEvent
the timeout event after a missing response
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.
Reason GetReason(void) const
Get the reason why the timer was started.
bool m_rescheduled
whether the timer has been already rescheduled
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Timeout(MEM mem_ptr, OBJ obj, Args... args)
This method is called when the timer expires.
This class is used to handle the timer that a station starts when transmitting a frame that solicits ...
WifiTxTimer()
Default constructor.
void Cancel(void)
Cancel the timer.
bool IsRunning(void) const
Return true if the timer is running.
MpduResponseTimeout m_mpduResponseTimeoutCallback
the MPDU response timeout callback
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...
An identifier for simulation events.
Callback< void, uint8_t, WifiPsduMap *, const std::set< Mac48Address > *, std::size_t > PsduMapResponseTimeout
PSDU map response timeout callback typedef.
void FeedTraceSource(Ptr< WifiMacQueueItem > item, WifiTxVector txVector)
This method is called when the timer expires to feed the MPDU response timeout callback.
void SetPsduMapResponseTimeoutCallback(PsduMapResponseTimeout callback) const
Set the callback to invoke when the TX timer following the transmission of a PSDU map expires...
Ptr< EventImpl > m_endRxEvent
event to schedule upon RXSTART.indication
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
PsduResponseTimeout m_psduResponseTimeoutCallback
the PSDU response timeout callback
Reason m_reason
the reason why the timer was started
Time GetDelayLeft(void) const
Get the remaining time until the timer will expire.