A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-spectrum-phy-interface.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 CTTC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>
18 */
19
20#ifndef WIFI_SPECTRUM_PHY_INTERFACE_H
21#define WIFI_SPECTRUM_PHY_INTERFACE_H
22
23#include "spectrum-wifi-phy.h"
24
25#include "ns3/he-phy.h"
26#include "ns3/spectrum-phy.h"
27
28namespace ns3
29{
30
31class SpectrumWifiPhy;
32
33/**
34 * \ingroup wifi
35 *
36 * This class is an adaptor between class SpectrumWifiPhy (which inherits
37 * from WifiPhy) and class SpectrumChannel (which expects objects derived
38 * from class SpectrumPhy to be connected to it).
39 *
40 * The adaptor is used only in the receive direction; in the transmit
41 * direction, the class SpectrumWifiPhy constructs signal parameters
42 * and directly accesses the SpectrumChannel
43 */
45{
46 public:
47 /**
48 * \brief Get the type ID.
49 * \return the object TypeId
50 */
51 static TypeId GetTypeId();
52 /**
53 * Constructor
54 *
55 * \param freqRange the frequency range covered by the interface
56 */
58 /**
59 * Connect SpectrumWifiPhy object
60 * \param phy SpectrumWifiPhy object to be connected to this object
61 */
63
64 /**
65 * Get SpectrumWifiPhy object
66 * \return Pointer to SpectrumWifiPhy object
67 */
69
70 Ptr<NetDevice> GetDevice() const override;
71 void SetDevice(const Ptr<NetDevice> d) override;
72 void SetMobility(const Ptr<MobilityModel> m) override;
73 Ptr<MobilityModel> GetMobility() const override;
74 void SetChannel(const Ptr<SpectrumChannel> c) override;
76 Ptr<Object> GetAntenna() const override;
77 void StartRx(Ptr<SpectrumSignalParameters> params) override;
78
79 /**
80 * Get the spectrum channel this interface is attached to
81 *
82 * \return the spectrum channel this interface is attached to
83 */
85
86 /**
87 * Get the frequency range covered by the spectrum channel this interface is attached to
88 *
89 * \return the frequency range covered by the spectrum channel this interface is attached to
90 */
91 const FrequencyRange& GetFrequencyRange() const;
92
93 /**
94 * Get the center frequency in MHz of the the spectrum channel this interface is attached to
95 *
96 * \return the center frequency in MHz of the the spectrum channel this interface is attached to
97 * to
98 */
99 uint16_t GetCenterFrequency() const;
100
101 /**
102 * Get the channel width in MHz covered by the spectrum channel this interface is attached to
103 *
104 * \return the channel width in MHz covered by the spectrum channel this interface is attached
105 * to to
106 */
107 uint16_t GetChannelWidth() const;
108
109 /**
110 * Start transmission over the spectrum channel
111 *
112 * \param params the parameters of the signal to transmit
113 */
115
116 /**
117 * Set the RX spectrum model
118 *
119 * \param centerFrequency the center frequency in MHz
120 * \param channelWidth the channel width in MHz
121 * \param bandBandwidth the width of each band in Hz
122 * \param guardBandwidth the width of the guard band in MHz
123 */
124 void SetRxSpectrumModel(uint32_t centerFrequency,
125 uint16_t channelWidth,
126 uint32_t bandBandwidth,
127 uint16_t guardBandwidth);
128
129 /**
130 * Set the vector of spectrum bands handled by this interface
131 *
132 * \param bands vector of spectrum bands
133 */
134 void SetBands(WifiSpectrumBands&& bands);
135 /**
136 * Get the vector of spectrum bands handled by this interface
137 *
138 * \return the vector of spectrum bands
139 */
140 const WifiSpectrumBands& GetBands() const;
141
142 /**
143 * Set the HE RU spectrum bands handled by this interface (if any)
144 *
145 * \param heRuBands the HE RU spectrum bands
146 */
147 void SetHeRuBands(HeRuBands&& heRuBands);
148 /**
149 * Get the HE RU spectrum bands handled by this interface
150 *
151 * \return the HE RU spectrum bands
152 */
153 const HeRuBands& GetHeRuBands() const;
154
155 private:
156 void DoDispose() override;
157
158 FrequencyRange m_frequencyRange; ///< frequency range
161 Ptr<SpectrumChannel> m_channel; ///< spectrum channel
162 uint16_t m_centerFrequency; ///< center frequency in MHz
163 uint16_t m_channelWidth; ///< channel width in MHz
164 Ptr<const SpectrumModel> m_rxSpectrumModel; ///< receive spectrum model
165
167 m_bands; /**< Store all the distinct spectrum bands associated with every channels widths */
168 HeRuBands m_heRuBands; /**< Store all the distinct spectrum bands associated with every RU */
169};
170
171} // namespace ns3
172
173#endif /* WIFI_SPECTRUM_PHY_INTERFACE_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:46
a unique identifier for an interface.
Definition: type-id.h:59
This class is an adaptor between class SpectrumWifiPhy (which inherits from WifiPhy) and class Spectr...
void SetDevice(const Ptr< NetDevice > d) override
Set the associated NetDevice instance.
const HeRuBands & GetHeRuBands() const
Get the HE RU spectrum bands handled by this interface.
void StartTx(Ptr< SpectrumSignalParameters > params)
Start transmission over the spectrum channel.
const FrequencyRange & GetFrequencyRange() const
Get the frequency range covered by the spectrum channel this interface is attached to.
Ptr< const SpectrumModel > m_rxSpectrumModel
receive spectrum model
uint16_t m_centerFrequency
center frequency in MHz
HeRuBands m_heRuBands
Store all the distinct spectrum bands associated with every RU.
uint16_t m_channelWidth
channel width in MHz
Ptr< Object > GetAntenna() const override
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
FrequencyRange m_frequencyRange
frequency range
void SetSpectrumWifiPhy(const Ptr< SpectrumWifiPhy > phy)
Connect SpectrumWifiPhy object.
const WifiSpectrumBands & GetBands() const
Get the vector of spectrum bands handled by this interface.
void SetRxSpectrumModel(uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth)
Set the RX spectrum model.
Ptr< NetDevice > m_netDevice
the device
void SetChannel(const Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
void DoDispose() override
Destructor implementation.
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
uint16_t GetCenterFrequency() const
Get the center frequency in MHz of the the spectrum channel this interface is attached to.
Ptr< const SpectrumModel > GetRxSpectrumModel() const override
void SetHeRuBands(HeRuBands &&heRuBands)
Set the HE RU spectrum bands handled by this interface (if any)
void SetMobility(const Ptr< MobilityModel > m) override
Set the mobility model associated with this device.
Ptr< NetDevice > GetDevice() const override
Get the associated NetDevice instance.
WifiSpectrumBands m_bands
Store all the distinct spectrum bands associated with every channels widths.
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
void SetBands(WifiSpectrumBands &&bands)
Set the vector of spectrum bands handled by this interface.
uint16_t GetChannelWidth() const
Get the channel width in MHz covered by the spectrum channel this interface is attached to.
static TypeId GetTypeId()
Get the type ID.
Ptr< SpectrumChannel > m_channel
spectrum channel
Ptr< SpectrumChannel > GetChannel() const
Get the spectrum channel this interface is attached to.
Ptr< SpectrumWifiPhy > m_spectrumWifiPhy
spectrum PHY
Ptr< const SpectrumWifiPhy > GetSpectrumWifiPhy() const
Get SpectrumWifiPhy object.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< WifiSpectrumBandInfo > WifiSpectrumBands
vector of spectrum bands
std::map< WifiSpectrumBandInfo, HeRu::RuSpec > HeRuBands
Map a spectrum band associated with an RU to the RU specification.
Struct defining a frequency range between minFrequency (MHz) and maxFrequency (MHz).