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
20class WifiTxVector;
21
22/**
23 * @brief receive notifications about PHY events.
24 */
26{
27 public:
28 /****************************************************************
29 * This destructor is needed.
30 ****************************************************************/
31
33 {
34 }
35
36 /**
37 * @param duration the expected duration of the packet reception.
38 *
39 * We have received the first bit of a packet. We decided
40 * that we could synchronize on this packet. It does not mean
41 * we will be able to successfully receive completely the
42 * whole packet. It means that we will report a BUSY status until
43 * one of the following happens:
44 * - NotifyRxEndOk
45 * - NotifyRxEndError
46 * - NotifyTxStart
47 */
48 virtual void NotifyRxStart(Time duration) = 0;
49 /**
50 * We have received the last bit of a packet for which
51 * NotifyRxStart was invoked first and, the packet has
52 * been successfully received.
53 */
54 virtual void NotifyRxEndOk() = 0;
55 /**
56 * @param txVector the TXVECTOR used for transmission
57 *
58 * We have received the last bit of a packet for which
59 * NotifyRxStart was invoked first and, the packet has
60 * _not_ been successfully received.
61 */
62 virtual void NotifyRxEndError(const WifiTxVector& txVector) = 0;
63 /**
64 * @param duration the expected transmission duration.
65 * @param txPower the nominal TX power
66 *
67 * We are about to send the first bit of the packet.
68 * We do not send any event to notify the end of
69 * transmission. Listeners should assume that the
70 * channel implicitly reverts to the idle state
71 * unless they have received a CCA busy report.
72 */
73 virtual void NotifyTxStart(Time duration, dBm_u txPower) = 0;
74 /**
75 * @param duration the expected busy duration.
76 * @param channelType the channel type for which the CCA busy state is reported.
77 * @param per20MhzDurations vector that indicates for how long each 20 MHz subchannel
78 * (corresponding to the index of the element in the vector) is busy and where a zero
79 * duration indicates that the subchannel is idle. The vector is non-empty if the PHY supports
80 * 802.11ax or later and if the operational channel width is larger than 20 MHz.
81 *
82 * This method does not really report a real state
83 * change as opposed to the other methods in this class.
84 * It merely reports that, unless the medium is reported
85 * busy through NotifyTxStart or NotifyRxStart/End,
86 * it will be busy as defined by the currently selected
87 * CCA mode.
88 *
89 * Typical client code which wants to have a clear picture
90 * of the CCA state will need to keep track of the time at
91 * which the last NotifyCcaBusyStart method is called and
92 * what duration it reported.
93 */
94 virtual void NotifyCcaBusyStart(Time duration,
95 WifiChannelListType channelType,
96 const std::vector<Time>& per20MhzDurations) = 0;
97 /**
98 * @param duration the expected channel switching duration.
99 *
100 * We do not send any event to notify the end of
101 * channel switching. Listeners should assume that the
102 * channel implicitly reverts to the idle or busy states.
103 */
104 virtual void NotifySwitchingStart(Time duration) = 0;
105 /**
106 * Notify listeners that we went to sleep
107 */
108 virtual void NotifySleep() = 0;
109 /**
110 * Notify listeners that we went to switch off
111 */
112 virtual void NotifyOff() = 0;
113 /**
114 * Notify listeners that we woke up
115 */
116 virtual void NotifyWakeup() = 0;
117 /**
118 * Notify listeners that we went to switch on
119 */
120 virtual void NotifyOn() = 0;
121};
122
123} // namespace ns3
124
125#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(const WifiTxVector &txVector)=0
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.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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: