author | Gary Pei <guangyu.pei@boeing.com> |
Thu, 28 May 2009 20:10:27 +0200 | |
changeset 4470 | 51b5c1a272d3 |
parent 4264 | 9d2e96c4e6e4 |
child 4492 | 3ebeb7bf3c15 |
permissions | -rw-r--r-- |
1889 | 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 "wifi-phy.h" |
|
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
22 |
#include "wifi-mode.h" |
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
23 |
#include "wifi-channel.h" |
1920
1d4864775cf8
replace header mode with preamble mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1919
diff
changeset
|
24 |
#include "wifi-preamble.h" |
1889 | 25 |
#include "ns3/simulator.h" |
26 |
#include "ns3/packet.h" |
|
27 |
#include "ns3/random-variable.h" |
|
1974
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
28 |
#include "ns3/assert.h" |
1979
d535a38b7fc4
convert TRACE to NS_LOG
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
29 |
#include "ns3/log.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
30 |
#include "ns3/double.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
31 |
#include "ns3/uinteger.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
32 |
#include "ns3/enum.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
33 |
#include "ns3/trace-source-accessor.h" |
1889 | 34 |
#include <math.h> |
35 |
||
1979
d535a38b7fc4
convert TRACE to NS_LOG
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
36 |
NS_LOG_COMPONENT_DEFINE ("WifiPhy"); |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
37 |
|
1889 | 38 |
namespace ns3 { |
39 |
||
40 |
/**************************************************************** |
|
41 |
* This destructor is needed. |
|
42 |
****************************************************************/ |
|
43 |
||
1890
a2b30c6456c9
Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1889
diff
changeset
|
44 |
WifiPhyListener::~WifiPhyListener () |
1889 | 45 |
{} |
46 |
||
47 |
/**************************************************************** |
|
1890
a2b30c6456c9
Phy80211 -> WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1889
diff
changeset
|
48 |
* The actual WifiPhy class |
1889 | 49 |
****************************************************************/ |
50 |
||
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
51 |
NS_OBJECT_ENSURE_REGISTERED (WifiPhy); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
52 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
53 |
TypeId |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
54 |
WifiPhy::GetTypeId (void) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
55 |
{ |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
56 |
static TypeId tid = TypeId ("ns3::WifiPhy") |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
57 |
.SetParent<Object> () |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
58 |
.AddTraceSource ("PhyTxBegin", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
59 |
"Trace source indicating a packet has begun transmitting over the channel medium", |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
60 |
MakeTraceSourceAccessor (&WifiPhy::m_phyTxBeginTrace)) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
61 |
.AddTraceSource ("PhyTxEnd", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
62 |
"Trace source indicating a packet has been completely transmitted over the channel", |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
63 |
MakeTraceSourceAccessor (&WifiPhy::m_phyTxEndTrace)) |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
64 |
.AddTraceSource ("PhyTxDrop", |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
65 |
"Trace source indicating a packet has been dropped by the device during transmission", |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
66 |
MakeTraceSourceAccessor (&WifiPhy::m_phyTxDropTrace)) |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
67 |
.AddTraceSource ("PhyRxBegin", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
68 |
"Trace source indicating a packet has begun being received from the channel medium by the device", |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
69 |
MakeTraceSourceAccessor (&WifiPhy::m_phyRxBeginTrace)) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
70 |
.AddTraceSource ("PhyRxEnd", |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
71 |
"Trace source indicating a packet has been completely received from the channel medium by the device", |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
72 |
MakeTraceSourceAccessor (&WifiPhy::m_phyRxEndTrace)) |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
73 |
.AddTraceSource ("PhyRxDrop", |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
74 |
"Trace source indicating a packet has been dropped by the device during reception", |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
75 |
MakeTraceSourceAccessor (&WifiPhy::m_phyRxDropTrace)) |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
76 |
.AddTraceSource ("PromiscSniffer", |
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4040
diff
changeset
|
77 |
"Trace source simulating a promiscuous packet sniffer attached to the device", |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
78 |
MakeTraceSourceAccessor (&WifiPhy::m_phyPromiscSnifferTrace)) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
79 |
; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
80 |
return tid; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
81 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
82 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
83 |
WifiPhy::WifiPhy () |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
84 |
{ |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
85 |
NS_LOG_FUNCTION (this); |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
86 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
87 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
88 |
WifiPhy::~WifiPhy () |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
89 |
{ |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
90 |
NS_LOG_FUNCTION (this); |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
91 |
} |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
92 |
|
4039
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
93 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
94 |
WifiPhy::Get6mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
95 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
96 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-6mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
97 |
true, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
98 |
20000000, 6000000, 12000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
99 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
100 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
101 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
102 |
WifiPhy::Get9mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
103 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
104 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-9mbs", |
4040
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
105 |
false, |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
106 |
20000000, 9000000, 12000000); |
4039
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
107 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
108 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
109 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
110 |
WifiPhy::Get12mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
111 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
112 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-12mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
113 |
true, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
114 |
20000000, 12000000, 24000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
115 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
116 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
117 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
118 |
WifiPhy::Get18mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
119 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
120 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-18mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
121 |
false, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
122 |
20000000, 18000000, 24000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
123 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
124 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
125 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
126 |
WifiPhy::Get24mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
127 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
128 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-24mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
129 |
true, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
130 |
20000000, 24000000, 48000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
131 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
132 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
133 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
134 |
WifiPhy::Get36mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
135 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
136 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-36mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
137 |
false, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
138 |
20000000, 36000000, 48000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
139 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
140 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
141 |
|
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
142 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
143 |
WifiPhy::Get48mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
144 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
145 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-48mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
146 |
false, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
147 |
20000000, 48000000, 72000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
148 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
149 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
150 |
|
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
151 |
WifiMode |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
152 |
WifiPhy::Get54mba (void) |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
153 |
{ |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
154 |
static WifiMode mode = WifiModeFactory::CreateBpsk ("wifia-54mbs", |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
155 |
false, |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
156 |
20000000, 54000000, 72000000); |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
157 |
return mode; |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
158 |
} |
50a070c2750c
remove public static variables. Use public static methods
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
159 |
|
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
160 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
161 |
WifiPhy::NotifyTxBegin (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
162 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
163 |
m_phyTxBeginTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
164 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
165 |
|
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
166 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
167 |
WifiPhy::NotifyTxEnd (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
168 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
169 |
m_phyTxEndTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
170 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
171 |
|
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
172 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
173 |
WifiPhy::NotifyTxDrop (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
174 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
175 |
m_phyTxDropTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
176 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
177 |
|
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
178 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
179 |
WifiPhy::NotifyRxBegin (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
180 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
181 |
m_phyRxBeginTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
182 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
183 |
|
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
184 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
185 |
WifiPhy::NotifyRxEnd (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
186 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
187 |
m_phyRxEndTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
188 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
189 |
|
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
190 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
191 |
WifiPhy::NotifyRxDrop (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
192 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
193 |
m_phyRxDropTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
194 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
195 |
|
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
196 |
void |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
197 |
WifiPhy::NotifyPromiscSniff (Ptr<const Packet> packet) |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
198 |
{ |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
199 |
m_phyPromiscSnifferTrace (packet); |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
200 |
} |
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
201 |
|
4470 | 202 |
WifiMode |
203 |
WifiPhy::Get1mbb (void) |
|
204 |
{ |
|
205 |
static WifiMode mode = WifiModeFactory::CreateDbpsk ("wifib-1mbs", |
|
206 |
true, |
|
207 |
22000000, 1000000, 1000000); |
|
208 |
return mode; |
|
209 |
} |
|
210 |
||
211 |
WifiMode |
|
212 |
WifiPhy::Get2mbb (void) |
|
213 |
{ |
|
214 |
static WifiMode mode = WifiModeFactory::CreateDqpsk ("wifib-2mbs", |
|
215 |
true, |
|
216 |
22000000, 2000000, 2000000); |
|
217 |
return mode; |
|
218 |
} |
|
219 |
||
220 |
WifiMode |
|
221 |
WifiPhy::Get5_5mbb (void) |
|
222 |
{ |
|
223 |
static WifiMode mode = WifiModeFactory::CreateDqpsk ("wifib-5.5mbs", |
|
224 |
true, |
|
225 |
22000000, 5500000, 5500000); |
|
226 |
return mode; |
|
227 |
} |
|
228 |
||
229 |
WifiMode |
|
230 |
WifiPhy::Get11mbb (void) |
|
231 |
{ |
|
232 |
static WifiMode mode = WifiModeFactory::CreateDqpsk ("wifib-11mbs", |
|
233 |
true, |
|
234 |
22000000, 11000000, 11000000); |
|
235 |
return mode; |
|
236 |
} |
|
237 |
||
238 |
||
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1974
diff
changeset
|
239 |
} // namespace ns3 |
4040
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
240 |
|
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
241 |
namespace { |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
242 |
|
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
243 |
static class Constructor |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
244 |
{ |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
245 |
public: |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
246 |
Constructor () { |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
247 |
ns3::WifiPhy::Get6mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
248 |
ns3::WifiPhy::Get9mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
249 |
ns3::WifiPhy::Get12mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
250 |
ns3::WifiPhy::Get18mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
251 |
ns3::WifiPhy::Get24mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
252 |
ns3::WifiPhy::Get36mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
253 |
ns3::WifiPhy::Get48mba (); |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
254 |
ns3::WifiPhy::Get54mba (); |
4470 | 255 |
ns3::WifiPhy::Get1mbb (); |
256 |
ns3::WifiPhy::Get2mbb (); |
|
257 |
ns3::WifiPhy::Get5_5mbb (); |
|
258 |
ns3::WifiPhy::Get11mbb (); |
|
4040
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
259 |
} |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
260 |
} g_constructor; |
df2f5e1ea15b
ensure that all wifi modes are registered
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4039
diff
changeset
|
261 |
} |