A Discrete-Event Network Simulator
API
rem-spectrum-phy.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 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 REM_SPECTRUM_PHY_H
21 #define REM_SPECTRUM_PHY_H
22 
23 #include <ns3/mobility-model.h>
24 #include <ns3/net-device.h>
25 #include <ns3/nstime.h>
26 #include <ns3/packet.h>
27 #include <ns3/spectrum-channel.h>
28 #include <ns3/spectrum-phy.h>
29 #include <ns3/spectrum-value.h>
30 
31 #include <fstream>
32 #include <string>
33 
34 namespace ns3
35 {
36 
51 {
52  public:
54  ~RemSpectrumPhy() override;
55 
56  // inherited from Object
57  void DoDispose() override;
62  static TypeId GetTypeId();
63 
64  // inherited from SpectrumPhy
65  void SetChannel(Ptr<SpectrumChannel> c) override;
66  void SetMobility(Ptr<MobilityModel> m) override;
67  void SetDevice(Ptr<NetDevice> d) override;
68  Ptr<MobilityModel> GetMobility() const override;
69  Ptr<NetDevice> GetDevice() const override;
71  Ptr<Object> GetAntenna() const override;
73 
80 
86  double GetSinr(double noisePower) const;
87 
92  void Deactivate();
93 
98  bool IsActive() const;
99 
104  void Reset();
105 
111  void SetUseDataChannel(bool value);
112 
118  void SetRbId(int32_t rbId);
119 
120  private:
123 
125  double m_sumPower;
126 
127  bool m_active;
128 
130  int32_t m_rbId;
131 };
132 
133 } // namespace ns3
134 
135 #endif /* REM_SPECTRUM_PHY_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This minimal SpectrumPhy implementation calculates the SINR with respect to the strongest signal for ...
double m_referenceSignalPower
reference signal power
Ptr< MobilityModel > m_mobility
the mobility model
void DoDispose() override
Destructor implementation.
void Reset()
Reset the SINR calculator.
double GetSinr(double noisePower) const
void Deactivate()
make StartRx a no-op from now on, and mark instance as inactive
Ptr< const SpectrumModel > m_rxSpectrumModel
receive spectrum model
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
Ptr< Object > GetAntenna() const override
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
void SetRbId(int32_t rbId)
set RB Id
static TypeId GetTypeId()
Get the type ID.
double m_sumPower
sum power
void SetRxSpectrumModel(Ptr< const SpectrumModel > m)
set the RX spectrum model to be used
Ptr< const SpectrumModel > GetRxSpectrumModel() const override
Ptr< NetDevice > GetDevice() const override
Get the associated NetDevice instance.
bool m_active
is active?
void SetMobility(Ptr< MobilityModel > m) override
Set the mobility model associated with this device.
void SetUseDataChannel(bool value)
set usage of DataChannel
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
void SetChannel(Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
bool m_useDataChannel
use data channel
void SetDevice(Ptr< NetDevice > d) override
Set the associated NetDevice instance.
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:46
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.