author | Ghada Badawy <gbadawy@gmail.com> |
Wed, 28 Jan 2015 10:11:32 -0800 | |
changeset 11174 | 780a43e4980c |
parent 11159 | b744c32b69bc |
child 11196 | 9d8c60f0db81 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7334
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
1889 | 2 |
/* |
3 |
* Copyright (c) 2005,2006 INRIA |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
1889 | 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> |
|
10139 | 19 |
* Author: Ghada Badawy <gbadawy@gmail.com> |
1889 | 20 |
*/ |
21 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
22 |
#include "yans-wifi-phy.h" |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
23 |
#include "yans-wifi-channel.h" |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
24 |
#include "wifi-mode.h" |
1920
1d4864775cf8
replace header mode with preamble mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1919
diff
changeset
|
25 |
#include "wifi-preamble.h" |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
26 |
#include "wifi-phy-state-helper.h" |
3902
9e048e073cf0
split the error rate model from the yans phy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3900
diff
changeset
|
27 |
#include "error-rate-model.h" |
1889 | 28 |
#include "ns3/simulator.h" |
29 |
#include "ns3/packet.h" |
|
1974
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
30 |
#include "ns3/assert.h" |
1979
d535a38b7fc4
convert TRACE to NS_LOG
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
31 |
#include "ns3/log.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
32 |
#include "ns3/double.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
33 |
#include "ns3/uinteger.h" |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
34 |
#include "ns3/enum.h" |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
35 |
#include "ns3/pointer.h" |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
36 |
#include "ns3/net-device.h" |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4039
diff
changeset
|
37 |
#include "ns3/trace-source-accessor.h" |
10139 | 38 |
#include "ns3/boolean.h" |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
39 |
#include "ampdu-tag.h" |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
40 |
#include <cmath> |
1889 | 41 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10883
diff
changeset
|
42 |
namespace ns3 { |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
43 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10883
diff
changeset
|
44 |
NS_LOG_COMPONENT_DEFINE ("YansWifiPhy"); |
1889 | 45 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10600
diff
changeset
|
46 |
NS_OBJECT_ENSURE_REGISTERED (YansWifiPhy); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
47 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
48 |
TypeId |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
49 |
YansWifiPhy::GetTypeId (void) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
50 |
{ |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
51 |
static TypeId tid = TypeId ("ns3::YansWifiPhy") |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
52 |
.SetParent<WifiPhy> () |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
53 |
.AddConstructor<YansWifiPhy> () |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
54 |
.AddAttribute ("EnergyDetectionThreshold", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
55 |
"The energy of a received signal should be higher than " |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
56 |
"this threshold (dbm) to allow the PHY layer to detect the signal.", |
5495
7f6bb3ad07b4
Bug 689: default energy detection and CCA thresholds are changed to be more realistic.
Pavel Boyko <boyko@iitp.ru>
parents:
5422
diff
changeset
|
57 |
DoubleValue (-96.0), |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
58 |
MakeDoubleAccessor (&YansWifiPhy::SetEdThreshold, |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
59 |
&YansWifiPhy::GetEdThreshold), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
60 |
MakeDoubleChecker<double> ()) |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
61 |
.AddAttribute ("CcaMode1Threshold", |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
62 |
"The energy of a received signal should be higher than " |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
63 |
"this threshold (dbm) to allow the PHY layer to declare CCA BUSY state", |
5495
7f6bb3ad07b4
Bug 689: default energy detection and CCA thresholds are changed to be more realistic.
Pavel Boyko <boyko@iitp.ru>
parents:
5422
diff
changeset
|
64 |
DoubleValue (-99.0), |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
65 |
MakeDoubleAccessor (&YansWifiPhy::SetCcaMode1Threshold, |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
66 |
&YansWifiPhy::GetCcaMode1Threshold), |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
67 |
MakeDoubleChecker<double> ()) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
68 |
.AddAttribute ("TxGain", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
69 |
"Transmission gain (dB).", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
70 |
DoubleValue (1.0), |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
71 |
MakeDoubleAccessor (&YansWifiPhy::SetTxGain, |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
72 |
&YansWifiPhy::GetTxGain), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
73 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
74 |
.AddAttribute ("RxGain", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
75 |
"Reception gain (dB).", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
76 |
DoubleValue (1.0), |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
77 |
MakeDoubleAccessor (&YansWifiPhy::SetRxGain, |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
78 |
&YansWifiPhy::GetRxGain), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
79 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
80 |
.AddAttribute ("TxPowerLevels", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
81 |
"Number of transmission power levels available between " |
7151 | 82 |
"TxPowerStart and TxPowerEnd included.", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
83 |
UintegerValue (1), |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
84 |
MakeUintegerAccessor (&YansWifiPhy::m_nTxPower), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
85 |
MakeUintegerChecker<uint32_t> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
86 |
.AddAttribute ("TxPowerEnd", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
87 |
"Maximum available transmission level (dbm).", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
88 |
DoubleValue (16.0206), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
89 |
MakeDoubleAccessor (&YansWifiPhy::SetTxPowerEnd, |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
90 |
&YansWifiPhy::GetTxPowerEnd), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
91 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
92 |
.AddAttribute ("TxPowerStart", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
93 |
"Minimum available transmission level (dbm).", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
94 |
DoubleValue (16.0206), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
95 |
MakeDoubleAccessor (&YansWifiPhy::SetTxPowerStart, |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
96 |
&YansWifiPhy::GetTxPowerStart), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
97 |
MakeDoubleChecker<double> ()) |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
98 |
.AddAttribute ("RxNoiseFigure", |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
99 |
"Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
100 |
" According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is " |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
101 |
"\"the difference in decibels (dB) between" |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
102 |
" the noise output of the actual receiver to the noise output of an " |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
103 |
" ideal receiver with the same overall gain and bandwidth when the receivers " |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
104 |
" are connected to sources at the standard noise temperature T0 (usually 290 K)\"." |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
105 |
" For", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
106 |
DoubleValue (7), |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
107 |
MakeDoubleAccessor (&YansWifiPhy::SetRxNoiseFigure, |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
108 |
&YansWifiPhy::GetRxNoiseFigure), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
109 |
MakeDoubleChecker<double> ()) |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
110 |
.AddAttribute ("State", "The state of the PHY layer", |
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
111 |
PointerValue (), |
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
112 |
MakePointerAccessor (&YansWifiPhy::m_state), |
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
113 |
MakePointerChecker<WifiPhyStateHelper> ()) |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
114 |
.AddAttribute ("ChannelSwitchDelay", |
9818
cfb12f56257a
fixed Bug 1677 - The annotation of YansWifiPhy needs correction
Junling Bu <linlinjavaer@gmail.com>
parents:
9063
diff
changeset
|
115 |
"Delay between two short frames transmitted on different frequencies.", |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
116 |
TimeValue (MicroSeconds (250)), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
117 |
MakeTimeAccessor (&YansWifiPhy::m_channelSwitchDelay), |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
118 |
MakeTimeChecker ()) |
5511
d77201fa5ee2
ChannelNumber attribute added to YansWifiPhy. Now it is possible to setup wifi channel using WifiPhyHelper::Set() method.
Pavel Boyko <boyko@iitp.ru>
parents:
5495
diff
changeset
|
119 |
.AddAttribute ("ChannelNumber", |
9818
cfb12f56257a
fixed Bug 1677 - The annotation of YansWifiPhy needs correction
Junling Bu <linlinjavaer@gmail.com>
parents:
9063
diff
changeset
|
120 |
"Channel center frequency = Channel starting frequency + 5 MHz * nch", |
5511
d77201fa5ee2
ChannelNumber attribute added to YansWifiPhy. Now it is possible to setup wifi channel using WifiPhyHelper::Set() method.
Pavel Boyko <boyko@iitp.ru>
parents:
5495
diff
changeset
|
121 |
UintegerValue (1), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
122 |
MakeUintegerAccessor (&YansWifiPhy::SetChannelNumber, |
5511
d77201fa5ee2
ChannelNumber attribute added to YansWifiPhy. Now it is possible to setup wifi channel using WifiPhyHelper::Set() method.
Pavel Boyko <boyko@iitp.ru>
parents:
5495
diff
changeset
|
123 |
&YansWifiPhy::GetChannelNumber), |
d77201fa5ee2
ChannelNumber attribute added to YansWifiPhy. Now it is possible to setup wifi channel using WifiPhyHelper::Set() method.
Pavel Boyko <boyko@iitp.ru>
parents:
5495
diff
changeset
|
124 |
MakeUintegerChecker<uint16_t> ()) |
10139 | 125 |
.AddAttribute ("Frequency", "The operating frequency.", |
126 |
UintegerValue (2407), |
|
127 |
MakeUintegerAccessor (&YansWifiPhy::GetFrequency, |
|
128 |
&YansWifiPhy::SetFrequency), |
|
129 |
MakeUintegerChecker<uint32_t> ()) |
|
130 |
.AddAttribute ("Transmitters", "The number of transmitters.", |
|
131 |
UintegerValue (1), |
|
132 |
MakeUintegerAccessor (&YansWifiPhy::GetNumberOfTransmitAntennas, |
|
133 |
&YansWifiPhy::SetNumberOfTransmitAntennas), |
|
134 |
MakeUintegerChecker<uint32_t> ()) |
|
11065
2e6f9e4be3a3
fix misspelled attribute and doxygen in YansWifiPhy
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11054
diff
changeset
|
135 |
.AddAttribute ("Receivers", "The number of receivers.", |
10139 | 136 |
UintegerValue (1), |
137 |
MakeUintegerAccessor (&YansWifiPhy::GetNumberOfReceiveAntennas, |
|
138 |
&YansWifiPhy::SetNumberOfReceiveAntennas), |
|
139 |
MakeUintegerChecker<uint32_t> ()) |
|
140 |
.AddAttribute ("ShortGuardEnabled", "Whether or not short guard interval is enabled.", |
|
141 |
BooleanValue (false), |
|
142 |
MakeBooleanAccessor (&YansWifiPhy::GetGuardInterval, |
|
143 |
&YansWifiPhy::SetGuardInterval), |
|
144 |
MakeBooleanChecker ()) |
|
145 |
.AddAttribute ("LdpcEnabled", "Whether or not LDPC is enabled.", |
|
146 |
BooleanValue (false), |
|
147 |
MakeBooleanAccessor (&YansWifiPhy::GetLdpc, |
|
148 |
&YansWifiPhy::SetLdpc), |
|
149 |
MakeBooleanChecker ()) |
|
150 |
.AddAttribute ("STBCEnabled", "Whether or not STBC is enabled.", |
|
151 |
BooleanValue (false), |
|
152 |
MakeBooleanAccessor (&YansWifiPhy::GetStbc, |
|
153 |
&YansWifiPhy::SetStbc), |
|
154 |
MakeBooleanChecker ()) |
|
155 |
.AddAttribute ("GreenfieldEnabled", "Whether or not STBC is enabled.", |
|
156 |
BooleanValue (false), |
|
157 |
MakeBooleanAccessor (&YansWifiPhy::GetGreenfield, |
|
158 |
&YansWifiPhy::SetGreenfield), |
|
159 |
MakeBooleanChecker ()) |
|
160 |
.AddAttribute ("ChannelBonding", "Whether 20MHz or 40MHz.", |
|
161 |
BooleanValue (false), |
|
162 |
MakeBooleanAccessor (&YansWifiPhy::GetChannelBonding, |
|
163 |
&YansWifiPhy::SetChannelBonding), |
|
164 |
MakeBooleanChecker ()) |
|
165 |
||
5511
d77201fa5ee2
ChannelNumber attribute added to YansWifiPhy. Now it is possible to setup wifi channel using WifiPhyHelper::Set() method.
Pavel Boyko <boyko@iitp.ru>
parents:
5495
diff
changeset
|
166 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
167 |
; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
168 |
return tid; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
169 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
170 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
171 |
YansWifiPhy::YansWifiPhy () |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
172 |
: m_initialized (false), |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
173 |
m_channelNumber (1), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
174 |
m_endRxEvent (), |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
175 |
m_channelStartingFrequency (0), |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
176 |
m_mpdusNum(0) |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
177 |
{ |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
178 |
NS_LOG_FUNCTION (this); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
179 |
m_random = CreateObject<UniformRandomVariable> (); |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
180 |
m_state = CreateObject<WifiPhyStateHelper> (); |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
181 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
182 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
183 |
YansWifiPhy::~YansWifiPhy () |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
184 |
{ |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
185 |
NS_LOG_FUNCTION (this); |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
186 |
} |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
187 |
|
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
188 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
189 |
YansWifiPhy::DoDispose (void) |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
190 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
191 |
NS_LOG_FUNCTION (this); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
192 |
m_channel = 0; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
193 |
m_deviceRateSet.clear (); |
10139 | 194 |
m_deviceMcsSet.clear(); |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
195 |
m_device = 0; |
5422
21a4f34518ff
bug 711: example mesh/mesh fails valgrind.
Andrey Mazo <mazo@iitp.ru>
parents:
5189
diff
changeset
|
196 |
m_mobility = 0; |
21a4f34518ff
bug 711: example mesh/mesh fails valgrind.
Andrey Mazo <mazo@iitp.ru>
parents:
5189
diff
changeset
|
197 |
m_state = 0; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
198 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
199 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
200 |
void |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
201 |
YansWifiPhy::DoInitialize () |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
202 |
{ |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
203 |
NS_LOG_FUNCTION (this); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
204 |
m_initialized = true; |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
205 |
} |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
206 |
|
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
207 |
void |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4715
diff
changeset
|
208 |
YansWifiPhy::ConfigureStandard (enum WifiPhyStandard standard) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
209 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
210 |
NS_LOG_FUNCTION (this << standard); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
211 |
switch (standard) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
212 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
213 |
case WIFI_PHY_STANDARD_80211a: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
214 |
Configure80211a (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
215 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
216 |
case WIFI_PHY_STANDARD_80211b: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
217 |
Configure80211b (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
218 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
219 |
case WIFI_PHY_STANDARD_80211g: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
220 |
Configure80211g (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
221 |
break; |
7482
35c01487f7f7
_Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
222 |
case WIFI_PHY_STANDARD_80211_10MHZ: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
223 |
Configure80211_10Mhz (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
224 |
break; |
7482
35c01487f7f7
_Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
225 |
case WIFI_PHY_STANDARD_80211_5MHZ: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
226 |
Configure80211_5Mhz (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
227 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
228 |
case WIFI_PHY_STANDARD_holland: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
229 |
ConfigureHolland (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
230 |
break; |
10139 | 231 |
case WIFI_PHY_STANDARD_80211n_2_4GHZ: |
232 |
m_channelStartingFrequency=2407; |
|
233 |
Configure80211n (); |
|
234 |
break; |
|
235 |
case WIFI_PHY_STANDARD_80211n_5GHZ: |
|
236 |
m_channelStartingFrequency=5e3; |
|
237 |
Configure80211n (); |
|
238 |
break; |
|
239 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
240 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
241 |
NS_ASSERT (false); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
242 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
243 |
} |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
244 |
} |
1889 | 245 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
246 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
247 |
void |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
248 |
YansWifiPhy::SetRxNoiseFigure (double noiseFigureDb) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
249 |
{ |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
250 |
NS_LOG_FUNCTION (this << noiseFigureDb); |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
251 |
m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb)); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
252 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
253 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
254 |
YansWifiPhy::SetTxPowerStart (double start) |
1889 | 255 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
256 |
NS_LOG_FUNCTION (this << start); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
257 |
m_txPowerBaseDbm = start; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
258 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
259 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
260 |
YansWifiPhy::SetTxPowerEnd (double end) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
261 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
262 |
NS_LOG_FUNCTION (this << end); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
263 |
m_txPowerEndDbm = end; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
264 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
265 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
266 |
YansWifiPhy::SetNTxPower (uint32_t n) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
267 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
268 |
NS_LOG_FUNCTION (this << n); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
269 |
m_nTxPower = n; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
270 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
271 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
272 |
YansWifiPhy::SetTxGain (double gain) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
273 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
274 |
NS_LOG_FUNCTION (this << gain); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
275 |
m_txGainDb = gain; |
1889 | 276 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
277 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
278 |
YansWifiPhy::SetRxGain (double gain) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
279 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
280 |
NS_LOG_FUNCTION (this << gain); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
281 |
m_rxGainDb = gain; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
282 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
283 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
284 |
YansWifiPhy::SetEdThreshold (double threshold) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
285 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
286 |
NS_LOG_FUNCTION (this << threshold); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
287 |
m_edThresholdW = DbmToW (threshold); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
288 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
289 |
void |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
290 |
YansWifiPhy::SetCcaMode1Threshold (double threshold) |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
291 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
292 |
NS_LOG_FUNCTION (this << threshold); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
293 |
m_ccaMode1ThresholdW = DbmToW (threshold); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
294 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
295 |
void |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
296 |
YansWifiPhy::SetErrorRateModel (Ptr<ErrorRateModel> rate) |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
297 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
298 |
m_interference.SetErrorRateModel (rate); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
299 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
300 |
void |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
301 |
YansWifiPhy::SetDevice (Ptr<Object> device) |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
302 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
303 |
m_device = device; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
304 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
305 |
void |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
306 |
YansWifiPhy::SetMobility (Ptr<Object> mobility) |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
307 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
308 |
m_mobility = mobility; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
309 |
} |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
310 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
311 |
double |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
312 |
YansWifiPhy::GetRxNoiseFigure (void) const |
2155
194dd8bdcf56
add WifiPhy::GetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2150
diff
changeset
|
313 |
{ |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
314 |
return RatioToDb (m_interference.GetNoiseFigure ()); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
315 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
316 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
317 |
YansWifiPhy::GetTxPowerStart (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
318 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
319 |
return m_txPowerBaseDbm; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
320 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
321 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
322 |
YansWifiPhy::GetTxPowerEnd (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
323 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
324 |
return m_txPowerEndDbm; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
325 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
326 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
327 |
YansWifiPhy::GetTxGain (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
328 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
329 |
return m_txGainDb; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
330 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
331 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
332 |
YansWifiPhy::GetRxGain (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
333 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
334 |
return m_rxGainDb; |
2155
194dd8bdcf56
add WifiPhy::GetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2150
diff
changeset
|
335 |
} |
194dd8bdcf56
add WifiPhy::GetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2150
diff
changeset
|
336 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
337 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
338 |
YansWifiPhy::GetEdThreshold (void) const |
2055
8899d6ef5d52
phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1999
diff
changeset
|
339 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
340 |
return WToDbm (m_edThresholdW); |
2055
8899d6ef5d52
phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1999
diff
changeset
|
341 |
} |
1889 | 342 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
343 |
double |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
344 |
YansWifiPhy::GetCcaMode1Threshold (void) const |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
345 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
346 |
return WToDbm (m_ccaMode1ThresholdW); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
347 |
} |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
348 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
349 |
Ptr<ErrorRateModel> |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
350 |
YansWifiPhy::GetErrorRateModel (void) const |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
351 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
352 |
return m_interference.GetErrorRateModel (); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
353 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
354 |
Ptr<Object> |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
355 |
YansWifiPhy::GetDevice (void) const |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
356 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
357 |
return m_device; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
358 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
359 |
Ptr<Object> |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
360 |
YansWifiPhy::GetMobility (void) |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
361 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
362 |
return m_mobility; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
363 |
} |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
364 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
365 |
double |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
366 |
YansWifiPhy::CalculateSnr (WifiMode txMode, double ber) const |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
367 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
368 |
return m_interference.GetErrorRateModel ()->CalculateSnr (txMode, ber); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
369 |
} |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
370 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
371 |
Ptr<WifiChannel> |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
372 |
YansWifiPhy::GetChannel (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
373 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
374 |
return m_channel; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
375 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
376 |
void |
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
377 |
YansWifiPhy::SetChannel (Ptr<YansWifiChannel> channel) |
1889 | 378 |
{ |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
379 |
m_channel = channel; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
380 |
m_channel->Add (this); |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
381 |
} |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
382 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
383 |
void |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
384 |
YansWifiPhy::SetChannelNumber (uint16_t nch) |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
385 |
{ |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
386 |
if (!m_initialized) |
5512
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
387 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
388 |
// this is not channel switch, this is initialization |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
389 |
NS_LOG_DEBUG ("start at channel " << nch); |
5512
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
390 |
m_channelNumber = nch; |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
391 |
return; |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
392 |
} |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
393 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
394 |
NS_ASSERT (!IsStateSwitching ()); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
395 |
switch (m_state->GetState ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
396 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
397 |
case YansWifiPhy::RX: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
398 |
NS_LOG_DEBUG ("drop packet because of channel switching while reception"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
399 |
m_endRxEvent.Cancel (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
400 |
goto switchChannel; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
401 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
402 |
case YansWifiPhy::TX: |
5189 | 403 |
NS_LOG_DEBUG ("channel switching postponed until end of current transmission"); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
404 |
Simulator::Schedule (GetDelayUntilIdle (), &YansWifiPhy::SetChannelNumber, this, nch); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
405 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
406 |
case YansWifiPhy::CCA_BUSY: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
407 |
case YansWifiPhy::IDLE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
408 |
goto switchChannel; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
409 |
break; |
10883
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
410 |
case YansWifiPhy::SLEEP: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
411 |
NS_LOG_DEBUG ("channel switching ignored in sleep mode"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
412 |
break; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
413 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
414 |
NS_ASSERT (false); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
415 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
416 |
} |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
417 |
|
5189 | 418 |
return; |
419 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
420 |
switchChannel: |
5189 | 421 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
422 |
NS_LOG_DEBUG ("switching channel " << m_channelNumber << " -> " << nch); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
423 |
m_state->SwitchToChannelSwitching (m_channelSwitchDelay); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
424 |
m_interference.EraseEvents (); |
5189 | 425 |
/* |
426 |
* Needed here to be able to correctly sensed the medium for the first |
|
427 |
* time after the switching. The actual switching is not performed until |
|
428 |
* after m_channelSwitchDelay. Packets received during the switching |
|
429 |
* state are added to the event list and are employed later to figure |
|
430 |
* out the state of the medium after the switching. |
|
431 |
*/ |
|
432 |
m_channelNumber = nch; |
|
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
433 |
} |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
434 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
435 |
uint16_t |
11159
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
436 |
YansWifiPhy::GetChannelNumber (void) const |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
437 |
{ |
5189 | 438 |
return m_channelNumber; |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
439 |
} |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
440 |
|
11159
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
441 |
Time |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
442 |
YansWifiPhy::GetChannelSwitchDelay (void) const |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
443 |
{ |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
444 |
return m_channelSwitchDelay; |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
445 |
} |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
446 |
|
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
447 |
double |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
448 |
YansWifiPhy::GetChannelFrequencyMhz () const |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
449 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
450 |
return m_channelStartingFrequency + 5 * GetChannelNumber (); |
1889 | 451 |
} |
452 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
453 |
void |
10883
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
454 |
YansWifiPhy::SetSleepMode (void) |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
455 |
{ |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
456 |
NS_LOG_FUNCTION (this); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
457 |
switch (m_state->GetState ()) |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
458 |
{ |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
459 |
case YansWifiPhy::TX: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
460 |
NS_LOG_DEBUG ("setting sleep mode postponed until end of current transmission"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
461 |
Simulator::Schedule (GetDelayUntilIdle (), &YansWifiPhy::SetSleepMode, this); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
462 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
463 |
case YansWifiPhy::RX: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
464 |
NS_LOG_DEBUG ("setting sleep mode postponed until end of current reception"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
465 |
Simulator::Schedule (GetDelayUntilIdle (), &YansWifiPhy::SetSleepMode, this); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
466 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
467 |
case YansWifiPhy::SWITCHING: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
468 |
NS_LOG_DEBUG ("setting sleep mode postponed until end of channel switching"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
469 |
Simulator::Schedule (GetDelayUntilIdle (), &YansWifiPhy::SetSleepMode, this); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
470 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
471 |
case YansWifiPhy::CCA_BUSY: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
472 |
case YansWifiPhy::IDLE: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
473 |
NS_LOG_DEBUG ("setting sleep mode"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
474 |
m_state->SwitchToSleep (); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
475 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
476 |
case YansWifiPhy::SLEEP: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
477 |
NS_LOG_DEBUG ("already in sleep mode"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
478 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
479 |
default: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
480 |
NS_ASSERT (false); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
481 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
482 |
} |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
483 |
} |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
484 |
|
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
485 |
void |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
486 |
YansWifiPhy::ResumeFromSleep (void) |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
487 |
{ |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
488 |
NS_LOG_FUNCTION (this); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
489 |
switch (m_state->GetState ()) |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
490 |
{ |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
491 |
case YansWifiPhy::TX: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
492 |
case YansWifiPhy::RX: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
493 |
case YansWifiPhy::IDLE: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
494 |
case YansWifiPhy::CCA_BUSY: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
495 |
case YansWifiPhy::SWITCHING: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
496 |
NS_LOG_DEBUG ("not in sleep mode, there is nothing to resume"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
497 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
498 |
case YansWifiPhy::SLEEP: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
499 |
NS_LOG_DEBUG ("resuming from sleep mode"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
500 |
Time delayUntilCcaEnd = m_interference.GetEnergyDuration (m_ccaMode1ThresholdW); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
501 |
m_state->SwitchFromSleep (delayUntilCcaEnd); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
502 |
break; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
503 |
} |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
504 |
} |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
505 |
|
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
506 |
void |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
507 |
YansWifiPhy::SetReceiveOkCallback (RxOkCallback callback) |
1889 | 508 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
509 |
m_state->SetReceiveOkCallback (callback); |
1889 | 510 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
511 |
void |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
512 |
YansWifiPhy::SetReceiveErrorCallback (RxErrorCallback callback) |
1889 | 513 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
514 |
m_state->SetReceiveErrorCallback (callback); |
1889 | 515 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
516 |
void |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
517 |
YansWifiPhy::StartReceivePacket (Ptr<Packet> packet, |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
518 |
double rxPowerDbm, |
10139 | 519 |
WifiTxVector txVector, |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
520 |
enum WifiPreamble preamble, |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
521 |
uint8_t packetType, Time rxDuration) |
1889 | 522 |
{ |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
523 |
NS_LOG_FUNCTION (this << packet << rxPowerDbm << txVector.GetMode()<< preamble << (uint32_t)packetType); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
524 |
AmpduTag ampduTag; |
2071
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
525 |
rxPowerDbm += m_rxGainDb; |
1988
210701141b08
convert to and from dbms when needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1979
diff
changeset
|
526 |
double rxPowerW = DbmToW (rxPowerDbm); |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
527 |
//Time rxDuration = CalculateTxDuration (packet->GetSize (), txVector, preamble, GetFrequency(), packetType, 1); |
10600
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
528 |
WifiMode txMode = txVector.GetMode(); |
1889 | 529 |
Time endRx = Simulator::Now () + rxDuration; |
530 |
||
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
531 |
Ptr<InterferenceHelper::Event> event; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
532 |
event = m_interference.Add (packet->GetSize (), |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
533 |
txMode, |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
534 |
preamble, |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
535 |
rxDuration, |
10139 | 536 |
rxPowerW, |
537 |
txVector); // we need it to calculate duration of HT training symbols |
|
1889 | 538 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
539 |
switch (m_state->GetState ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
540 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
541 |
case YansWifiPhy::SWITCHING: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
542 |
NS_LOG_DEBUG ("drop packet because of channel switching"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
543 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
544 |
/* |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
545 |
* Packets received on the upcoming channel are added to the event list |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
546 |
* during the switching state. This way the medium can be correctly sensed |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
547 |
* when the device listens to the channel for the first time after the |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
548 |
* switching e.g. after channel switching, the channel may be sensed as |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
549 |
* busy due to other devices' tramissions started before the end of |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
550 |
* the switching. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
551 |
*/ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
552 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
553 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
554 |
// that packet will be noise _after_ the completion of the |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
555 |
// channel switching. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
556 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
557 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
558 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
559 |
case YansWifiPhy::RX: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
560 |
NS_LOG_DEBUG ("drop packet because already in Rx (power=" << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
561 |
rxPowerW << "W)"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
562 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
563 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
564 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
565 |
// that packet will be noise _after_ the reception of the |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
566 |
// currently-received packet. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
567 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
568 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
569 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
570 |
case YansWifiPhy::TX: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
571 |
NS_LOG_DEBUG ("drop packet because already in Tx (power=" << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
572 |
rxPowerW << "W)"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
573 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
574 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
575 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
576 |
// that packet will be noise _after_ the transmission of the |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
577 |
// currently-transmitted packet. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
578 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
579 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
580 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
581 |
case YansWifiPhy::CCA_BUSY: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
582 |
case YansWifiPhy::IDLE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
583 |
if (rxPowerW > m_edThresholdW) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
584 |
{ |
10801
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
585 |
if (IsModeSupported (txMode) || IsMcsSupported(txMode)) |
10600
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
586 |
{ |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
587 |
if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0) |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
588 |
{ |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
589 |
//received the first MPDU in an MPDU |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
590 |
m_mpdusNum = ampduTag.GetNoOfMpdus()-1; |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
591 |
} |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
592 |
else if (preamble == WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum > 0) |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
593 |
{ |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
594 |
//received the other MPDUs that are part of the A-MPDU |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
595 |
if (ampduTag.GetNoOfMpdus() < m_mpdusNum) |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
596 |
{ |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
597 |
NS_LOG_DEBUG ("Missing MPDU from the A-MPDU " << m_mpdusNum - ampduTag.GetNoOfMpdus()); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
598 |
m_mpdusNum = ampduTag.GetNoOfMpdus(); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
599 |
} |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
600 |
else |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
601 |
m_mpdusNum--; |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
602 |
} |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
603 |
else if (preamble != WIFI_PREAMBLE_NONE && m_mpdusNum > 0 ) |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
604 |
{ |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
605 |
NS_LOG_DEBUG ("Didn't receive the last MPDUs from an A-MPDU " << m_mpdusNum); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
606 |
m_mpdusNum = 0; |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
607 |
} |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
608 |
else if (preamble == WIFI_PREAMBLE_NONE && m_mpdusNum == 0) |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
609 |
{ |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
610 |
NS_LOG_DEBUG ("drop packet because no preamble has been received"); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
611 |
NotifyRxDrop (packet); |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
612 |
goto maybeCcaBusy; |
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
613 |
} |
10600
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
614 |
NS_LOG_DEBUG ("sync to signal (power=" << rxPowerW << "W)"); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
615 |
// sync to signal |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
616 |
m_state->SwitchToRx (rxDuration); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
617 |
NS_ASSERT (m_endRxEvent.IsExpired ()); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
618 |
NotifyRxBegin (packet); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
619 |
m_interference.NotifyRxStart (); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
620 |
m_endRxEvent = Simulator::Schedule (rxDuration, &YansWifiPhy::EndReceive, this, |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
621 |
packet, |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
622 |
event); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
623 |
} |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
624 |
else |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
625 |
{ |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
626 |
NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")"); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
627 |
NotifyRxDrop (packet); |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
628 |
goto maybeCcaBusy; |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
629 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
630 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
631 |
else |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
632 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
633 |
NS_LOG_DEBUG ("drop packet because signal power too Small (" << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
634 |
rxPowerW << "<" << m_edThresholdW << ")"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
635 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
636 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
637 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
638 |
break; |
10883
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
639 |
case YansWifiPhy::SLEEP: |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
640 |
NS_LOG_DEBUG ("drop packet because in sleep mode"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
641 |
NotifyRxDrop (packet); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
642 |
break; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
643 |
} |
1889 | 644 |
|
645 |
return; |
|
646 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
647 |
maybeCcaBusy: |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
648 |
// We are here because we have received the first bit of a packet and we are |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
649 |
// not going to be able to synchronize on it |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
650 |
// In this model, CCA becomes busy when the aggregation of all signals as |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
651 |
// tracked by the InterferenceHelper class is higher than the CcaBusyThreshold |
1889 | 652 |
|
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
653 |
Time delayUntilCcaEnd = m_interference.GetEnergyDuration (m_ccaMode1ThresholdW); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
654 |
if (!delayUntilCcaEnd.IsZero ()) |
1889 | 655 |
{ |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
656 |
m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd); |
1889 | 657 |
} |
658 |
} |
|
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4039
diff
changeset
|
659 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
660 |
void |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
661 |
YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, WifiPreamble preamble, uint8_t packetType) |
1889 | 662 |
{ |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
663 |
NS_LOG_FUNCTION (this << packet << txVector.GetMode() << preamble << (uint32_t)txVector.GetTxPowerLevel() << (uint32_t)packetType); |
1889 | 664 |
/* Transmission can happen if: |
665 |
* - we are syncing on a packet. It is the responsability of the |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
666 |
* MAC layer to avoid doing this but the PHY does nothing to |
1889 | 667 |
* prevent it. |
668 |
* - we are idle |
|
669 |
*/ |
|
5189 | 670 |
NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ()); |
1889 | 671 |
|
10883
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
672 |
if (m_state->IsStateSleep ()) |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
673 |
{ |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
674 |
NS_LOG_DEBUG ("Dropping packet because in sleep mode"); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
675 |
NotifyTxDrop (packet); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
676 |
return; |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
677 |
} |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
678 |
|
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
679 |
Time txDuration = CalculateTxDuration (packet->GetSize (), txVector, preamble, GetFrequency(), packetType, 1); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
680 |
if (m_state->IsStateRx ()) |
3897
44645cec42f2
split state management in a helper class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3893
diff
changeset
|
681 |
{ |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
682 |
m_endRxEvent.Cancel (); |
6474
0894b2a245e9
fixed Bug 799 - Interference helper is too slow
Kirill Andreev <andreev@iitp.ru>
parents:
6372
diff
changeset
|
683 |
m_interference.NotifyRxEnd (); |
3897
44645cec42f2
split state management in a helper class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3893
diff
changeset
|
684 |
} |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
685 |
NotifyTxBegin (packet); |
11078
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
686 |
uint32_t dataRate500KbpsUnits; |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
687 |
if (txVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT) |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
688 |
{ |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
689 |
dataRate500KbpsUnits = 128 + WifiModeToMcs (txVector.GetMode()); |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
690 |
} |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
691 |
else |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
692 |
{ |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
693 |
dataRate500KbpsUnits = txVector.GetMode().GetDataRate () * txVector.GetNss() / 500000; |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
694 |
} |
4492
3ebeb7bf3c15
added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents:
4470
diff
changeset
|
695 |
bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble); |
10139 | 696 |
NotifyMonitorSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, txVector.GetTxPowerLevel()); |
10883
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
697 |
m_state->SwitchToTx (txDuration, packet, GetPowerDbm (txVector.GetTxPowerLevel()), txVector, preamble); |
11174
780a43e4980c
add MPDU aggregation (with contributions from Sebastien Deronne and Ioannis Selinis)
Ghada Badawy <gbadawy@gmail.com>
parents:
11159
diff
changeset
|
698 |
m_channel->Send (this, packet, GetPowerDbm (txVector.GetTxPowerLevel()) + m_txGainDb, txVector, preamble, packetType, txDuration); |
1889 | 699 |
} |
700 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
701 |
uint32_t |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
702 |
YansWifiPhy::GetNModes (void) const |
1889 | 703 |
{ |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
704 |
return m_deviceRateSet.size (); |
1889 | 705 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
706 |
WifiMode |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
707 |
YansWifiPhy::GetMode (uint32_t mode) const |
1889 | 708 |
{ |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
709 |
return m_deviceRateSet[mode]; |
1889 | 710 |
} |
10600
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
711 |
bool |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
712 |
YansWifiPhy::IsModeSupported (WifiMode mode) const |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
713 |
{ |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
714 |
for (uint32_t i = 0; i < GetNModes (); i++) |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
715 |
{ |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
716 |
if (mode == GetMode (i)) |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
717 |
{ |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
718 |
return true; |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
719 |
} |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
720 |
} |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
721 |
return false; |
48c3c6b355a1
Bug 1848 - yans-wifi-phy can receive frames sent using unsupported mode
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10424
diff
changeset
|
722 |
} |
10801
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
723 |
bool |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
724 |
YansWifiPhy::IsMcsSupported (WifiMode mode) |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
725 |
{ |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
726 |
for (uint32_t i = 0; i < GetNMcs (); i++) |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
727 |
{ |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
728 |
if (mode == McsToWifiMode(GetMcs (i))) |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
729 |
{ |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
730 |
return true; |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
731 |
} |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
732 |
} |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
733 |
return false; |
02d564a4c823
Bug 1907- Add IsMcsSupported()
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
10652
diff
changeset
|
734 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
735 |
uint32_t |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
736 |
YansWifiPhy::GetNTxPower (void) const |
1889 | 737 |
{ |
738 |
return m_nTxPower; |
|
739 |
} |
|
740 |
||
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
741 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
742 |
YansWifiPhy::Configure80211a (void) |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
743 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
744 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
745 |
m_channelStartingFrequency = 5e3; // 5.000 GHz |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6342
diff
changeset
|
746 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
747 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate6Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
748 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate9Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
749 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate12Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
750 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate18Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
751 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate24Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
752 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate36Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
753 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate48Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
754 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate54Mbps ()); |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
755 |
} |
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
756 |
|
4470 | 757 |
|
758 |
void |
|
759 |
YansWifiPhy::Configure80211b (void) |
|
760 |
{ |
|
761 |
NS_LOG_FUNCTION (this); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
762 |
m_channelStartingFrequency = 2407; // 2.407 GHz |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6342
diff
changeset
|
763 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
764 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate1Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
765 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate2Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
766 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate5_5Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
767 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); |
4470 | 768 |
} |
769 |
||
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
770 |
void |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
771 |
YansWifiPhy::Configure80211g (void) |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
772 |
{ |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
773 |
NS_LOG_FUNCTION (this); |
6644 | 774 |
m_channelStartingFrequency = 2407; // 2.407 GHz |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
775 |
|
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
776 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate1Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
777 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate2Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
778 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate5_5Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
779 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate6Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
780 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate9Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
781 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
782 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate12Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
783 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate18Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
784 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate24Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
785 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate36Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
786 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate48Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
787 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate54Mbps ()); |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
788 |
} |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
789 |
|
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
790 |
void |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
791 |
YansWifiPhy::Configure80211_10Mhz (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
792 |
{ |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
793 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
794 |
m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6342
diff
changeset
|
795 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
796 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate3MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
797 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate4_5MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
798 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate6MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
799 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate9MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
800 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate12MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
801 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate18MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
802 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate24MbpsBW10MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
803 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate27MbpsBW10MHz ()); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
804 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
805 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
806 |
void |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
807 |
YansWifiPhy::Configure80211_5Mhz (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
808 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
809 |
NS_LOG_FUNCTION (this); |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
810 |
m_channelStartingFrequency = 5e3; // 5.000 GHz, suppose 802.11a |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6342
diff
changeset
|
811 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
812 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate1_5MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
813 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate2_25MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
814 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate3MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
815 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate4_5MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
816 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate6MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
817 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate9MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
818 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate12MbpsBW5MHz ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
819 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate13_5MbpsBW5MHz ()); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
820 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
821 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
822 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
823 |
YansWifiPhy::ConfigureHolland (void) |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
824 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
825 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
826 |
m_channelStartingFrequency = 5e3; // 5.000 GHz |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
827 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate6Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
828 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate12Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
829 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate18Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
830 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate36Mbps ()); |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
831 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate54Mbps ()); |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
832 |
} |
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
833 |
|
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
834 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
835 |
YansWifiPhy::RegisterListener (WifiPhyListener *listener) |
1889 | 836 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
837 |
m_state->RegisterListener (listener); |
1889 | 838 |
} |
839 |
||
11159
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
840 |
void |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
841 |
YansWifiPhy::UnregisterListener (WifiPhyListener *listener) |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
842 |
{ |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
843 |
m_state->UnregisterListener (listener); |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
844 |
} |
b744c32b69bc
patch to support IEEE 1609.4 MAC extension in wave module
Junling Bu <linlinjavaer@gmail.com>
parents:
11078
diff
changeset
|
845 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
846 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
847 |
YansWifiPhy::IsStateCcaBusy (void) |
1889 | 848 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
849 |
return m_state->IsStateCcaBusy (); |
1889 | 850 |
} |
851 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
852 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
853 |
YansWifiPhy::IsStateIdle (void) |
1889 | 854 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
855 |
return m_state->IsStateIdle (); |
1889 | 856 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
857 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
858 |
YansWifiPhy::IsStateBusy (void) |
1889 | 859 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
860 |
return m_state->IsStateBusy (); |
1889 | 861 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
862 |
bool |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
863 |
YansWifiPhy::IsStateRx (void) |
1889 | 864 |
{ |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
865 |
return m_state->IsStateRx (); |
1889 | 866 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
867 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
868 |
YansWifiPhy::IsStateTx (void) |
1889 | 869 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
870 |
return m_state->IsStateTx (); |
1889 | 871 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
872 |
bool |
5189 | 873 |
YansWifiPhy::IsStateSwitching (void) |
874 |
{ |
|
875 |
return m_state->IsStateSwitching (); |
|
876 |
} |
|
10883
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
877 |
bool |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
878 |
YansWifiPhy::IsStateSleep (void) |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
879 |
{ |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
880 |
return m_state->IsStateSleep (); |
d919e7194e23
add support for a Wifi sleep mode
Stefano Avallone <stefano.avallone@unina.it>
parents:
10801
diff
changeset
|
881 |
} |
1889 | 882 |
|
883 |
Time |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
884 |
YansWifiPhy::GetStateDuration (void) |
1889 | 885 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
886 |
return m_state->GetStateDuration (); |
1889 | 887 |
} |
888 |
Time |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
889 |
YansWifiPhy::GetDelayUntilIdle (void) |
1889 | 890 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
891 |
return m_state->GetDelayUntilIdle (); |
1889 | 892 |
} |
893 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
894 |
Time |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
895 |
YansWifiPhy::GetLastRxStartTime (void) const |
2139
a2cf93c741c3
add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2083
diff
changeset
|
896 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
897 |
return m_state->GetLastRxStartTime (); |
2139
a2cf93c741c3
add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2083
diff
changeset
|
898 |
} |
a2cf93c741c3
add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2083
diff
changeset
|
899 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
900 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
901 |
YansWifiPhy::DbToRatio (double dB) const |
1889 | 902 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
903 |
double ratio = std::pow (10.0, dB / 10.0); |
1889 | 904 |
return ratio; |
905 |
} |
|
906 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
907 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
908 |
YansWifiPhy::DbmToW (double dBm) const |
1889 | 909 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
910 |
double mW = std::pow (10.0, dBm / 10.0); |
1889 | 911 |
return mW / 1000.0; |
912 |
} |
|
913 |
||
914 |
double |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
915 |
YansWifiPhy::WToDbm (double w) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
916 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
917 |
return 10.0 * std::log10 (w * 1000.0); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
918 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
919 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
920 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
921 |
YansWifiPhy::RatioToDb (double ratio) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
922 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
923 |
return 10.0 * std::log10 (ratio); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
924 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
925 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
926 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
927 |
YansWifiPhy::GetEdThresholdW (void) const |
1889 | 928 |
{ |
929 |
return m_edThresholdW; |
|
930 |
} |
|
931 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
932 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
933 |
YansWifiPhy::GetPowerDbm (uint8_t power) const |
1889 | 934 |
{ |
1974
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
935 |
NS_ASSERT (m_txPowerBaseDbm <= m_txPowerEndDbm); |
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
936 |
NS_ASSERT (m_nTxPower > 0); |
6342 | 937 |
double dbm; |
938 |
if (m_nTxPower > 1) |
|
939 |
{ |
|
940 |
dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1); |
|
941 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
942 |
else |
6342 | 943 |
{ |
944 |
NS_ASSERT_MSG (m_txPowerBaseDbm == m_txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1"); |
|
945 |
dbm = m_txPowerBaseDbm; |
|
946 |
} |
|
1889 | 947 |
return dbm; |
948 |
} |
|
949 |
||
950 |
void |
|
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
951 |
YansWifiPhy::EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
1889 | 952 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
953 |
NS_LOG_FUNCTION (this << packet << event); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
954 |
NS_ASSERT (IsStateRx ()); |
1974
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
955 |
NS_ASSERT (event->GetEndTime () == Simulator::Now ()); |
1889 | 956 |
|
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
957 |
struct InterferenceHelper::SnrPer snrPer; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
958 |
snrPer = m_interference.CalculateSnrPer (event); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
959 |
m_interference.NotifyRxEnd (); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
960 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
961 |
NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate ()) << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
962 |
", snr=" << snrPer.snr << ", per=" << snrPer.per << ", size=" << packet->GetSize ()); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
963 |
if (m_random->GetValue () > snrPer.per) |
1889 | 964 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
965 |
NotifyRxEnd (packet); |
11078
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
966 |
uint32_t dataRate500KbpsUnits; |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
967 |
if ((event->GetPayloadMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)) |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
968 |
{ |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
969 |
dataRate500KbpsUnits = 128 + WifiModeToMcs (event->GetPayloadMode ()); |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
970 |
} |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
971 |
else |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
972 |
{ |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
973 |
dataRate500KbpsUnits = event->GetPayloadMode ().GetDataRate () * event->GetTxVector().GetNss()/ 500000; |
f7c64e56df22
bug 2020: Erroneous MCS field in 802.11n PCAP files
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11065
diff
changeset
|
974 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
975 |
bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ()); |
4492
3ebeb7bf3c15
added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents:
4470
diff
changeset
|
976 |
double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30; |
7252
c8200621e252
rerun check-style.py with uncrustify-0.58
Tom Henderson <tomh@tomh.org>
parents:
7151
diff
changeset
|
977 |
double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30; |
7334
21b6b53ba0d5
[Bug 827] Rename promisc trace to monitor in WifiPhy
Ruben Merz <ruben@net.t-labs.tu-berlin.de>
parents:
7252
diff
changeset
|
978 |
NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
979 |
m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ()); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
980 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
981 |
else |
1889 | 982 |
{ |
983 |
/* failure. */ |
|
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
984 |
NotifyRxDrop (packet); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
985 |
m_state->SwitchFromRxEndError (packet, snrPer.snr); |
1889 | 986 |
} |
987 |
} |
|
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
988 |
|
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
989 |
int64_t |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
990 |
YansWifiPhy::AssignStreams (int64_t stream) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
991 |
{ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
992 |
NS_LOG_FUNCTION (this << stream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
993 |
m_random->SetStream (stream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
994 |
return 1; |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
995 |
} |
10139 | 996 |
|
997 |
void |
|
998 |
YansWifiPhy::SetFrequency (uint32_t freq) |
|
999 |
{ |
|
1000 |
m_channelStartingFrequency = freq; |
|
1001 |
} |
|
1002 |
||
1003 |
void |
|
1004 |
YansWifiPhy::SetNumberOfTransmitAntennas (uint32_t tx) |
|
1005 |
{ |
|
1006 |
m_numberOfTransmitters = tx; |
|
1007 |
} |
|
1008 |
void |
|
1009 |
YansWifiPhy::SetNumberOfReceiveAntennas (uint32_t rx) |
|
1010 |
{ |
|
1011 |
m_numberOfReceivers = rx; |
|
1012 |
} |
|
1013 |
||
1014 |
void |
|
1015 |
YansWifiPhy::SetLdpc (bool Ldpc) |
|
1016 |
{ |
|
1017 |
m_ldpc = Ldpc; |
|
1018 |
} |
|
1019 |
||
1020 |
void |
|
1021 |
YansWifiPhy::SetStbc (bool stbc) |
|
1022 |
{ |
|
1023 |
m_stbc = stbc; |
|
1024 |
} |
|
1025 |
||
1026 |
void |
|
1027 |
YansWifiPhy::SetGreenfield (bool greenfield) |
|
1028 |
{ |
|
1029 |
m_greenfield = greenfield; |
|
1030 |
} |
|
1031 |
bool |
|
1032 |
YansWifiPhy::GetGuardInterval (void) const |
|
1033 |
{ |
|
1034 |
return m_guardInterval; |
|
1035 |
} |
|
1036 |
void |
|
10424
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
1037 |
YansWifiPhy::SetGuardInterval (bool guardInterval) |
10139 | 1038 |
{ |
10424
9d29c9a5ddcb
doxygen warnings for wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents:
10410
diff
changeset
|
1039 |
m_guardInterval = guardInterval; |
10139 | 1040 |
} |
1041 |
||
1042 |
uint32_t |
|
1043 |
YansWifiPhy::GetFrequency (void) const |
|
1044 |
{ |
|
1045 |
return m_channelStartingFrequency; |
|
1046 |
} |
|
1047 |
||
1048 |
uint32_t |
|
1049 |
YansWifiPhy::GetNumberOfTransmitAntennas (void) const |
|
1050 |
{ |
|
1051 |
return m_numberOfTransmitters; |
|
1052 |
} |
|
1053 |
uint32_t |
|
1054 |
YansWifiPhy::GetNumberOfReceiveAntennas (void) const |
|
1055 |
{ |
|
1056 |
return m_numberOfReceivers; |
|
1057 |
} |
|
1058 |
||
1059 |
bool |
|
1060 |
YansWifiPhy::GetLdpc (void) const |
|
1061 |
{ |
|
1062 |
return m_ldpc; |
|
1063 |
} |
|
1064 |
bool |
|
1065 |
YansWifiPhy::GetStbc (void) const |
|
1066 |
{ |
|
1067 |
return m_stbc; |
|
1068 |
} |
|
1069 |
||
1070 |
bool |
|
1071 |
YansWifiPhy::GetGreenfield (void) const |
|
1072 |
{ |
|
1073 |
return m_greenfield; |
|
1074 |
} |
|
1075 |
||
1076 |
bool |
|
1077 |
YansWifiPhy::GetChannelBonding(void) const |
|
1078 |
{ |
|
1079 |
return m_channelBonding; |
|
1080 |
} |
|
1081 |
||
1082 |
void |
|
1083 |
YansWifiPhy::SetChannelBonding(bool channelbonding) |
|
1084 |
{ |
|
1085 |
m_channelBonding= channelbonding; |
|
1086 |
} |
|
1087 |
||
1088 |
void |
|
1089 |
YansWifiPhy::Configure80211n (void) |
|
1090 |
{ |
|
1091 |
NS_LOG_FUNCTION (this); |
|
11054
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1092 |
if (m_channelStartingFrequency>=2400 && m_channelStartingFrequency<=2500) //@ 2.4 GHz |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1093 |
{ |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1094 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate1Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1095 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate2Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1096 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate5_5Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1097 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate6Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1098 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1099 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate12Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1100 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate24Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1101 |
} |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1102 |
if (m_channelStartingFrequency>=5000 && m_channelStartingFrequency<=6000) //@ 5 GHz |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1103 |
{ |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1104 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate6Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1105 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate12Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1106 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate24Mbps ()); |
67de0a6729c3
bug 1906: 802.11n PHY configuration should be different for 2.4GHz and 5GHz devices
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11041
diff
changeset
|
1107 |
} |
10139 | 1108 |
m_bssMembershipSelectorSet.push_back(HT_PHY); |
1109 |
for (uint8_t i=0; i <8; i++) |
|
1110 |
{ |
|
1111 |
m_deviceMcsSet.push_back(i); |
|
1112 |
} |
|
1113 |
||
1114 |
} |
|
1115 |
uint32_t |
|
1116 |
YansWifiPhy::GetNBssMembershipSelectors (void) const |
|
1117 |
{ |
|
1118 |
return m_bssMembershipSelectorSet.size (); |
|
1119 |
} |
|
1120 |
uint32_t |
|
1121 |
YansWifiPhy::GetBssMembershipSelector (uint32_t selector) const |
|
1122 |
{ |
|
1123 |
return m_bssMembershipSelectorSet[selector]; |
|
1124 |
} |
|
1125 |
WifiModeList |
|
1126 |
YansWifiPhy::GetMembershipSelectorModes(uint32_t selector) |
|
1127 |
{ |
|
1128 |
uint32_t id=GetBssMembershipSelector(selector); |
|
1129 |
WifiModeList supportedmodes; |
|
1130 |
if (id == HT_PHY) |
|
1131 |
{ |
|
1132 |
//mandatory MCS 0 to 7 |
|
1133 |
supportedmodes.push_back (WifiPhy::GetOfdmRate6_5MbpsBW20MHz ()); |
|
1134 |
supportedmodes.push_back (WifiPhy::GetOfdmRate13MbpsBW20MHz ()); |
|
1135 |
supportedmodes.push_back (WifiPhy::GetOfdmRate19_5MbpsBW20MHz ()); |
|
1136 |
supportedmodes.push_back (WifiPhy::GetOfdmRate26MbpsBW20MHz ()); |
|
1137 |
supportedmodes.push_back (WifiPhy::GetOfdmRate39MbpsBW20MHz ()); |
|
1138 |
supportedmodes.push_back (WifiPhy::GetOfdmRate52MbpsBW20MHz ()); |
|
1139 |
supportedmodes.push_back (WifiPhy::GetOfdmRate58_5MbpsBW20MHz ()); |
|
1140 |
supportedmodes.push_back (WifiPhy::GetOfdmRate65MbpsBW20MHz ()); |
|
1141 |
} |
|
1142 |
return supportedmodes; |
|
1143 |
} |
|
1144 |
uint8_t |
|
1145 |
YansWifiPhy::GetNMcs (void) const |
|
1146 |
{ |
|
1147 |
return m_deviceMcsSet.size (); |
|
1148 |
} |
|
1149 |
uint8_t |
|
1150 |
YansWifiPhy::GetMcs (uint8_t mcs) const |
|
1151 |
{ |
|
1152 |
return m_deviceMcsSet[mcs]; |
|
1153 |
} |
|
1154 |
uint32_t |
|
1155 |
YansWifiPhy::WifiModeToMcs (WifiMode mode) |
|
1156 |
{ |
|
1157 |
uint32_t mcs = 0; |
|
1158 |
if (mode.GetUniqueName() == "OfdmRate135MbpsBW40MHzShGi" || mode.GetUniqueName() == "OfdmRate65MbpsBW20MHzShGi" ) |
|
1159 |
{ |
|
1160 |
mcs=6; |
|
1161 |
} |
|
1162 |
else |
|
1163 |
{ |
|
1164 |
switch (mode.GetDataRate()) |
|
1165 |
{ |
|
1166 |
case 6500000: |
|
1167 |
case 7200000: |
|
1168 |
case 13500000: |
|
1169 |
case 15000000: |
|
1170 |
mcs=0; |
|
1171 |
break; |
|
1172 |
case 13000000: |
|
1173 |
case 14400000: |
|
1174 |
case 27000000: |
|
1175 |
case 30000000: |
|
1176 |
mcs=1; |
|
1177 |
break; |
|
1178 |
case 19500000: |
|
1179 |
case 21700000: |
|
1180 |
case 40500000: |
|
1181 |
case 45000000: |
|
1182 |
mcs=2; |
|
1183 |
break; |
|
1184 |
case 26000000: |
|
1185 |
case 28900000: |
|
1186 |
case 54000000: |
|
1187 |
case 60000000: |
|
1188 |
mcs=3; |
|
1189 |
break; |
|
1190 |
case 39000000: |
|
1191 |
case 43300000: |
|
1192 |
case 81000000: |
|
1193 |
case 90000000: |
|
1194 |
mcs=4; |
|
1195 |
break; |
|
1196 |
case 52000000: |
|
1197 |
case 57800000: |
|
1198 |
case 108000000: |
|
1199 |
case 120000000: |
|
1200 |
mcs=5; |
|
1201 |
break; |
|
1202 |
case 58500000: |
|
1203 |
case 121500000: |
|
1204 |
mcs=6; |
|
1205 |
break; |
|
1206 |
case 65000000: |
|
1207 |
case 72200000: |
|
1208 |
case 135000000: |
|
1209 |
case 150000000: |
|
1210 |
mcs=7; |
|
1211 |
break; |
|
1212 |
} |
|
1213 |
} |
|
1214 |
return mcs; |
|
1215 |
} |
|
1216 |
WifiMode |
|
1217 |
YansWifiPhy::McsToWifiMode (uint8_t mcs) |
|
1218 |
{ |
|
1219 |
WifiMode mode; |
|
1220 |
switch (mcs) |
|
1221 |
{ |
|
1222 |
case 7: |
|
1223 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1224 |
{ |
|
1225 |
mode = WifiPhy::GetOfdmRate65MbpsBW20MHz (); |
|
1226 |
} |
|
1227 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1228 |
{ |
|
1229 |
mode = WifiPhy::GetOfdmRate72_2MbpsBW20MHz (); |
|
1230 |
} |
|
1231 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1232 |
{ |
|
1233 |
mode = WifiPhy::GetOfdmRate135MbpsBW40MHz (); |
|
1234 |
} |
|
1235 |
else |
|
1236 |
{ |
|
1237 |
mode = WifiPhy::GetOfdmRate150MbpsBW40MHz (); |
|
1238 |
} |
|
1239 |
break; |
|
1240 |
case 6: |
|
1241 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1242 |
{ |
|
1243 |
mode = WifiPhy::GetOfdmRate58_5MbpsBW20MHz (); |
|
1244 |
||
1245 |
} |
|
1246 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1247 |
{ |
|
1248 |
mode = WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (); |
|
1249 |
||
1250 |
} |
|
1251 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1252 |
{ |
|
1253 |
mode = WifiPhy::GetOfdmRate121_5MbpsBW40MHz (); |
|
1254 |
||
1255 |
} |
|
1256 |
else |
|
1257 |
{ |
|
1258 |
mode= WifiPhy::GetOfdmRate135MbpsBW40MHzShGi (); |
|
1259 |
||
1260 |
} |
|
1261 |
break; |
|
1262 |
case 5: |
|
1263 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1264 |
{ |
|
1265 |
mode = WifiPhy::GetOfdmRate52MbpsBW20MHz (); |
|
1266 |
||
1267 |
} |
|
1268 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1269 |
{ |
|
1270 |
mode = WifiPhy::GetOfdmRate57_8MbpsBW20MHz (); |
|
1271 |
} |
|
1272 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1273 |
{ |
|
1274 |
mode = WifiPhy::GetOfdmRate108MbpsBW40MHz (); |
|
1275 |
||
1276 |
} |
|
1277 |
else |
|
1278 |
{ |
|
1279 |
mode = WifiPhy::GetOfdmRate120MbpsBW40MHz (); |
|
1280 |
||
1281 |
} |
|
1282 |
break; |
|
1283 |
case 4: |
|
1284 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1285 |
{ |
|
1286 |
mode = WifiPhy::GetOfdmRate39MbpsBW20MHz (); |
|
1287 |
} |
|
1288 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1289 |
{ |
|
1290 |
mode = WifiPhy::GetOfdmRate43_3MbpsBW20MHz (); |
|
1291 |
} |
|
1292 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1293 |
{ |
|
1294 |
mode = WifiPhy::GetOfdmRate81MbpsBW40MHz (); |
|
1295 |
||
1296 |
} |
|
1297 |
else |
|
1298 |
{ |
|
1299 |
mode = WifiPhy::GetOfdmRate90MbpsBW40MHz (); |
|
1300 |
||
1301 |
} |
|
1302 |
break; |
|
1303 |
case 3: |
|
1304 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1305 |
{ |
|
1306 |
mode = WifiPhy::GetOfdmRate26MbpsBW20MHz (); |
|
1307 |
||
1308 |
} |
|
1309 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1310 |
{ |
|
1311 |
mode = WifiPhy::GetOfdmRate28_9MbpsBW20MHz (); |
|
1312 |
||
1313 |
} |
|
1314 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1315 |
{ |
|
1316 |
mode = WifiPhy::GetOfdmRate54MbpsBW40MHz (); |
|
1317 |
||
1318 |
} |
|
1319 |
else |
|
1320 |
{ |
|
1321 |
mode = WifiPhy::GetOfdmRate60MbpsBW40MHz (); |
|
1322 |
} |
|
1323 |
break; |
|
1324 |
case 2: |
|
1325 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1326 |
{ |
|
1327 |
mode = WifiPhy::GetOfdmRate19_5MbpsBW20MHz (); |
|
1328 |
||
1329 |
} |
|
1330 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1331 |
{ |
|
1332 |
mode = WifiPhy::GetOfdmRate21_7MbpsBW20MHz (); |
|
1333 |
||
1334 |
} |
|
1335 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1336 |
{ |
|
1337 |
mode = WifiPhy::GetOfdmRate40_5MbpsBW40MHz (); |
|
1338 |
||
1339 |
} |
|
1340 |
else |
|
1341 |
{ |
|
1342 |
mode = WifiPhy::GetOfdmRate45MbpsBW40MHz (); |
|
1343 |
||
1344 |
} |
|
1345 |
break; |
|
1346 |
case 1: |
|
1347 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1348 |
{ |
|
1349 |
mode = WifiPhy::GetOfdmRate13MbpsBW20MHz (); |
|
1350 |
||
1351 |
} |
|
1352 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1353 |
{ |
|
1354 |
mode = WifiPhy::GetOfdmRate14_4MbpsBW20MHz (); |
|
1355 |
} |
|
1356 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1357 |
{ |
|
1358 |
mode = WifiPhy::GetOfdmRate27MbpsBW40MHz (); |
|
1359 |
||
1360 |
} |
|
1361 |
else |
|
1362 |
{ |
|
1363 |
mode = WifiPhy::GetOfdmRate30MbpsBW40MHz (); |
|
1364 |
} |
|
1365 |
break; |
|
1366 |
case 0: |
|
1367 |
default: |
|
1368 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1369 |
{ |
|
1370 |
mode = WifiPhy::GetOfdmRate6_5MbpsBW20MHz (); |
|
1371 |
||
1372 |
} |
|
1373 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1374 |
{ |
|
1375 |
mode = WifiPhy::GetOfdmRate7_2MbpsBW20MHz (); |
|
1376 |
} |
|
1377 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1378 |
{ |
|
1379 |
mode = WifiPhy::GetOfdmRate13_5MbpsBW40MHz (); |
|
1380 |
||
1381 |
} |
|
1382 |
else |
|
1383 |
{ |
|
1384 |
mode = WifiPhy::GetOfdmRate15MbpsBW40MHz (); |
|
1385 |
} |
|
1386 |
break; |
|
1387 |
} |
|
1388 |
return mode; |
|
1389 |
} |
|
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1974
diff
changeset
|
1390 |
} // namespace ns3 |