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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef WIFI_SPECTRUM_PHY_INTERFACE_H
10#define WIFI_SPECTRUM_PHY_INTERFACE_H
11
12#include "spectrum-wifi-phy.h"
13
14#include "ns3/he-phy.h"
15#include "ns3/spectrum-phy.h"
16
17#include <vector>
18
19namespace ns3
20{
21
22class SpectrumWifiPhy;
23
24/**
25 * \ingroup wifi
26 *
27 * This class is an adaptor between class SpectrumWifiPhy (which inherits
28 * from WifiPhy) and class SpectrumChannel (which expects objects derived
29 * from class SpectrumPhy to be connected to it).
30 *
31 * The adaptor is used only in the receive direction; in the transmit
32 * direction, the class SpectrumWifiPhy constructs signal parameters
33 * and directly accesses the SpectrumChannel
34 */
36{
37 public:
38 /**
39 * \brief Get the type ID.
40 * \return the object TypeId
41 */
42 static TypeId GetTypeId();
43 /**
44 * Constructor
45 *
46 * \param freqRange the frequency range covered by the interface
47 */
49 /**
50 * Connect SpectrumWifiPhy object
51 * \param phy SpectrumWifiPhy object to be connected to this object
52 */
54
55 /**
56 * Get SpectrumWifiPhy object
57 * \return Pointer to SpectrumWifiPhy object
58 */
60
61 Ptr<NetDevice> GetDevice() const override;
62 void SetDevice(const Ptr<NetDevice> d) override;
63 void SetMobility(const Ptr<MobilityModel> m) override;
64 Ptr<MobilityModel> GetMobility() const override;
65 void SetChannel(const Ptr<SpectrumChannel> c) override;
67 Ptr<Object> GetAntenna() const override;
68 void StartRx(Ptr<SpectrumSignalParameters> params) override;
69
70 /**
71 * Get the spectrum channel this interface is attached to
72 *
73 * \return the spectrum channel this interface is attached to
74 */
76
77 /**
78 * Get the frequency range covered by the spectrum channel this interface is attached to
79 *
80 * \return the frequency range covered by the spectrum channel this interface is attached to
81 */
82 const FrequencyRange& GetFrequencyRange() const;
83
84 /**
85 * Get the center frequency for each segment of the the spectrum channel this interface is
86 * attached to
87 *
88 * \return the center frequency for each segment of the the spectrum channel this interface is
89 * attached to to
90 */
91 const std::vector<MHz_u>& GetCenterFrequencies() const;
92
93 /**
94 * Get the channel width covered by the spectrum channel this interface is attached to
95 *
96 * \return the channel width covered by the spectrum channel this interface is attached
97 * to to
98 */
99 MHz_u GetChannelWidth() const;
100
101 /**
102 * Start transmission over the spectrum channel
103 *
104 * \param params the parameters of the signal to transmit
105 */
107
108 /**
109 * Set the RX spectrum model
110 *
111 * \param centerFrequencies the center frequency for each segment
112 * \param channelWidth the total channel width
113 * \param bandBandwidth the width of each band
114 * \param guardBandwidth the total width of the guard band
115 */
116 void SetRxSpectrumModel(const std::vector<MHz_u>& centerFrequencies,
117 MHz_u channelWidth,
118 Hz_u bandBandwidth,
119 MHz_u guardBandwidth);
120
121 /**
122 * Set the vector of spectrum bands handled by this interface
123 *
124 * \param bands vector of spectrum bands
125 */
126 void SetBands(WifiSpectrumBands&& bands);
127 /**
128 * Get the vector of spectrum bands handled by this interface
129 *
130 * \return the vector of spectrum bands
131 */
132 const WifiSpectrumBands& GetBands() const;
133
134 /**
135 * Set the HE RU spectrum bands handled by this interface (if any)
136 *
137 * \param heRuBands the HE RU spectrum bands
138 */
139 void SetHeRuBands(HeRuBands&& heRuBands);
140 /**
141 * Get the HE RU spectrum bands handled by this interface
142 *
143 * \return the HE RU spectrum bands
144 */
145 const HeRuBands& GetHeRuBands() const;
146
147 private:
148 void DoDispose() override;
149
150 FrequencyRange m_frequencyRange; ///< frequency range
153 Ptr<SpectrumChannel> m_channel; ///< spectrum channel
154 std::vector<MHz_u> m_centerFrequencies; ///< center frequency per segment
155 MHz_u m_channelWidth; ///< channel width
156 Ptr<const SpectrumModel> m_rxSpectrumModel; ///< receive spectrum model
157
159 m_bands; /**< Store all the distinct spectrum bands associated with every channels widths */
160 HeRuBands m_heRuBands; /**< Store all the distinct spectrum bands associated with every RU */
161};
162
163} // namespace ns3
164
165#endif /* WIFI_SPECTRUM_PHY_INTERFACE_H */
Smart pointer class similar to boost::intrusive_ptr.
Abstract base class for Spectrum-aware PHY layers.
a unique identifier for an interface.
Definition type-id.h:48
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
void SetRxSpectrumModel(const std::vector< MHz_u > &centerFrequencies, MHz_u channelWidth, Hz_u bandBandwidth, MHz_u guardBandwidth)
Set the RX spectrum model.
HeRuBands m_heRuBands
Store all the distinct spectrum bands associated with every RU.
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 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.
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.
WifiSpectrumPhyInterface(FrequencyRange freqRange)
Constructor.
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
MHz_u GetChannelWidth() const
Get the channel width covered by the spectrum channel this interface is attached to.
const std::vector< MHz_u > & GetCenterFrequencies() const
Get the center frequency for each segment of the the spectrum channel this interface is attached to.
void SetBands(WifiSpectrumBands &&bands)
Set the vector of spectrum bands handled by this interface.
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.
std::vector< MHz_u > m_centerFrequencies
center frequency per segment
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::map< WifiSpectrumBandInfo, HeRu::RuSpec > HeRuBands
Map a spectrum band associated with an RU to the RU specification.
std::vector< WifiSpectrumBandInfo > WifiSpectrumBands
vector of spectrum bands
Struct defining a frequency range between minFrequency and maxFrequency.