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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 * Sébastien Deronne <sebastien.deronne@gmail.com>
19 */
20
21#ifndef WIFI_PHY_LISTENER_H
22#define WIFI_PHY_LISTENER_H
23
24#include "wifi-phy-common.h"
25
26#include <vector>
27
28namespace ns3
29{
30
31/**
32 * \brief receive notifications about PHY events.
33 */
35{
36 public:
37 /****************************************************************
38 * This destructor is needed.
39 ****************************************************************/
40
42 {
43 }
44
45 /**
46 * \param duration the expected duration of the packet reception.
47 *
48 * We have received the first bit of a packet. We decided
49 * that we could synchronize on this packet. It does not mean
50 * we will be able to successfully receive completely the
51 * whole packet. It means that we will report a BUSY status until
52 * one of the following happens:
53 * - NotifyRxEndOk
54 * - NotifyRxEndError
55 * - NotifyTxStart
56 */
57 virtual void NotifyRxStart(Time duration) = 0;
58 /**
59 * We have received the last bit of a packet for which
60 * NotifyRxStart was invoked first and, the packet has
61 * been successfully received.
62 */
63 virtual void NotifyRxEndOk() = 0;
64 /**
65 * We have received the last bit of a packet for which
66 * NotifyRxStart was invoked first and, the packet has
67 * _not_ been successfully received.
68 */
69 virtual void NotifyRxEndError() = 0;
70 /**
71 * \param duration the expected transmission duration.
72 * \param txPowerDbm the nominal TX power in dBm
73 *
74 * We are about to send the first bit of the packet.
75 * We do not send any event to notify the end of
76 * transmission. Listeners should assume that the
77 * channel implicitly reverts to the idle state
78 * unless they have received a CCA busy report.
79 */
80 virtual void NotifyTxStart(Time duration, double txPowerDbm) = 0;
81 /**
82 * \param duration the expected busy duration.
83 * \param channelType the channel type for which the CCA busy state is reported.
84 * \param per20MhzDurations vector that indicates for how long each 20 MHz subchannel
85 * (corresponding to the index of the element in the vector) is busy and where a zero
86 * duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports
87 * 802.11ax or later and if the operational channel width is larger than 20 MHz.
88 *
89 * This method does not really report a real state
90 * change as opposed to the other methods in this class.
91 * It merely reports that, unless the medium is reported
92 * busy through NotifyTxStart or NotifyRxStart/End,
93 * it will be busy as defined by the currently selected
94 * CCA mode.
95 *
96 * Typical client code which wants to have a clear picture
97 * of the CCA state will need to keep track of the time at
98 * which the last NotifyCcaBusyStart method is called and
99 * what duration it reported.
100 */
101 virtual void NotifyCcaBusyStart(Time duration,
102 WifiChannelListType channelType,
103 const std::vector<Time>& per20MhzDurations) = 0;
104 /**
105 * \param duration the expected channel switching duration.
106 *
107 * We do not send any event to notify the end of
108 * channel switching. Listeners should assume that the
109 * channel implicitly reverts to the idle or busy states.
110 */
111 virtual void NotifySwitchingStart(Time duration) = 0;
112 /**
113 * Notify listeners that we went to sleep
114 */
115 virtual void NotifySleep() = 0;
116 /**
117 * Notify listeners that we went to switch off
118 */
119 virtual void NotifyOff() = 0;
120 /**
121 * Notify listeners that we woke up
122 */
123 virtual void NotifyWakeup() = 0;
124 /**
125 * Notify listeners that we went to switch on
126 */
127 virtual void NotifyOn() = 0;
128};
129
130} // namespace ns3
131
132#endif /* WIFI_PHY_LISTENER_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
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 NotifySleep()=0
Notify listeners that we went to sleep.
virtual void NotifyOn()=0
Notify listeners that we went to switch on.
virtual void NotifyTxStart(Time duration, double txPowerDbm)=0
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: