A Discrete-Event Network Simulator
API
wifi-phy-state-helper.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include <algorithm>
22 #include "ns3/log.h"
23 #include "ns3/simulator.h"
24 #include "ns3/packet.h"
25 #include "wifi-phy-state-helper.h"
26 #include "wifi-tx-vector.h"
27 #include "wifi-phy-listener.h"
28 #include "wifi-psdu.h"
29 
30 namespace ns3 {
31 
32 NS_LOG_COMPONENT_DEFINE ("WifiPhyStateHelper");
33 
34 NS_OBJECT_ENSURE_REGISTERED (WifiPhyStateHelper);
35 
36 TypeId
38 {
39  static TypeId tid = TypeId ("ns3::WifiPhyStateHelper")
40  .SetParent<Object> ()
41  .SetGroupName ("Wifi")
42  .AddConstructor<WifiPhyStateHelper> ()
43  .AddTraceSource ("State",
44  "The state of the PHY layer",
46  "ns3::WifiPhyStateHelper::StateTracedCallback")
47  .AddTraceSource ("RxOk",
48  "A packet has been received successfully.",
50  "ns3::WifiPhyStateHelper::RxOkTracedCallback")
51  .AddTraceSource ("RxError",
52  "A packet has been received unsuccessfully.",
54  "ns3::WifiPhyStateHelper::RxEndErrorTracedCallback")
55  .AddTraceSource ("Tx", "Packet transmission is starting.",
57  "ns3::WifiPhyStateHelper::TxTracedCallback")
58  ;
59  return tid;
60 }
61 
63  : m_sleeping (false),
64  m_isOff (false),
65  m_endTx (Seconds (0)),
66  m_endRx (Seconds (0)),
67  m_endCcaBusy (Seconds (0)),
68  m_endSwitching (Seconds (0)),
69  m_startTx (Seconds (0)),
70  m_startRx (Seconds (0)),
71  m_startCcaBusy (Seconds (0)),
72  m_startSwitching (Seconds (0)),
73  m_startSleep (Seconds (0)),
74  m_previousStateChangeTime (Seconds (0))
75 {
76  NS_LOG_FUNCTION (this);
77 }
78 
79 void
81 {
82  m_rxOkCallback = callback;
83 }
84 
85 void
87 {
88  m_rxErrorCallback = callback;
89 }
90 
91 void
93 {
94  m_listeners.push_back (listener);
95 }
96 
97 void
99 {
100  ListenersI i = find (m_listeners.begin (), m_listeners.end (), listener);
101  if (i != m_listeners.end ())
102  {
103  m_listeners.erase (i);
104  }
105 }
106 
107 bool
109 {
110  return (GetState () == WifiPhyState::IDLE);
111 }
112 
113 bool
115 {
116  return (GetState () == WifiPhyState::CCA_BUSY);
117 }
118 
119 bool
121 {
122  return (GetState () == WifiPhyState::RX);
123 }
124 
125 bool
127 {
128  return (GetState () == WifiPhyState::TX);
129 }
130 
131 bool
133 {
134  return (GetState () == WifiPhyState::SWITCHING);
135 }
136 
137 bool
139 {
140  return (GetState () == WifiPhyState::SLEEP);
141 }
142 
143 bool
145 {
146  return (GetState () == WifiPhyState::OFF);
147 }
148 
149 Time
151 {
152  Time retval;
153 
154  switch (GetState ())
155  {
156  case WifiPhyState::RX:
157  retval = m_endRx - Simulator::Now ();
158  break;
159  case WifiPhyState::TX:
160  retval = m_endTx - Simulator::Now ();
161  break;
163  retval = m_endCcaBusy - Simulator::Now ();
164  break;
166  retval = m_endSwitching - Simulator::Now ();
167  break;
168  case WifiPhyState::IDLE:
169  case WifiPhyState::SLEEP:
170  case WifiPhyState::OFF:
171  retval = Seconds (0);
172  break;
173  default:
174  NS_FATAL_ERROR ("Invalid WifiPhy state.");
175  retval = Seconds (0);
176  break;
177  }
178  retval = Max (retval, Seconds (0));
179  return retval;
180 }
181 
182 Time
184 {
185  return m_startRx;
186 }
187 
188 Time
190 {
191  return m_endRx;
192 }
193 
196 {
197  if (m_isOff)
198  {
199  return WifiPhyState::OFF;
200  }
201  if (m_sleeping)
202  {
203  return WifiPhyState::SLEEP;
204  }
205  else if (m_endTx > Simulator::Now ())
206  {
207  return WifiPhyState::TX;
208  }
209  else if (m_endRx > Simulator::Now ())
210  {
211  return WifiPhyState::RX;
212  }
213  else if (m_endSwitching > Simulator::Now ())
214  {
216  }
217  else if (m_endCcaBusy > Simulator::Now ())
218  {
219  return WifiPhyState::CCA_BUSY;
220  }
221  else
222  {
223  return WifiPhyState::IDLE;
224  }
225 }
226 
227 void
228 WifiPhyStateHelper::NotifyTxStart (Time duration, double txPowerDbm)
229 {
230  NS_LOG_FUNCTION (this);
231  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
232  {
233  (*i)->NotifyTxStart (duration, txPowerDbm);
234  }
235 }
236 
237 void
239 {
240  NS_LOG_FUNCTION (this);
241  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
242  {
243  (*i)->NotifyRxStart (duration);
244  }
245 }
246 
247 void
249 {
250  NS_LOG_FUNCTION (this);
251  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
252  {
253  (*i)->NotifyRxEndOk ();
254  }
255 }
256 
257 void
259 {
260  NS_LOG_FUNCTION (this);
261  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
262  {
263  (*i)->NotifyRxEndError ();
264  }
265 }
266 
267 void
269 {
270  NS_LOG_FUNCTION (this);
271  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
272  {
273  (*i)->NotifyMaybeCcaBusyStart (duration);
274  }
275 }
276 
277 void
279 {
280  NS_LOG_FUNCTION (this);
281  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
282  {
283  (*i)->NotifySwitchingStart (duration);
284  }
285 }
286 
287 void
289 {
290  NS_LOG_FUNCTION (this);
291  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
292  {
293  (*i)->NotifySleep ();
294  }
295 }
296 
297 void
299 {
300  NS_LOG_FUNCTION (this);
301  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
302  {
303  (*i)->NotifyOff ();
304  }
305 }
306 
307 void
309 {
310  NS_LOG_FUNCTION (this);
311  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
312  {
313  (*i)->NotifyWakeup ();
314  }
315 }
316 
317 void
319 {
320  NS_LOG_FUNCTION (this);
321  for (Listeners::const_iterator i = m_listeners.begin (); i != m_listeners.end (); i++)
322  {
323  (*i)->NotifyOn ();
324  }
325 }
326 
327 void
329 {
330  NS_LOG_FUNCTION (this);
331  Time now = Simulator::Now ();
332  Time idleStart = Max (m_endCcaBusy, m_endRx);
333  idleStart = Max (idleStart, m_endTx);
334  idleStart = Max (idleStart, m_endSwitching);
335  NS_ASSERT (idleStart <= now);
336  if (m_endCcaBusy > m_endRx
338  && m_endCcaBusy > m_endTx)
339  {
340  Time ccaBusyStart = Max (m_endTx, m_endRx);
341  ccaBusyStart = Max (ccaBusyStart, m_startCcaBusy);
342  ccaBusyStart = Max (ccaBusyStart, m_endSwitching);
343  Time ccaBusyDuration = idleStart - ccaBusyStart;
344  if (ccaBusyDuration.IsStrictlyPositive ())
345  {
346  m_stateLogger (ccaBusyStart, ccaBusyDuration, WifiPhyState::CCA_BUSY);
347  }
348  }
349  Time idleDuration = now - idleStart;
350  if (idleDuration.IsStrictlyPositive ())
351  {
352  m_stateLogger (idleStart, idleDuration, WifiPhyState::IDLE);
353  }
354 }
355 
356 void
357 WifiPhyStateHelper::SwitchToTx (Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, WifiTxVector txVector)
358 {
359  NS_LOG_FUNCTION (this << txDuration << psdus << txPowerDbm << txVector);
360  for (auto const& psdu : psdus)
361  {
362  m_txTrace (psdu.second->GetPacket (), txVector.GetMode (psdu.first), txVector.GetPreambleType (), txVector.GetTxPowerLevel ());
363  }
364  Time now = Simulator::Now ();
365  switch (GetState ())
366  {
367  case WifiPhyState::RX:
368  /* The packet which is being received as well
369  * as its endRx event are cancelled by the caller.
370  */
372  m_endRx = now;
373  break;
375  {
376  Time ccaStart = Max (m_endRx, m_endTx);
377  ccaStart = Max (ccaStart, m_startCcaBusy);
378  ccaStart = Max (ccaStart, m_endSwitching);
379  m_stateLogger (ccaStart, now - ccaStart, WifiPhyState::CCA_BUSY);
380  } break;
381  case WifiPhyState::IDLE:
383  break;
384  default:
385  NS_FATAL_ERROR ("Invalid WifiPhy state.");
386  break;
387  }
388  m_stateLogger (now, txDuration, WifiPhyState::TX);
390  m_endTx = now + txDuration;
391  m_startTx = now;
392  NotifyTxStart (txDuration, txPowerDbm);
393 }
394 
395 void
397 {
398  NS_LOG_FUNCTION (this << rxDuration);
400  Time now = Simulator::Now ();
401  switch (GetState ())
402  {
403  case WifiPhyState::IDLE:
405  break;
407  {
408  Time ccaStart = Max (m_endRx, m_endTx);
409  ccaStart = Max (ccaStart, m_startCcaBusy);
410  ccaStart = Max (ccaStart, m_endSwitching);
411  m_stateLogger (ccaStart, now - ccaStart, WifiPhyState::CCA_BUSY);
412  } break;
413  default:
414  NS_FATAL_ERROR ("Invalid WifiPhy state " << GetState ());
415  break;
416  }
418  m_startRx = now;
419  m_endRx = now + rxDuration;
420  NotifyRxStart (rxDuration);
421  NS_ASSERT (IsStateRx ());
422 }
423 
424 void
426 {
427  NS_LOG_FUNCTION (this << switchingDuration);
428  Time now = Simulator::Now ();
429  switch (GetState ())
430  {
431  case WifiPhyState::RX:
432  /* The packet which is being received as well
433  * as its endRx event are cancelled by the caller.
434  */
436  m_endRx = now;
437  break;
439  {
440  Time ccaStart = Max (m_endRx, m_endTx);
441  ccaStart = Max (ccaStart, m_startCcaBusy);
442  ccaStart = Max (ccaStart, m_endSwitching);
443  m_stateLogger (ccaStart, now - ccaStart, WifiPhyState::CCA_BUSY);
444  } break;
445  case WifiPhyState::IDLE:
447  break;
448  default:
449  NS_FATAL_ERROR ("Invalid WifiPhy state.");
450  break;
451  }
452 
453  if (now < m_endCcaBusy)
454  {
455  m_endCcaBusy = now;
456  }
457 
458  m_stateLogger (now, switchingDuration, WifiPhyState::SWITCHING);
460  m_startSwitching = now;
461  m_endSwitching = now + switchingDuration;
462  NotifySwitchingStart (switchingDuration);
464 }
465 
466 void
468 {
469  NS_LOG_FUNCTION (this << *psdu << snr << txVector);
470  std::vector<bool> statusPerMpdu;
471  if (!m_rxOkCallback.IsNull ())
472  {
473  m_rxOkCallback (psdu, snr, txVector, statusPerMpdu);
474  }
475 }
476 
477 void
478 WifiPhyStateHelper::SwitchFromRxEndOk (Ptr<WifiPsdu> psdu, double snr, WifiTxVector txVector, uint16_t staId, std::vector<bool> statusPerMpdu)
479 {
480  NS_LOG_FUNCTION (this << *psdu << snr << txVector << statusPerMpdu.size () <<
481  std::all_of(statusPerMpdu.begin(), statusPerMpdu.end(), [](bool v) { return v; })); //returns true if all true
482  NS_ASSERT (statusPerMpdu.size () != 0);
484  m_rxOkTrace (psdu->GetPacket (), snr, txVector.GetMode (staId), txVector.GetPreambleType ());
485  NotifyRxEndOk ();
486  DoSwitchFromRx ();
487  if (!m_rxOkCallback.IsNull ())
488  {
489  m_rxOkCallback (psdu, snr, txVector, statusPerMpdu);
490  }
491 }
492 
493 void
495 {
496  NS_LOG_FUNCTION (this << *psdu << snr);
498  m_rxErrorTrace (psdu->GetPacket (), snr);
499  NotifyRxEndError ();
500  DoSwitchFromRx ();
501  if (!m_rxErrorCallback.IsNull ())
502  {
503  m_rxErrorCallback (psdu);
504  }
505 }
506 
507 void
509 {
510  NS_LOG_FUNCTION (this);
511  Time now = Simulator::Now ();
514  m_endRx = Simulator::Now ();
516 }
517 
518 void
520 {
521  NS_LOG_FUNCTION (this << duration);
522  if (GetState () != WifiPhyState::RX)
523  {
524  NotifyMaybeCcaBusyStart (duration);
525  }
526  Time now = Simulator::Now ();
527  switch (GetState ())
528  {
529  case WifiPhyState::IDLE:
531  break;
532  case WifiPhyState::RX:
533  return;
534  default:
535  break;
536  }
538  {
539  m_startCcaBusy = now;
540  }
541  m_endCcaBusy = std::max (m_endCcaBusy, now + duration);
542 }
543 
544 void
546 {
547  NS_LOG_FUNCTION (this);
548  Time now = Simulator::Now ();
549  switch (GetState ())
550  {
551  case WifiPhyState::IDLE:
553  break;
555  {
556  Time ccaStart = Max (m_endRx, m_endTx);
557  ccaStart = Max (ccaStart, m_startCcaBusy);
558  ccaStart = Max (ccaStart, m_endSwitching);
559  m_stateLogger (ccaStart, now - ccaStart, WifiPhyState::CCA_BUSY);
560  } break;
561  default:
562  NS_FATAL_ERROR ("Invalid WifiPhy state.");
563  break;
564  }
566  m_sleeping = true;
567  m_startSleep = now;
568  NotifySleep ();
569  NS_ASSERT (IsStateSleep ());
570 }
571 
572 void
574 {
575  NS_LOG_FUNCTION (this << duration);
576  NS_ASSERT (IsStateSleep ());
577  Time now = Simulator::Now ();
580  m_sleeping = false;
581  NotifyWakeup ();
582  //update m_endCcaBusy after the sleep period
583  m_endCcaBusy = std::max (m_endCcaBusy, now + duration);
584  if (m_endCcaBusy > now)
585  {
587  }
588 }
589 
590 void
592 {
593  NS_LOG_FUNCTION (this);
594  NS_ASSERT (IsStateRx ());
595  NotifyRxEndOk ();
596  DoSwitchFromRx ();
599  NS_ASSERT (IsStateIdle ());
600 }
601 
602 void
604 {
605  NS_LOG_FUNCTION (this);
606  Time now = Simulator::Now ();
607  switch (GetState ())
608  {
609  case WifiPhyState::RX:
610  /* The packet which is being received as well
611  * as its endRx event are cancelled by the caller.
612  */
614  m_endRx = now;
615  break;
616  case WifiPhyState::TX:
617  /* The packet which is being transmitted as well
618  * as its endTx event are cancelled by the caller.
619  */
621  m_endTx = now;
622  break;
623  case WifiPhyState::IDLE:
625  break;
627  {
628  Time ccaStart = Max (m_endRx, m_endTx);
629  ccaStart = Max (ccaStart, m_startCcaBusy);
630  ccaStart = Max (ccaStart, m_endSwitching);
631  m_stateLogger (ccaStart, now - ccaStart, WifiPhyState::CCA_BUSY);
632  } break;
633  default:
634  NS_FATAL_ERROR ("Invalid WifiPhy state.");
635  break;
636  }
638  m_isOff = true;
639  NotifyOff ();
640  NS_ASSERT (IsStateOff ());
641 }
642 
643 void
645 {
646  NS_LOG_FUNCTION (this << duration);
647  NS_ASSERT (IsStateOff ());
648  Time now = Simulator::Now ();
650  m_isOff = false;
651  NotifyOn ();
652  //update m_endCcaBusy after the off period
653  m_endCcaBusy = std::max (m_endCcaBusy, now + duration);
654  if (m_endCcaBusy > now)
655  {
657  }
658 }
659 
660 } //namespace ns3
bool IsStateIdle(void) const
Check whether the current state is IDLE.
Time GetLastRxStartTime(void) const
Return the time the last RX start.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
void ContinueRxNextMpdu(Ptr< WifiPsdu > psdu, double snr, WifiTxVector txVector)
Continue RX after the reception of an MPDU in an A-MPDU was successful.
void DoSwitchFromRx(void)
Switch the state from RX.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
TracedCallback< Time, Time, WifiPhyState > m_stateLogger
The trace source fired when state is changed.
void NotifyWakeup(void)
Notify all WifiPhyListener that we woke up.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Definition: wifi-ppdu.h:33
The PHY layer is sleeping.
Time m_startCcaBusy
start CCA busy
void SwitchToOff(void)
Switch to off mode.
void SwitchToChannelSwitching(Time switchingDuration)
Switch state to channel switching for the given duration.
void UnregisterListener(WifiPhyListener *listener)
Remove WifiPhyListener from this WifiPhyStateHelper.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
void NotifyRxEndError(void)
Notify all WifiPhyListener that the reception was not successful.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
void SwitchFromRxAbort(void)
Abort current reception.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
Definition: nstime.h:333
std::vector< WifiPhyListener * >::iterator ListenersI
typedef for a list of WifiPhyListeners iterator
bool IsStateRx(void) const
Check whether the current state is RX.
bool IsStateSwitching(void) const
Check whether the current state is SWITCHING.
void SwitchFromSleep(Time duration)
Switch from sleep mode.
Time GetDelayUntilIdle(void) const
Return the time before the state is back to IDLE.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
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
void NotifySleep(void)
Notify all WifiPhyListener that we are going to sleep.
Time m_endSwitching
end switching
#define max(a, b)
Definition: 80211b.c:43
bool IsStateSleep(void) const
Check whether the current state is SLEEP.
void NotifyOn(void)
Notify all WifiPhyListener that we are going to switch on.
receive notifications about PHY events.
void NotifySwitchingStart(Time duration)
Notify all WifiPhyListener that we are switching channel with the given channel switching delay...
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
Definition: int64x64.h:230
The PHY layer has sense the medium busy through the CCA mechanism.
Time m_previousStateChangeTime
previous state change time
TracedCallback< Ptr< const Packet >, double, WifiMode, WifiPreamble > m_rxOkTrace
receive OK trace callback
void NotifyMaybeCcaBusyStart(Time duration)
Notify all WifiPhyListener that the CCA has started for the given duration.
Time GetLastRxEndTime(void) const
Return the time the last RX end.
RxErrorCallback m_rxErrorCallback
receive error callback
bool IsStateTx(void) const
Check whether the current state is TX.
void SwitchToSleep(void)
Switch to sleep mode.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The PHY layer is IDLE.
WifiPhyState
The state of the PHY layer.
Time m_startSwitching
start switching
void SetReceiveOkCallback(RxOkCallback callback)
Set a callback for a successful reception.
Time m_startTx
start transmit
void NotifyTxStart(Time duration, double txPowerDbm)
Notify all WifiPhyListener that the transmission has started for the given duration.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
void NotifyRxEndOk(void)
Notify all WifiPhyListener that the reception was successful.
void SwitchFromRxEndError(Ptr< WifiPsdu > psdu, double snr)
Switch from RX after the reception failed.
TracedCallback< Ptr< const Packet >, WifiMode, WifiPreamble, uint8_t > m_txTrace
transmit trace callback
static TypeId GetTypeId(void)
Get the type ID.
This objects implements the PHY state machine of the Wifi device.
WifiPhyState GetState(void) const
Return the current state of WifiPhy.
The PHY layer is sending a packet.
void SwitchFromOff(Time duration)
Switch from off mode.
void SwitchToTx(Time txDuration, WifiConstPsduMap psdus, double txPowerDbm, WifiTxVector txVector)
Switch state to TX for the given duration.
Listeners m_listeners
listeners
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
The PHY layer is receiving a packet.
void SwitchFromRxEndOk(Ptr< WifiPsdu > psdu, double snr, WifiTxVector txVector, uint16_t staId, std::vector< bool > statusPerMpdu)
Switch from RX after the reception was successful.
bool IsStateOff(void) const
Check whether the current state is OFF.
void SetReceiveErrorCallback(RxErrorCallback callback)
Set a callback for a failed reception.
The PHY layer is switched off.
uint8_t GetTxPowerLevel(void) const
TracedCallback< Ptr< const Packet >, double > m_rxErrorTrace
receive error trace callback
The PHY layer is switching to other channel.
A base class which provides memory management and object aggregation.
Definition: object.h:87
void SwitchToRx(Time rxDuration)
Switch state to RX for the given duration.
void LogPreviousIdleAndCcaBusyStates(void)
Log the ideal and CCA states.
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1386
void NotifyRxStart(Time duration)
Notify all WifiPhyListener that the reception has started for the given duration. ...
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
void RegisterListener(WifiPhyListener *listener)
Register WifiPhyListener to this WifiPhyStateHelper.
void SwitchMaybeToCcaBusy(Time duration)
Switch to CCA busy.
RxOkCallback m_rxOkCallback
receive OK callback
void NotifyOff(void)
Notify all WifiPhyListener that we are going to switch off.
bool IsStateCcaBusy(void) const
Check whether the current state is CCA busy.