A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-phy-listener.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 * Sébastien Deronne <sebastien.deronne@gmail.com>
8 */
9
10#ifndef WIFI_PHY_LISTENER_H
11#define WIFI_PHY_LISTENER_H
12
13#include "wifi-phy-common.h"
14
15#include <vector>
16
17namespace ns3
18{
19
20/**
21 * \brief receive notifications about PHY events.
22 */
24{
25 public:
26 /****************************************************************
27 * This destructor is needed.
28 ****************************************************************/
29
31 {
32 }
33
34 /**
35 * \param duration the expected duration of the packet reception.
36 *
37 * We have received the first bit of a packet. We decided
38 * that we could synchronize on this packet. It does not mean
39 * we will be able to successfully receive completely the
40 * whole packet. It means that we will report a BUSY status until
41 * one of the following happens:
42 * - NotifyRxEndOk
43 * - NotifyRxEndError
44 * - NotifyTxStart
45 */
46 virtual void NotifyRxStart(Time duration) = 0;
47 /**
48 * We have received the last bit of a packet for which
49 * NotifyRxStart was invoked first and, the packet has
50 * been successfully received.
51 */
52 virtual void NotifyRxEndOk() = 0;
53 /**
54 * We have received the last bit of a packet for which
55 * NotifyRxStart was invoked first and, the packet has
56 * _not_ been successfully received.
57 */
58 virtual void NotifyRxEndError() = 0;
59 /**
60 * \param duration the expected transmission duration.
61 * \param txPower the nominal TX power
62 *
63 * We are about to send the first bit of the packet.
64 * We do not send any event to notify the end of
65 * transmission. Listeners should assume that the
66 * channel implicitly reverts to the idle state
67 * unless they have received a CCA busy report.
68 */
69 virtual void NotifyTxStart(Time duration, dBm_u txPower) = 0;
70 /**
71 * \param duration the expected busy duration.
72 * \param channelType the channel type for which the CCA busy state is reported.
73 * \param per20MhzDurations vector that indicates for how long each 20 MHz subchannel
74 * (corresponding to the index of the element in the vector) is busy and where a zero
75 * duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports
76 * 802.11ax or later and if the operational channel width is larger than 20 MHz.
77 *
78 * This method does not really report a real state
79 * change as opposed to the other methods in this class.
80 * It merely reports that, unless the medium is reported
81 * busy through NotifyTxStart or NotifyRxStart/End,
82 * it will be busy as defined by the currently selected
83 * CCA mode.
84 *
85 * Typical client code which wants to have a clear picture
86 * of the CCA state will need to keep track of the time at
87 * which the last NotifyCcaBusyStart method is called and
88 * what duration it reported.
89 */
90 virtual void NotifyCcaBusyStart(Time duration,
91 WifiChannelListType channelType,
92 const std::vector<Time>& per20MhzDurations) = 0;
93 /**
94 * \param duration the expected channel switching duration.
95 *
96 * We do not send any event to notify the end of
97 * channel switching. Listeners should assume that the
98 * channel implicitly reverts to the idle or busy states.
99 */
100 virtual void NotifySwitchingStart(Time duration) = 0;
101 /**
102 * Notify listeners that we went to sleep
103 */
104 virtual void NotifySleep() = 0;
105 /**
106 * Notify listeners that we went to switch off
107 */
108 virtual void NotifyOff() = 0;
109 /**
110 * Notify listeners that we woke up
111 */
112 virtual void NotifyWakeup() = 0;
113 /**
114 * Notify listeners that we went to switch on
115 */
116 virtual void NotifyOn() = 0;
117};
118
119} // namespace ns3
120
121#endif /* WIFI_PHY_LISTENER_H */
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
receive notifications about PHY events.
virtual void NotifyRxEndError()=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
virtual void NotifySwitchingStart(Time duration)=0
virtual void NotifyCcaBusyStart(Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations)=0
virtual void NotifyOff()=0
Notify listeners that we went to switch off.
virtual void NotifyRxEndOk()=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
virtual void NotifyTxStart(Time duration, dBm_u txPower)=0
virtual void NotifySleep()=0
Notify listeners that we went to sleep.
virtual void NotifyOn()=0
Notify listeners that we went to switch on.
virtual void NotifyRxStart(Time duration)=0
virtual void NotifyWakeup()=0
Notify listeners that we woke up.
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Declaration of the following enums: