author | Andrey Mazo <mazo@iitp.ru> |
Fri, 23 Apr 2010 15:09:31 +0400 | |
changeset 6273 | 8d70de29d514 |
parent 5820 | 1c02054740eb |
child 6372 | 0fafd9716f44 |
permissions | -rw-r--r-- |
1889 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2005,2006 INRIA |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
19 |
*/ |
|
20 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
21 |
#ifndef YANS_WIFI_PHY_H |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
22 |
#define YANS_WIFI_PHY_H |
1889 | 23 |
|
24 |
#include <stdint.h> |
|
25 |
#include "ns3/callback.h" |
|
26 |
#include "ns3/event-id.h" |
|
27 |
#include "ns3/packet.h" |
|
2054
ba8e810bae4c
derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1988
diff
changeset
|
28 |
#include "ns3/object.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
29 |
#include "ns3/traced-callback.h" |
1889 | 30 |
#include "ns3/nstime.h" |
31 |
#include "ns3/ptr.h" |
|
32 |
#include "ns3/random-variable.h" |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
33 |
#include "wifi-phy.h" |
1902
26a57487bb49
no need for ns3 prefix
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1892
diff
changeset
|
34 |
#include "wifi-mode.h" |
1920
1d4864775cf8
replace header mode with preamble mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1919
diff
changeset
|
35 |
#include "wifi-preamble.h" |
2166
00b5eb43dba2
Improve the accuracy of 802.11a tx duration calculations.
Federico Maguolo <federico.maguolo@dei.unipd.it>
parents:
2159
diff
changeset
|
36 |
#include "wifi-phy-standard.h" |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
37 |
#include "interference-helper.h" |
1889 | 38 |
|
39 |
||
40 |
namespace ns3 { |
|
41 |
||
42 |
class RandomUniform; |
|
43 |
class RxEvent; |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
44 |
class YansWifiChannel; |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
45 |
class WifiPhyStateHelper; |
1889 | 46 |
|
47 |
||
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
48 |
/** |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
49 |
* \brief 802.11 PHY layer model |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
50 |
* |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
51 |
* This PHY implements a model of 802.11a. The model |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
52 |
* implemented here is based on the model described |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
53 |
* in "Yet Another Network Simulator", |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
54 |
* (http://cutebugs.net/files/wns2-yans.pdf). |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
55 |
* |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2659
diff
changeset
|
56 |
* |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
57 |
* This PHY model depends on a channel loss and delay |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
58 |
* model as provided by the ns3::PropagationLossModel |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2659
diff
changeset
|
59 |
* and ns3::PropagationDelayModel classes, both of which are |
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
60 |
* members of the ns3::YansWifiChannel class. |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
61 |
*/ |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
62 |
class YansWifiPhy : public WifiPhy |
1889 | 63 |
{ |
64 |
public: |
|
65 |
||
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
66 |
static TypeId GetTypeId (void); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
67 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
68 |
YansWifiPhy (); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
69 |
virtual ~YansWifiPhy (); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
70 |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
71 |
void SetChannel (Ptr<YansWifiChannel> channel); |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
72 |
|
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
73 |
/** |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
74 |
* \brief Set channel number. |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
75 |
* |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
76 |
* Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1) |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
77 |
* |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
78 |
* where Starting channel frequency is standard-dependent, see SetStandard() |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
79 |
* as defined in IEEE 802.11-2007 17.3.8.3.2. |
5192 | 80 |
* |
81 |
* YansWifiPhy can switch among different channels. Basically, YansWifiPhy |
|
82 |
* has a private attribute m_channelNumber that identifies the channel the |
|
83 |
* PHY operates on. Channel switching cannot interrupt an ongoing transmission. |
|
84 |
* When PHY is in TX state, the channel switching is postponed until the end |
|
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
85 |
* of the current transmission. When the PHY is in RX state, the channel |
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
86 |
* switching causes the drop of the synchronized packet. |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
87 |
*/ |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
88 |
void SetChannelNumber (uint16_t id); |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
89 |
/// Return current channel number, see SetChannelNumber() |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
90 |
uint16_t GetChannelNumber () const; |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5820
diff
changeset
|
91 |
/// Return current center channel frequency in MHz, see SetChannelNumber() |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
92 |
double GetChannelFrequencyMhz() const; |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
93 |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
94 |
void StartReceivePacket (Ptr<Packet> packet, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
95 |
double rxPowerDbm, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
96 |
WifiMode mode, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
97 |
WifiPreamble preamble); |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
98 |
|
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
99 |
void SetRxNoiseFigure (double noiseFigureDb); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
100 |
void SetTxPowerStart (double start); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
101 |
void SetTxPowerEnd (double end); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
102 |
void SetNTxPower (uint32_t n); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
103 |
void SetTxGain (double gain); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
104 |
void SetRxGain (double gain); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
105 |
void SetEdThreshold (double threshold); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
106 |
void SetCcaMode1Threshold (double threshold); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
107 |
void SetErrorRateModel (Ptr<ErrorRateModel> rate); |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
108 |
void SetDevice (Ptr<Object> device); |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
109 |
void SetMobility (Ptr<Object> mobility); |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
110 |
double GetRxNoiseFigure (void) const; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
111 |
double GetTxGain (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
112 |
double GetRxGain (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
113 |
double GetEdThreshold (void) const; |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
114 |
double GetCcaMode1Threshold (void) const; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
115 |
Ptr<ErrorRateModel> GetErrorRateModel (void) const; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
116 |
Ptr<Object> GetDevice (void) const; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
117 |
Ptr<Object> GetMobility (void); |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
118 |
|
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
119 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
120 |
|
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
121 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
122 |
virtual double GetTxPowerStart (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
123 |
virtual double GetTxPowerEnd (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
124 |
virtual uint32_t GetNTxPower (void) const; |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
125 |
virtual void SetReceiveOkCallback (WifiPhy::RxOkCallback callback); |
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
126 |
virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
127 |
virtual void SendPacket (Ptr<const Packet> packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
128 |
virtual void RegisterListener (WifiPhyListener *listener); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
129 |
virtual bool IsStateCcaBusy (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
130 |
virtual bool IsStateIdle (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
131 |
virtual bool IsStateBusy (void); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
132 |
virtual bool IsStateRx (void); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
133 |
virtual bool IsStateTx (void); |
5189 | 134 |
virtual bool IsStateSwitching (void); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
135 |
virtual Time GetStateDuration (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
136 |
virtual Time GetDelayUntilIdle (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
137 |
virtual Time GetLastRxStartTime (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
138 |
virtual Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
139 |
virtual uint32_t GetNModes (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
140 |
virtual WifiMode GetMode (uint32_t mode) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
141 |
virtual double CalculateSnr (WifiMode txMode, double ber) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
142 |
virtual Ptr<WifiChannel> GetChannel (void) const; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4690
diff
changeset
|
143 |
virtual void ConfigureStandard (enum WifiPhyStandard standard); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
144 |
|
1889 | 145 |
private: |
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
146 |
typedef std::vector<WifiMode> Modes; |
1889 | 147 |
|
2055
8899d6ef5d52
phy state logger
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2054
diff
changeset
|
148 |
private: |
3906 | 149 |
YansWifiPhy (const YansWifiPhy &o); |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
150 |
virtual void DoDispose (void); |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
151 |
void Configure80211a (void); |
4470 | 152 |
void Configure80211b (void); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
153 |
void Configure80211_10Mhz (void); |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
154 |
void Configure80211_5Mhz (); |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2071
diff
changeset
|
155 |
void ConfigureHolland (void); |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5192
diff
changeset
|
156 |
void Configure80211p_CCH (void); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5192
diff
changeset
|
157 |
void Configure80211p_SCH (void); |
1889 | 158 |
double GetEdThresholdW (void) const; |
159 |
double DbmToW (double dbm) const; |
|
160 |
double DbToRatio (double db) const; |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
161 |
double WToDbm (double w) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
162 |
double RatioToDb (double ratio) const; |
1889 | 163 |
double GetPowerDbm (uint8_t power) const; |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
164 |
void EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event); |
3897
44645cec42f2
split state management in a helper class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3893
diff
changeset
|
165 |
|
1889 | 166 |
private: |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
167 |
double m_edThresholdW; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
168 |
double m_ccaMode1ThresholdW; |
2071
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2057
diff
changeset
|
169 |
double m_txGainDb; |
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2057
diff
changeset
|
170 |
double m_rxGainDb; |
1889 | 171 |
double m_txPowerBaseDbm; |
172 |
double m_txPowerEndDbm; |
|
173 |
uint32_t m_nTxPower; |
|
174 |
||
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
175 |
Ptr<YansWifiChannel> m_channel; |
5189 | 176 |
uint16_t m_channelNumber; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
177 |
Ptr<Object> m_device; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
178 |
Ptr<Object> m_mobility; |
1889 | 179 |
Modes m_modes; |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
180 |
EventId m_endRxEvent; |
1889 | 181 |
UniformVariable m_random; |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
182 |
/// Standard-dependent center frequency of 0-th channel, MHz |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
183 |
double m_channelStartingFrequency; |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
184 |
Ptr<WifiPhyStateHelper> m_state; |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
185 |
InterferenceHelper m_interference; |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
186 |
Time m_channelSwitchDelay; |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3912
diff
changeset
|
187 |
|
1889 | 188 |
}; |
189 |
||
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
190 |
} // namespace ns3 |
1889 | 191 |
|
192 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
193 |
#endif /* YANS_WIFI_PHY_H */ |