Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
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 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | |
19 * Sébastien Deronne <sebastien.deronne@gmail.com> | |
20 */ | |
21 | |
22 #ifndef WIFI_PHY_LISTENER_H | |
23 #define WIFI_PHY_LISTENER_H | |
24 | |
25 #include <map> | |
26 #include "ns3/callback.h" | |
27 #include "ns3/event-id.h" | |
28 #include "ns3/nstime.h" | |
29 | |
30 namespace ns3 { | |
31 | |
32 /** | |
33 * \brief receive notifications about phy events. | |
34 */ | |
35 class WifiPhyListener | |
36 { | |
37 public: | |
38 virtual ~WifiPhyListener (); | |
39 | |
40 /** | |
41 * \param duration the expected duration of the packet reception. | |
42 * | |
43 * We have received the first bit of a packet. We decided | |
44 * that we could synchronize on this packet. It does not mean | |
45 * we will be able to successfully receive completely the | |
46 * whole packet. It means that we will report a BUSY status until | |
47 * one of the following happens: | |
48 * - NotifyRxEndOk | |
49 * - NotifyRxEndError | |
50 * - NotifyTxStart | |
51 */ | |
52 virtual void NotifyRxStart (Time duration) = 0; | |
53 /** | |
54 * We have received the last bit of a packet for which | |
55 * NotifyRxStart was invoked first and, the packet has | |
56 * been successfully received. | |
57 */ | |
58 virtual void NotifyRxEndOk (void) = 0; | |
59 /** | |
60 * We have received the last bit of a packet for which | |
61 * NotifyRxStart was invoked first and, the packet has | |
62 * _not_ been successfully received. | |
63 */ | |
64 virtual void NotifyRxEndError (void) = 0; | |
65 /** | |
66 * \param duration the expected transmission duration. | |
67 * \param txPowerDbm the nominal tx power in dBm | |
68 * | |
69 * We are about to send the first bit of the packet. | |
70 * We do not send any event to notify the end of | |
71 * transmission. Listeners should assume that the | |
72 * channel implicitely reverts to the idle state | |
73 * unless they have received a cca busy report. | |
74 */ | |
75 virtual void NotifyTxStart (Time duration, double txPowerDbm) = 0; | |
76 /** | |
77 * \param duration the expected busy duration. | |
78 * | |
79 * This method does not really report a real state | |
80 * change as opposed to the other methods in this class. | |
81 * It merely reports that, unless the medium is reported | |
82 * busy through NotifyTxStart or NotifyRxStart/End, | |
83 * it will be busy as defined by the currently selected | |
84 * CCA mode. | |
85 * | |
86 * Typical client code which wants to have a clear picture | |
87 * of the CCA state will need to keep track of the time at | |
88 * which the last NotifyCcaBusyStart method is called and | |
89 * what duration it reported. | |
90 */ | |
91 virtual void NotifyMaybeCcaBusyStart (Time duration) = 0; | |
92 /** | |
93 * \param duration the expected channel switching duration. | |
94 * | |
95 * We do not send any event to notify the end of | |
96 * channel switching. Listeners should assume that the | |
97 * channel implicitely reverts to the idle or busy states. | |
98 */ | |
99 virtual void NotifySwitchingStart (Time duration) = 0; | |
100 /** | |
101 * Notify listeners that we went to sleep | |
102 */ | |
103 virtual void NotifySleep (void) = 0; | |
104 /** | |
105 * Notify listeners that we woke up | |
106 */ | |
107 virtual void NotifyWakeup (void) = 0; | |
108 }; | |
109 | |
110 } //namespace ns3 | |
111 | |
112 #endif /* WIFI_PHY_LISTENER_H */ | |
S. Deronne
2017/08/05 12:13:37
Is there not other listeners that could also be mo
ammo6818-vandals.uidaho.edu
2018/02/12 04:02:16
This was the only one that needed to me moved to c
| |
OLD | NEW |