author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 9818 | cfb12f56257a |
child 10204 | 7a102bb70a36 |
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" |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
39 |
#include <cmath> |
1889 | 40 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
41 |
NS_LOG_COMPONENT_DEFINE ("YansWifiPhy"); |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
42 |
|
1889 | 43 |
namespace ns3 { |
44 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
45 |
NS_OBJECT_ENSURE_REGISTERED (YansWifiPhy); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
46 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
47 |
TypeId |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
48 |
YansWifiPhy::GetTypeId (void) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
49 |
{ |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
50 |
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
|
51 |
.SetParent<WifiPhy> () |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
52 |
.AddConstructor<YansWifiPhy> () |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
53 |
.AddAttribute ("EnergyDetectionThreshold", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
54 |
"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
|
55 |
"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
|
56 |
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
|
57 |
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
|
58 |
&YansWifiPhy::GetEdThreshold), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
59 |
MakeDoubleChecker<double> ()) |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
60 |
.AddAttribute ("CcaMode1Threshold", |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
61 |
"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
|
62 |
"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
|
63 |
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
|
64 |
MakeDoubleAccessor (&YansWifiPhy::SetCcaMode1Threshold, |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
65 |
&YansWifiPhy::GetCcaMode1Threshold), |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
66 |
MakeDoubleChecker<double> ()) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
67 |
.AddAttribute ("TxGain", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
68 |
"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
|
69 |
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
|
70 |
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
|
71 |
&YansWifiPhy::GetTxGain), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
72 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
73 |
.AddAttribute ("RxGain", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
74 |
"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
|
75 |
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
|
76 |
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
|
77 |
&YansWifiPhy::GetRxGain), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
78 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
79 |
.AddAttribute ("TxPowerLevels", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
80 |
"Number of transmission power levels available between " |
7151 | 81 |
"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
|
82 |
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
|
83 |
MakeUintegerAccessor (&YansWifiPhy::m_nTxPower), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
84 |
MakeUintegerChecker<uint32_t> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
85 |
.AddAttribute ("TxPowerEnd", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
86 |
"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
|
87 |
DoubleValue (16.0206), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
88 |
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
|
89 |
&YansWifiPhy::GetTxPowerEnd), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
90 |
MakeDoubleChecker<double> ()) |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
91 |
.AddAttribute ("TxPowerStart", |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
92 |
"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
|
93 |
DoubleValue (16.0206), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
94 |
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
|
95 |
&YansWifiPhy::GetTxPowerStart), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
96 |
MakeDoubleChecker<double> ()) |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
97 |
.AddAttribute ("RxNoiseFigure", |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
98 |
"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
|
99 |
" 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
|
100 |
"\"the difference in decibels (dB) between" |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
101 |
" 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
|
102 |
" 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
|
103 |
" 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
|
104 |
" For", |
2965
4b28e9740e3b
get rid of Attribute class. Use AttributeValue subclasses directly.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
105 |
DoubleValue (7), |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
106 |
MakeDoubleAccessor (&YansWifiPhy::SetRxNoiseFigure, |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
107 |
&YansWifiPhy::GetRxNoiseFigure), |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
108 |
MakeDoubleChecker<double> ()) |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
109 |
.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
|
110 |
PointerValue (), |
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
111 |
MakePointerAccessor (&YansWifiPhy::m_state), |
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
112 |
MakePointerChecker<WifiPhyStateHelper> ()) |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
113 |
.AddAttribute ("ChannelSwitchDelay", |
9818
cfb12f56257a
fixed Bug 1677 - The annotation of YansWifiPhy needs correction
Junling Bu <linlinjavaer@gmail.com>
parents:
9063
diff
changeset
|
114 |
"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
|
115 |
TimeValue (MicroSeconds (250)), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
116 |
MakeTimeAccessor (&YansWifiPhy::m_channelSwitchDelay), |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
117 |
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
|
118 |
.AddAttribute ("ChannelNumber", |
9818
cfb12f56257a
fixed Bug 1677 - The annotation of YansWifiPhy needs correction
Junling Bu <linlinjavaer@gmail.com>
parents:
9063
diff
changeset
|
119 |
"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
|
120 |
UintegerValue (1), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
121 |
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
|
122 |
&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
|
123 |
MakeUintegerChecker<uint16_t> ()) |
10139 | 124 |
.AddAttribute ("Frequency", "The operating frequency.", |
125 |
UintegerValue (2407), |
|
126 |
MakeUintegerAccessor (&YansWifiPhy::GetFrequency, |
|
127 |
&YansWifiPhy::SetFrequency), |
|
128 |
MakeUintegerChecker<uint32_t> ()) |
|
129 |
.AddAttribute ("Transmitters", "The number of transmitters.", |
|
130 |
UintegerValue (1), |
|
131 |
MakeUintegerAccessor (&YansWifiPhy::GetNumberOfTransmitAntennas, |
|
132 |
&YansWifiPhy::SetNumberOfTransmitAntennas), |
|
133 |
MakeUintegerChecker<uint32_t> ()) |
|
134 |
.AddAttribute ("Recievers", "The number of recievers.", |
|
135 |
UintegerValue (1), |
|
136 |
MakeUintegerAccessor (&YansWifiPhy::GetNumberOfReceiveAntennas, |
|
137 |
&YansWifiPhy::SetNumberOfReceiveAntennas), |
|
138 |
MakeUintegerChecker<uint32_t> ()) |
|
139 |
.AddAttribute ("ShortGuardEnabled", "Whether or not short guard interval is enabled.", |
|
140 |
BooleanValue (false), |
|
141 |
MakeBooleanAccessor (&YansWifiPhy::GetGuardInterval, |
|
142 |
&YansWifiPhy::SetGuardInterval), |
|
143 |
MakeBooleanChecker ()) |
|
144 |
.AddAttribute ("LdpcEnabled", "Whether or not LDPC is enabled.", |
|
145 |
BooleanValue (false), |
|
146 |
MakeBooleanAccessor (&YansWifiPhy::GetLdpc, |
|
147 |
&YansWifiPhy::SetLdpc), |
|
148 |
MakeBooleanChecker ()) |
|
149 |
.AddAttribute ("STBCEnabled", "Whether or not STBC is enabled.", |
|
150 |
BooleanValue (false), |
|
151 |
MakeBooleanAccessor (&YansWifiPhy::GetStbc, |
|
152 |
&YansWifiPhy::SetStbc), |
|
153 |
MakeBooleanChecker ()) |
|
154 |
.AddAttribute ("GreenfieldEnabled", "Whether or not STBC is enabled.", |
|
155 |
BooleanValue (false), |
|
156 |
MakeBooleanAccessor (&YansWifiPhy::GetGreenfield, |
|
157 |
&YansWifiPhy::SetGreenfield), |
|
158 |
MakeBooleanChecker ()) |
|
159 |
.AddAttribute ("ChannelBonding", "Whether 20MHz or 40MHz.", |
|
160 |
BooleanValue (false), |
|
161 |
MakeBooleanAccessor (&YansWifiPhy::GetChannelBonding, |
|
162 |
&YansWifiPhy::SetChannelBonding), |
|
163 |
MakeBooleanChecker ()) |
|
164 |
||
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
|
165 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
166 |
; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
167 |
return tid; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
168 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
169 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
170 |
YansWifiPhy::YansWifiPhy () |
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
|
171 |
: m_channelNumber (1), |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
172 |
m_endRxEvent (), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
173 |
m_channelStartingFrequency (0) |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
174 |
{ |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
175 |
NS_LOG_FUNCTION (this); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
176 |
m_random = CreateObject<UniformRandomVariable> (); |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
177 |
m_state = CreateObject<WifiPhyStateHelper> (); |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
178 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
179 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
180 |
YansWifiPhy::~YansWifiPhy () |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
181 |
{ |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
182 |
NS_LOG_FUNCTION (this); |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
183 |
} |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
184 |
|
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
185 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
186 |
YansWifiPhy::DoDispose (void) |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
187 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
188 |
NS_LOG_FUNCTION (this); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
189 |
m_channel = 0; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
190 |
m_deviceRateSet.clear (); |
10139 | 191 |
m_deviceMcsSet.clear(); |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
192 |
m_device = 0; |
5422
21a4f34518ff
bug 711: example mesh/mesh fails valgrind.
Andrey Mazo <mazo@iitp.ru>
parents:
5189
diff
changeset
|
193 |
m_mobility = 0; |
21a4f34518ff
bug 711: example mesh/mesh fails valgrind.
Andrey Mazo <mazo@iitp.ru>
parents:
5189
diff
changeset
|
194 |
m_state = 0; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
195 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
196 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
197 |
void |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4715
diff
changeset
|
198 |
YansWifiPhy::ConfigureStandard (enum WifiPhyStandard standard) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
199 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
200 |
NS_LOG_FUNCTION (this << standard); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
201 |
switch (standard) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
202 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
203 |
case WIFI_PHY_STANDARD_80211a: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
204 |
Configure80211a (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
205 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
206 |
case WIFI_PHY_STANDARD_80211b: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
207 |
Configure80211b (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
208 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
209 |
case WIFI_PHY_STANDARD_80211g: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
210 |
Configure80211g (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
211 |
break; |
7482
35c01487f7f7
_Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
212 |
case WIFI_PHY_STANDARD_80211_10MHZ: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
213 |
Configure80211_10Mhz (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
214 |
break; |
7482
35c01487f7f7
_Mhz --> _MHZ in WIFI_PHY_STANDARD enums
Nicola Baldo <nbaldo@cttc.es>
parents:
7385
diff
changeset
|
215 |
case WIFI_PHY_STANDARD_80211_5MHZ: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
216 |
Configure80211_5Mhz (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
217 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
218 |
case WIFI_PHY_STANDARD_holland: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
219 |
ConfigureHolland (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
220 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
221 |
case WIFI_PHY_STANDARD_80211p_CCH: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
222 |
Configure80211p_CCH (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
223 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
224 |
case WIFI_PHY_STANDARD_80211p_SCH: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
225 |
Configure80211p_SCH (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
226 |
break; |
10139 | 227 |
case WIFI_PHY_STANDARD_80211n_2_4GHZ: |
228 |
m_channelStartingFrequency=2407; |
|
229 |
Configure80211n (); |
|
230 |
break; |
|
231 |
case WIFI_PHY_STANDARD_80211n_5GHZ: |
|
232 |
m_channelStartingFrequency=5e3; |
|
233 |
Configure80211n (); |
|
234 |
break; |
|
235 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
236 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
237 |
NS_ASSERT (false); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
238 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
239 |
} |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
240 |
} |
1889 | 241 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
242 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
243 |
void |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
244 |
YansWifiPhy::SetRxNoiseFigure (double noiseFigureDb) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
245 |
{ |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
246 |
NS_LOG_FUNCTION (this << noiseFigureDb); |
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
247 |
m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb)); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
248 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
249 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
250 |
YansWifiPhy::SetTxPowerStart (double start) |
1889 | 251 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
252 |
NS_LOG_FUNCTION (this << start); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
253 |
m_txPowerBaseDbm = start; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
254 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
255 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
256 |
YansWifiPhy::SetTxPowerEnd (double end) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
257 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
258 |
NS_LOG_FUNCTION (this << end); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
259 |
m_txPowerEndDbm = end; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
260 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
261 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
262 |
YansWifiPhy::SetNTxPower (uint32_t n) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
263 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
264 |
NS_LOG_FUNCTION (this << n); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
265 |
m_nTxPower = n; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
266 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
267 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
268 |
YansWifiPhy::SetTxGain (double gain) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
269 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
270 |
NS_LOG_FUNCTION (this << gain); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
271 |
m_txGainDb = gain; |
1889 | 272 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
273 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
274 |
YansWifiPhy::SetRxGain (double gain) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
275 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
276 |
NS_LOG_FUNCTION (this << gain); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
277 |
m_rxGainDb = gain; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
278 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
279 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
280 |
YansWifiPhy::SetEdThreshold (double threshold) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
281 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
282 |
NS_LOG_FUNCTION (this << threshold); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
283 |
m_edThresholdW = DbmToW (threshold); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
284 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
285 |
void |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
286 |
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
|
287 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
288 |
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
|
289 |
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
|
290 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
291 |
void |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
292 |
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
|
293 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
294 |
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
|
295 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
296 |
void |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
297 |
YansWifiPhy::SetDevice (Ptr<Object> device) |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
298 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
299 |
m_device = device; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
300 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
301 |
void |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
302 |
YansWifiPhy::SetMobility (Ptr<Object> mobility) |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
303 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
304 |
m_mobility = mobility; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
305 |
} |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
306 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
307 |
double |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
308 |
YansWifiPhy::GetRxNoiseFigure (void) const |
2155
194dd8bdcf56
add WifiPhy::GetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2150
diff
changeset
|
309 |
{ |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
310 |
return RatioToDb (m_interference.GetNoiseFigure ()); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
311 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
312 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
313 |
YansWifiPhy::GetTxPowerStart (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
314 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
315 |
return m_txPowerBaseDbm; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
316 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
317 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
318 |
YansWifiPhy::GetTxPowerEnd (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
319 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
320 |
return m_txPowerEndDbm; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
321 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
322 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
323 |
YansWifiPhy::GetTxGain (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
324 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
325 |
return m_txGainDb; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
326 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
327 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
328 |
YansWifiPhy::GetRxGain (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
329 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
330 |
return m_rxGainDb; |
2155
194dd8bdcf56
add WifiPhy::GetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2150
diff
changeset
|
331 |
} |
194dd8bdcf56
add WifiPhy::GetDevice
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2150
diff
changeset
|
332 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
333 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
334 |
YansWifiPhy::GetEdThreshold (void) const |
2055
8899d6ef5d52
phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1999
diff
changeset
|
335 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
336 |
return WToDbm (m_edThresholdW); |
2055
8899d6ef5d52
phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1999
diff
changeset
|
337 |
} |
1889 | 338 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
339 |
double |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
340 |
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
|
341 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
342 |
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
|
343 |
} |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
344 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
345 |
Ptr<ErrorRateModel> |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
346 |
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
|
347 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
348 |
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
|
349 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
350 |
Ptr<Object> |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
351 |
YansWifiPhy::GetDevice (void) const |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
352 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
353 |
return m_device; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
354 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
355 |
Ptr<Object> |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
356 |
YansWifiPhy::GetMobility (void) |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
357 |
{ |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
358 |
return m_mobility; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
359 |
} |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
360 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
361 |
double |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
362 |
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
|
363 |
{ |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
364 |
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
|
365 |
} |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
366 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
367 |
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
|
368 |
YansWifiPhy::GetChannel (void) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
369 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
370 |
return m_channel; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
371 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
372 |
void |
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
373 |
YansWifiPhy::SetChannel (Ptr<YansWifiChannel> channel) |
1889 | 374 |
{ |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
375 |
m_channel = channel; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
376 |
m_channel->Add (this); |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
377 |
} |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
378 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
379 |
void |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
380 |
YansWifiPhy::SetChannelNumber (uint16_t nch) |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
381 |
{ |
5512
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
382 |
if (Simulator::Now () == Seconds (0)) |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
383 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
384 |
// 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
|
385 |
NS_LOG_DEBUG ("start at channel " << nch); |
5512
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
386 |
m_channelNumber = nch; |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
387 |
return; |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
388 |
} |
28bccc88b34c
bugfix in YansWifiPhy::SetChannelNumber()
Pavel Boyko <boyko@iitp.ru>
parents:
5511
diff
changeset
|
389 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
390 |
NS_ASSERT (!IsStateSwitching ()); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
391 |
switch (m_state->GetState ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
392 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
393 |
case YansWifiPhy::RX: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
394 |
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
|
395 |
m_endRxEvent.Cancel (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
396 |
goto switchChannel; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
397 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
398 |
case YansWifiPhy::TX: |
5189 | 399 |
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
|
400 |
Simulator::Schedule (GetDelayUntilIdle (), &YansWifiPhy::SetChannelNumber, this, nch); |
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::CCA_BUSY: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
403 |
case YansWifiPhy::IDLE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
404 |
goto switchChannel; |
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 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
407 |
NS_ASSERT (false); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
408 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
409 |
} |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
410 |
|
5189 | 411 |
return; |
412 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
413 |
switchChannel: |
5189 | 414 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
415 |
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
|
416 |
m_state->SwitchToChannelSwitching (m_channelSwitchDelay); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
417 |
m_interference.EraseEvents (); |
5189 | 418 |
/* |
419 |
* Needed here to be able to correctly sensed the medium for the first |
|
420 |
* time after the switching. The actual switching is not performed until |
|
421 |
* after m_channelSwitchDelay. Packets received during the switching |
|
422 |
* state are added to the event list and are employed later to figure |
|
423 |
* out the state of the medium after the switching. |
|
424 |
*/ |
|
425 |
m_channelNumber = nch; |
|
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
426 |
} |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
427 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
428 |
uint16_t |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
429 |
YansWifiPhy::GetChannelNumber () const |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
430 |
{ |
5189 | 431 |
return m_channelNumber; |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
432 |
} |
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 |
double |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
435 |
YansWifiPhy::GetChannelFrequencyMhz () const |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
436 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
437 |
return m_channelStartingFrequency + 5 * GetChannelNumber (); |
1889 | 438 |
} |
439 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
440 |
void |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
441 |
YansWifiPhy::SetReceiveOkCallback (RxOkCallback callback) |
1889 | 442 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
443 |
m_state->SetReceiveOkCallback (callback); |
1889 | 444 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
445 |
void |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
446 |
YansWifiPhy::SetReceiveErrorCallback (RxErrorCallback callback) |
1889 | 447 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
448 |
m_state->SetReceiveErrorCallback (callback); |
1889 | 449 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
450 |
void |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
451 |
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
|
452 |
double rxPowerDbm, |
10139 | 453 |
WifiTxVector txVector, |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
454 |
enum WifiPreamble preamble) |
1889 | 455 |
{ |
10139 | 456 |
NS_LOG_FUNCTION (this << packet << rxPowerDbm << txVector.GetMode()<< preamble); |
2071
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
457 |
rxPowerDbm += m_rxGainDb; |
1988
210701141b08
convert to and from dbms when needed
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1979
diff
changeset
|
458 |
double rxPowerW = DbmToW (rxPowerDbm); |
10139 | 459 |
Time rxDuration = CalculateTxDuration (packet->GetSize (), txVector, preamble); |
460 |
WifiMode txMode=txVector.GetMode(); |
|
1889 | 461 |
Time endRx = Simulator::Now () + rxDuration; |
462 |
||
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
463 |
Ptr<InterferenceHelper::Event> event; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
464 |
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
|
465 |
txMode, |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
466 |
preamble, |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
467 |
rxDuration, |
10139 | 468 |
rxPowerW, |
469 |
txVector); // we need it to calculate duration of HT training symbols |
|
1889 | 470 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
471 |
switch (m_state->GetState ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
472 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
473 |
case YansWifiPhy::SWITCHING: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
474 |
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
|
475 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
476 |
/* |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
477 |
* 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
|
478 |
* 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
|
479 |
* 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
|
480 |
* 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
|
481 |
* 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
|
482 |
* the switching. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
483 |
*/ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
484 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
485 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
486 |
// 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
|
487 |
// channel switching. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
488 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
489 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
490 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
491 |
case YansWifiPhy::RX: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
492 |
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
|
493 |
rxPowerW << "W)"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
494 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
495 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
496 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
497 |
// 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
|
498 |
// currently-received packet. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
499 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
500 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
501 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
502 |
case YansWifiPhy::TX: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
503 |
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
|
504 |
rxPowerW << "W)"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
505 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
506 |
if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ()) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
507 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
508 |
// 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
|
509 |
// currently-transmitted packet. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
510 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
511 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
512 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
513 |
case YansWifiPhy::CCA_BUSY: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
514 |
case YansWifiPhy::IDLE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
515 |
if (rxPowerW > m_edThresholdW) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
516 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
517 |
NS_LOG_DEBUG ("sync to signal (power=" << rxPowerW << "W)"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
518 |
// sync to signal |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
519 |
m_state->SwitchToRx (rxDuration); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
520 |
NS_ASSERT (m_endRxEvent.IsExpired ()); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
521 |
NotifyRxBegin (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
522 |
m_interference.NotifyRxStart (); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
523 |
m_endRxEvent = Simulator::Schedule (rxDuration, &YansWifiPhy::EndReceive, this, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
524 |
packet, |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
525 |
event); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
526 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
527 |
else |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
528 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
529 |
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
|
530 |
rxPowerW << "<" << m_edThresholdW << ")"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
531 |
NotifyRxDrop (packet); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
532 |
goto maybeCcaBusy; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
533 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
534 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
535 |
} |
1889 | 536 |
|
537 |
return; |
|
538 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
539 |
maybeCcaBusy: |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
540 |
// 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
|
541 |
// 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
|
542 |
// 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
|
543 |
// tracked by the InterferenceHelper class is higher than the CcaBusyThreshold |
1889 | 544 |
|
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
545 |
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
|
546 |
if (!delayUntilCcaEnd.IsZero ()) |
1889 | 547 |
{ |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
548 |
m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd); |
1889 | 549 |
} |
550 |
} |
|
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
4039
diff
changeset
|
551 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
552 |
void |
10139 | 553 |
YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiMode txMode, WifiPreamble preamble, WifiTxVector txVector) |
1889 | 554 |
{ |
10139 | 555 |
NS_LOG_FUNCTION (this << packet << txMode << preamble << (uint32_t)txVector.GetTxPowerLevel()); |
1889 | 556 |
/* Transmission can happen if: |
557 |
* - 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
|
558 |
* MAC layer to avoid doing this but the PHY does nothing to |
1889 | 559 |
* prevent it. |
560 |
* - we are idle |
|
561 |
*/ |
|
5189 | 562 |
NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ()); |
1889 | 563 |
|
10139 | 564 |
Time txDuration = CalculateTxDuration (packet->GetSize (), txVector, preamble); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
565 |
if (m_state->IsStateRx ()) |
3897
44645cec42f2
split state management in a helper class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3893
diff
changeset
|
566 |
{ |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
567 |
m_endRxEvent.Cancel (); |
6474
0894b2a245e9
fixed Bug 799 - Interference helper is too slow
Kirill Andreev <andreev@iitp.ru>
parents:
6372
diff
changeset
|
568 |
m_interference.NotifyRxEnd (); |
3897
44645cec42f2
split state management in a helper class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3893
diff
changeset
|
569 |
} |
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
570 |
NotifyTxBegin (packet); |
10139 | 571 |
uint32_t dataRate500KbpsUnits = txVector.GetMode().GetDataRate () * txVector.GetNss() / 500000; |
4492
3ebeb7bf3c15
added support for radiotap and prism headers
Nicola Baldo <nbaldo@cttc.es>
parents:
4470
diff
changeset
|
572 |
bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble); |
10139 | 573 |
NotifyMonitorSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, txVector.GetTxPowerLevel()); |
574 |
m_state->SwitchToTx (txDuration, packet, txVector.GetMode(), preamble, txVector.GetTxPowerLevel()); |
|
575 |
m_channel->Send (this, packet, GetPowerDbm ( txVector.GetTxPowerLevel()) + m_txGainDb, txVector, preamble); |
|
1889 | 576 |
} |
577 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
578 |
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
|
579 |
YansWifiPhy::GetNModes (void) const |
1889 | 580 |
{ |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
581 |
return m_deviceRateSet.size (); |
1889 | 582 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
583 |
WifiMode |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
584 |
YansWifiPhy::GetMode (uint32_t mode) const |
1889 | 585 |
{ |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
586 |
return m_deviceRateSet[mode]; |
1889 | 587 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
588 |
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
|
589 |
YansWifiPhy::GetNTxPower (void) const |
1889 | 590 |
{ |
591 |
return m_nTxPower; |
|
592 |
} |
|
593 |
||
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
594 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
595 |
YansWifiPhy::Configure80211a (void) |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
596 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
597 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
598 |
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
|
599 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
600 |
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
|
601 |
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
|
602 |
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
|
603 |
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
|
604 |
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
|
605 |
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
|
606 |
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
|
607 |
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
|
608 |
} |
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
609 |
|
4470 | 610 |
|
611 |
void |
|
612 |
YansWifiPhy::Configure80211b (void) |
|
613 |
{ |
|
614 |
NS_LOG_FUNCTION (this); |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
615 |
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
|
616 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
617 |
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
|
618 |
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
|
619 |
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
|
620 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); |
4470 | 621 |
} |
622 |
||
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
623 |
void |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
624 |
YansWifiPhy::Configure80211g (void) |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
625 |
{ |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
626 |
NS_LOG_FUNCTION (this); |
6644 | 627 |
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
|
628 |
|
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
629 |
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
|
630 |
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
|
631 |
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
|
632 |
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
|
633 |
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
|
634 |
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
|
635 |
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
|
636 |
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
|
637 |
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
|
638 |
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
|
639 |
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
|
640 |
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
|
641 |
} |
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
642 |
|
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6474
diff
changeset
|
643 |
void |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
644 |
YansWifiPhy::Configure80211_10Mhz (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
645 |
{ |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
646 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
647 |
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
|
648 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
649 |
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
|
650 |
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
|
651 |
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
|
652 |
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
|
653 |
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
|
654 |
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
|
655 |
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
|
656 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate27MbpsBW10MHz ()); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
657 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
658 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
659 |
void |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
660 |
YansWifiPhy::Configure80211_5Mhz (void) |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
661 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
662 |
NS_LOG_FUNCTION (this); |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4681
diff
changeset
|
663 |
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
|
664 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
665 |
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
|
666 |
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
|
667 |
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
|
668 |
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
|
669 |
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
|
670 |
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
|
671 |
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
|
672 |
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
|
673 |
} |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
674 |
|
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
675 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
676 |
YansWifiPhy::ConfigureHolland (void) |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
677 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
678 |
NS_LOG_FUNCTION (this); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
679 |
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
|
680 |
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
|
681 |
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
|
682 |
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
|
683 |
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
|
684 |
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
|
685 |
} |
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2077
diff
changeset
|
686 |
|
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
687 |
void |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
688 |
YansWifiPhy::Configure80211p_CCH (void) |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
689 |
{ |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
690 |
NS_LOG_FUNCTION (this); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
691 |
m_channelStartingFrequency = 5e3; // 802.11p works over the 5Ghz freq range |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6342
diff
changeset
|
692 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
693 |
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
|
694 |
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
|
695 |
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
|
696 |
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
|
697 |
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
|
698 |
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
|
699 |
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
|
700 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate27MbpsBW10MHz ()); |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
701 |
} |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
702 |
|
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
703 |
void |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
704 |
YansWifiPhy::Configure80211p_SCH (void) |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
705 |
{ |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
706 |
NS_LOG_FUNCTION (this); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
707 |
m_channelStartingFrequency = 5e3; // 802.11p works over the 5Ghz freq range |
6360
d8975477ff6a
Bug 871: Rework construction of Wi-Fi rates
Dean Armstrong <deanarm@gmail.com>
parents:
6342
diff
changeset
|
708 |
|
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6360
diff
changeset
|
709 |
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
|
710 |
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
|
711 |
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
|
712 |
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
|
713 |
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
|
714 |
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
|
715 |
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
|
716 |
m_deviceRateSet.push_back (WifiPhy::GetOfdmRate27MbpsBW10MHz ()); |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
717 |
} |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5512
diff
changeset
|
718 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
719 |
void |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
720 |
YansWifiPhy::RegisterListener (WifiPhyListener *listener) |
1889 | 721 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
722 |
m_state->RegisterListener (listener); |
1889 | 723 |
} |
724 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
725 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
726 |
YansWifiPhy::IsStateCcaBusy (void) |
1889 | 727 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
728 |
return m_state->IsStateCcaBusy (); |
1889 | 729 |
} |
730 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
731 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
732 |
YansWifiPhy::IsStateIdle (void) |
1889 | 733 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
734 |
return m_state->IsStateIdle (); |
1889 | 735 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
736 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
737 |
YansWifiPhy::IsStateBusy (void) |
1889 | 738 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
739 |
return m_state->IsStateBusy (); |
1889 | 740 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
741 |
bool |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
742 |
YansWifiPhy::IsStateRx (void) |
1889 | 743 |
{ |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
744 |
return m_state->IsStateRx (); |
1889 | 745 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
746 |
bool |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
747 |
YansWifiPhy::IsStateTx (void) |
1889 | 748 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
749 |
return m_state->IsStateTx (); |
1889 | 750 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
751 |
bool |
5189 | 752 |
YansWifiPhy::IsStateSwitching (void) |
753 |
{ |
|
754 |
return m_state->IsStateSwitching (); |
|
755 |
} |
|
1889 | 756 |
|
757 |
Time |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
758 |
YansWifiPhy::GetStateDuration (void) |
1889 | 759 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
760 |
return m_state->GetStateDuration (); |
1889 | 761 |
} |
762 |
Time |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
763 |
YansWifiPhy::GetDelayUntilIdle (void) |
1889 | 764 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
765 |
return m_state->GetDelayUntilIdle (); |
1889 | 766 |
} |
767 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
768 |
Time |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
769 |
YansWifiPhy::GetLastRxStartTime (void) const |
2139
a2cf93c741c3
add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2083
diff
changeset
|
770 |
{ |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
771 |
return m_state->GetLastRxStartTime (); |
2139
a2cf93c741c3
add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2083
diff
changeset
|
772 |
} |
a2cf93c741c3
add WifiPhy::GetLastRxStart
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2083
diff
changeset
|
773 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
774 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
775 |
YansWifiPhy::DbToRatio (double dB) const |
1889 | 776 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
777 |
double ratio = std::pow (10.0, dB / 10.0); |
1889 | 778 |
return ratio; |
779 |
} |
|
780 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
781 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
782 |
YansWifiPhy::DbmToW (double dBm) const |
1889 | 783 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
784 |
double mW = std::pow (10.0, dBm / 10.0); |
1889 | 785 |
return mW / 1000.0; |
786 |
} |
|
787 |
||
788 |
double |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
789 |
YansWifiPhy::WToDbm (double w) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
790 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
791 |
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
|
792 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
793 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
794 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
795 |
YansWifiPhy::RatioToDb (double ratio) const |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
796 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
8981
diff
changeset
|
797 |
return 10.0 * std::log10 (ratio); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
798 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
799 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2503
diff
changeset
|
800 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
801 |
YansWifiPhy::GetEdThresholdW (void) const |
1889 | 802 |
{ |
803 |
return m_edThresholdW; |
|
804 |
} |
|
805 |
||
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
806 |
double |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3882
diff
changeset
|
807 |
YansWifiPhy::GetPowerDbm (uint8_t power) const |
1889 | 808 |
{ |
1974
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
809 |
NS_ASSERT (m_txPowerBaseDbm <= m_txPowerEndDbm); |
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
810 |
NS_ASSERT (m_nTxPower > 0); |
6342 | 811 |
double dbm; |
812 |
if (m_nTxPower > 1) |
|
813 |
{ |
|
814 |
dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1); |
|
815 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
816 |
else |
6342 | 817 |
{ |
818 |
NS_ASSERT_MSG (m_txPowerBaseDbm == m_txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1"); |
|
819 |
dbm = m_txPowerBaseDbm; |
|
820 |
} |
|
1889 | 821 |
return dbm; |
822 |
} |
|
823 |
||
824 |
void |
|
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
825 |
YansWifiPhy::EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event) |
1889 | 826 |
{ |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2782
diff
changeset
|
827 |
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
|
828 |
NS_ASSERT (IsStateRx ()); |
1974
0d6b3bead74a
replace cassert by ns3/assert.h
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
829 |
NS_ASSERT (event->GetEndTime () == Simulator::Now ()); |
1889 | 830 |
|
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3902
diff
changeset
|
831 |
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
|
832 |
snrPer = m_interference.CalculateSnrPer (event); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
833 |
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
|
834 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
835 |
NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate ()) << |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
836 |
", 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
|
837 |
if (m_random->GetValue () > snrPer.per) |
1889 | 838 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
839 |
NotifyRxEnd (packet); |
10139 | 840 |
uint32_t dataRate500KbpsUnits = event->GetPayloadMode ().GetDataRate () * event->GetTxVector().GetNss()/ 500000; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
841 |
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
|
842 |
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
|
843 |
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
|
844 |
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
|
845 |
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
|
846 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
847 |
else |
1889 | 848 |
{ |
849 |
/* failure. */ |
|
4264
9d2e96c4e6e4
Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4263
diff
changeset
|
850 |
NotifyRxDrop (packet); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
851 |
m_state->SwitchFromRxEndError (packet, snrPer.snr); |
1889 | 852 |
} |
853 |
} |
|
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
854 |
|
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
855 |
int64_t |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
856 |
YansWifiPhy::AssignStreams (int64_t stream) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
857 |
{ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
858 |
NS_LOG_FUNCTION (this << stream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
859 |
m_random->SetStream (stream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
860 |
return 1; |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7482
diff
changeset
|
861 |
} |
10139 | 862 |
|
863 |
void |
|
864 |
YansWifiPhy::SetFrequency (uint32_t freq) |
|
865 |
{ |
|
866 |
m_channelStartingFrequency = freq; |
|
867 |
} |
|
868 |
||
869 |
void |
|
870 |
YansWifiPhy::SetNumberOfTransmitAntennas (uint32_t tx) |
|
871 |
{ |
|
872 |
m_numberOfTransmitters = tx; |
|
873 |
} |
|
874 |
void |
|
875 |
YansWifiPhy::SetNumberOfReceiveAntennas (uint32_t rx) |
|
876 |
{ |
|
877 |
m_numberOfReceivers = rx; |
|
878 |
} |
|
879 |
||
880 |
void |
|
881 |
YansWifiPhy::SetLdpc (bool Ldpc) |
|
882 |
{ |
|
883 |
m_ldpc = Ldpc; |
|
884 |
} |
|
885 |
||
886 |
void |
|
887 |
YansWifiPhy::SetStbc (bool stbc) |
|
888 |
{ |
|
889 |
m_stbc = stbc; |
|
890 |
} |
|
891 |
||
892 |
void |
|
893 |
YansWifiPhy::SetGreenfield (bool greenfield) |
|
894 |
{ |
|
895 |
m_greenfield = greenfield; |
|
896 |
} |
|
897 |
bool |
|
898 |
YansWifiPhy::GetGuardInterval (void) const |
|
899 |
{ |
|
900 |
return m_guardInterval; |
|
901 |
} |
|
902 |
void |
|
903 |
YansWifiPhy::SetGuardInterval (bool GuardInterval) |
|
904 |
{ |
|
905 |
m_guardInterval = GuardInterval; |
|
906 |
} |
|
907 |
||
908 |
uint32_t |
|
909 |
YansWifiPhy::GetFrequency (void) const |
|
910 |
{ |
|
911 |
return m_channelStartingFrequency; |
|
912 |
} |
|
913 |
||
914 |
uint32_t |
|
915 |
YansWifiPhy::GetNumberOfTransmitAntennas (void) const |
|
916 |
{ |
|
917 |
return m_numberOfTransmitters; |
|
918 |
} |
|
919 |
uint32_t |
|
920 |
YansWifiPhy::GetNumberOfReceiveAntennas (void) const |
|
921 |
{ |
|
922 |
return m_numberOfReceivers; |
|
923 |
} |
|
924 |
||
925 |
bool |
|
926 |
YansWifiPhy::GetLdpc (void) const |
|
927 |
{ |
|
928 |
return m_ldpc; |
|
929 |
} |
|
930 |
bool |
|
931 |
YansWifiPhy::GetStbc (void) const |
|
932 |
{ |
|
933 |
return m_stbc; |
|
934 |
} |
|
935 |
||
936 |
bool |
|
937 |
YansWifiPhy::GetGreenfield (void) const |
|
938 |
{ |
|
939 |
return m_greenfield; |
|
940 |
} |
|
941 |
||
942 |
bool |
|
943 |
YansWifiPhy::GetChannelBonding(void) const |
|
944 |
{ |
|
945 |
return m_channelBonding; |
|
946 |
} |
|
947 |
||
948 |
void |
|
949 |
YansWifiPhy::SetChannelBonding(bool channelbonding) |
|
950 |
{ |
|
951 |
m_channelBonding= channelbonding; |
|
952 |
} |
|
953 |
||
954 |
void |
|
955 |
YansWifiPhy::Configure80211n (void) |
|
956 |
{ |
|
957 |
NS_LOG_FUNCTION (this); |
|
958 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate1Mbps ()); |
|
959 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate2Mbps ()); |
|
960 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate5_5Mbps ()); |
|
961 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate6Mbps ()); |
|
962 |
m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); |
|
963 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate12Mbps ()); |
|
964 |
m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate24Mbps ()); |
|
965 |
m_bssMembershipSelectorSet.push_back(HT_PHY); |
|
966 |
for (uint8_t i=0; i <8; i++) |
|
967 |
{ |
|
968 |
m_deviceMcsSet.push_back(i); |
|
969 |
} |
|
970 |
||
971 |
} |
|
972 |
uint32_t |
|
973 |
YansWifiPhy::GetNBssMembershipSelectors (void) const |
|
974 |
{ |
|
975 |
return m_bssMembershipSelectorSet.size (); |
|
976 |
} |
|
977 |
uint32_t |
|
978 |
YansWifiPhy::GetBssMembershipSelector (uint32_t selector) const |
|
979 |
{ |
|
980 |
return m_bssMembershipSelectorSet[selector]; |
|
981 |
} |
|
982 |
WifiModeList |
|
983 |
YansWifiPhy::GetMembershipSelectorModes(uint32_t selector) |
|
984 |
{ |
|
985 |
uint32_t id=GetBssMembershipSelector(selector); |
|
986 |
WifiModeList supportedmodes; |
|
987 |
if (id == HT_PHY) |
|
988 |
{ |
|
989 |
//mandatory MCS 0 to 7 |
|
990 |
supportedmodes.push_back (WifiPhy::GetOfdmRate6_5MbpsBW20MHz ()); |
|
991 |
supportedmodes.push_back (WifiPhy::GetOfdmRate13MbpsBW20MHz ()); |
|
992 |
supportedmodes.push_back (WifiPhy::GetOfdmRate19_5MbpsBW20MHz ()); |
|
993 |
supportedmodes.push_back (WifiPhy::GetOfdmRate26MbpsBW20MHz ()); |
|
994 |
supportedmodes.push_back (WifiPhy::GetOfdmRate39MbpsBW20MHz ()); |
|
995 |
supportedmodes.push_back (WifiPhy::GetOfdmRate52MbpsBW20MHz ()); |
|
996 |
supportedmodes.push_back (WifiPhy::GetOfdmRate58_5MbpsBW20MHz ()); |
|
997 |
supportedmodes.push_back (WifiPhy::GetOfdmRate65MbpsBW20MHz ()); |
|
998 |
} |
|
999 |
return supportedmodes; |
|
1000 |
} |
|
1001 |
uint8_t |
|
1002 |
YansWifiPhy::GetNMcs (void) const |
|
1003 |
{ |
|
1004 |
return m_deviceMcsSet.size (); |
|
1005 |
} |
|
1006 |
uint8_t |
|
1007 |
YansWifiPhy::GetMcs (uint8_t mcs) const |
|
1008 |
{ |
|
1009 |
return m_deviceMcsSet[mcs]; |
|
1010 |
} |
|
1011 |
uint32_t |
|
1012 |
YansWifiPhy::WifiModeToMcs (WifiMode mode) |
|
1013 |
{ |
|
1014 |
uint32_t mcs = 0; |
|
1015 |
if (mode.GetUniqueName() == "OfdmRate135MbpsBW40MHzShGi" || mode.GetUniqueName() == "OfdmRate65MbpsBW20MHzShGi" ) |
|
1016 |
{ |
|
1017 |
mcs=6; |
|
1018 |
} |
|
1019 |
else |
|
1020 |
{ |
|
1021 |
switch (mode.GetDataRate()) |
|
1022 |
{ |
|
1023 |
case 6500000: |
|
1024 |
case 7200000: |
|
1025 |
case 13500000: |
|
1026 |
case 15000000: |
|
1027 |
mcs=0; |
|
1028 |
break; |
|
1029 |
case 13000000: |
|
1030 |
case 14400000: |
|
1031 |
case 27000000: |
|
1032 |
case 30000000: |
|
1033 |
mcs=1; |
|
1034 |
break; |
|
1035 |
case 19500000: |
|
1036 |
case 21700000: |
|
1037 |
case 40500000: |
|
1038 |
case 45000000: |
|
1039 |
mcs=2; |
|
1040 |
break; |
|
1041 |
case 26000000: |
|
1042 |
case 28900000: |
|
1043 |
case 54000000: |
|
1044 |
case 60000000: |
|
1045 |
mcs=3; |
|
1046 |
break; |
|
1047 |
case 39000000: |
|
1048 |
case 43300000: |
|
1049 |
case 81000000: |
|
1050 |
case 90000000: |
|
1051 |
mcs=4; |
|
1052 |
break; |
|
1053 |
case 52000000: |
|
1054 |
case 57800000: |
|
1055 |
case 108000000: |
|
1056 |
case 120000000: |
|
1057 |
mcs=5; |
|
1058 |
break; |
|
1059 |
case 58500000: |
|
1060 |
case 121500000: |
|
1061 |
mcs=6; |
|
1062 |
break; |
|
1063 |
case 65000000: |
|
1064 |
case 72200000: |
|
1065 |
case 135000000: |
|
1066 |
case 150000000: |
|
1067 |
mcs=7; |
|
1068 |
break; |
|
1069 |
} |
|
1070 |
} |
|
1071 |
return mcs; |
|
1072 |
} |
|
1073 |
WifiMode |
|
1074 |
YansWifiPhy::McsToWifiMode (uint8_t mcs) |
|
1075 |
{ |
|
1076 |
WifiMode mode; |
|
1077 |
switch (mcs) |
|
1078 |
{ |
|
1079 |
case 7: |
|
1080 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1081 |
{ |
|
1082 |
mode = WifiPhy::GetOfdmRate65MbpsBW20MHz (); |
|
1083 |
} |
|
1084 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1085 |
{ |
|
1086 |
mode = WifiPhy::GetOfdmRate72_2MbpsBW20MHz (); |
|
1087 |
} |
|
1088 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1089 |
{ |
|
1090 |
mode = WifiPhy::GetOfdmRate135MbpsBW40MHz (); |
|
1091 |
} |
|
1092 |
else |
|
1093 |
{ |
|
1094 |
mode = WifiPhy::GetOfdmRate150MbpsBW40MHz (); |
|
1095 |
} |
|
1096 |
break; |
|
1097 |
case 6: |
|
1098 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1099 |
{ |
|
1100 |
mode = WifiPhy::GetOfdmRate58_5MbpsBW20MHz (); |
|
1101 |
||
1102 |
} |
|
1103 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1104 |
{ |
|
1105 |
mode = WifiPhy::GetOfdmRate65MbpsBW20MHzShGi (); |
|
1106 |
||
1107 |
} |
|
1108 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1109 |
{ |
|
1110 |
mode = WifiPhy::GetOfdmRate121_5MbpsBW40MHz (); |
|
1111 |
||
1112 |
} |
|
1113 |
else |
|
1114 |
{ |
|
1115 |
mode= WifiPhy::GetOfdmRate135MbpsBW40MHzShGi (); |
|
1116 |
||
1117 |
} |
|
1118 |
break; |
|
1119 |
case 5: |
|
1120 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1121 |
{ |
|
1122 |
mode = WifiPhy::GetOfdmRate52MbpsBW20MHz (); |
|
1123 |
||
1124 |
} |
|
1125 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1126 |
{ |
|
1127 |
mode = WifiPhy::GetOfdmRate57_8MbpsBW20MHz (); |
|
1128 |
} |
|
1129 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1130 |
{ |
|
1131 |
mode = WifiPhy::GetOfdmRate108MbpsBW40MHz (); |
|
1132 |
||
1133 |
} |
|
1134 |
else |
|
1135 |
{ |
|
1136 |
mode = WifiPhy::GetOfdmRate120MbpsBW40MHz (); |
|
1137 |
||
1138 |
} |
|
1139 |
break; |
|
1140 |
case 4: |
|
1141 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1142 |
{ |
|
1143 |
mode = WifiPhy::GetOfdmRate39MbpsBW20MHz (); |
|
1144 |
} |
|
1145 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1146 |
{ |
|
1147 |
mode = WifiPhy::GetOfdmRate43_3MbpsBW20MHz (); |
|
1148 |
} |
|
1149 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1150 |
{ |
|
1151 |
mode = WifiPhy::GetOfdmRate81MbpsBW40MHz (); |
|
1152 |
||
1153 |
} |
|
1154 |
else |
|
1155 |
{ |
|
1156 |
mode = WifiPhy::GetOfdmRate90MbpsBW40MHz (); |
|
1157 |
||
1158 |
} |
|
1159 |
break; |
|
1160 |
case 3: |
|
1161 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1162 |
{ |
|
1163 |
mode = WifiPhy::GetOfdmRate26MbpsBW20MHz (); |
|
1164 |
||
1165 |
} |
|
1166 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1167 |
{ |
|
1168 |
mode = WifiPhy::GetOfdmRate28_9MbpsBW20MHz (); |
|
1169 |
||
1170 |
} |
|
1171 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1172 |
{ |
|
1173 |
mode = WifiPhy::GetOfdmRate54MbpsBW40MHz (); |
|
1174 |
||
1175 |
} |
|
1176 |
else |
|
1177 |
{ |
|
1178 |
mode = WifiPhy::GetOfdmRate60MbpsBW40MHz (); |
|
1179 |
} |
|
1180 |
break; |
|
1181 |
case 2: |
|
1182 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1183 |
{ |
|
1184 |
mode = WifiPhy::GetOfdmRate19_5MbpsBW20MHz (); |
|
1185 |
||
1186 |
} |
|
1187 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1188 |
{ |
|
1189 |
mode = WifiPhy::GetOfdmRate21_7MbpsBW20MHz (); |
|
1190 |
||
1191 |
} |
|
1192 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1193 |
{ |
|
1194 |
mode = WifiPhy::GetOfdmRate40_5MbpsBW40MHz (); |
|
1195 |
||
1196 |
} |
|
1197 |
else |
|
1198 |
{ |
|
1199 |
mode = WifiPhy::GetOfdmRate45MbpsBW40MHz (); |
|
1200 |
||
1201 |
} |
|
1202 |
break; |
|
1203 |
case 1: |
|
1204 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1205 |
{ |
|
1206 |
mode = WifiPhy::GetOfdmRate13MbpsBW20MHz (); |
|
1207 |
||
1208 |
} |
|
1209 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1210 |
{ |
|
1211 |
mode = WifiPhy::GetOfdmRate14_4MbpsBW20MHz (); |
|
1212 |
} |
|
1213 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1214 |
{ |
|
1215 |
mode = WifiPhy::GetOfdmRate27MbpsBW40MHz (); |
|
1216 |
||
1217 |
} |
|
1218 |
else |
|
1219 |
{ |
|
1220 |
mode = WifiPhy::GetOfdmRate30MbpsBW40MHz (); |
|
1221 |
} |
|
1222 |
break; |
|
1223 |
case 0: |
|
1224 |
default: |
|
1225 |
if (!GetGuardInterval() && !GetChannelBonding()) |
|
1226 |
{ |
|
1227 |
mode = WifiPhy::GetOfdmRate6_5MbpsBW20MHz (); |
|
1228 |
||
1229 |
} |
|
1230 |
else if(GetGuardInterval() && !GetChannelBonding()) |
|
1231 |
{ |
|
1232 |
mode = WifiPhy::GetOfdmRate7_2MbpsBW20MHz (); |
|
1233 |
} |
|
1234 |
else if (!GetGuardInterval() && GetChannelBonding()) |
|
1235 |
{ |
|
1236 |
mode = WifiPhy::GetOfdmRate13_5MbpsBW40MHz (); |
|
1237 |
||
1238 |
} |
|
1239 |
else |
|
1240 |
{ |
|
1241 |
mode = WifiPhy::GetOfdmRate15MbpsBW40MHz (); |
|
1242 |
} |
|
1243 |
break; |
|
1244 |
} |
|
1245 |
return mode; |
|
1246 |
} |
|
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1974
diff
changeset
|
1247 |
} // namespace ns3 |