A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rem-spectrum-phy.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef REM_SPECTRUM_PHY_H
22 #define REM_SPECTRUM_PHY_H
23 
24 
25 #include <ns3/spectrum-value.h>
26 #include <ns3/mobility-model.h>
27 #include <ns3/packet.h>
28 #include <ns3/nstime.h>
29 #include <ns3/net-device.h>
30 #include <ns3/spectrum-phy.h>
31 #include <ns3/spectrum-channel.h>
32 #include <string>
33 #include <fstream>
34 
35 namespace ns3 {
36 
37 
52 {
53 
54 public:
55  RemSpectrumPhy ();
56  virtual ~RemSpectrumPhy ();
57 
58  // inherited from Object
59  void DoDispose ();
60  static TypeId GetTypeId (void);
61 
62  // inherited from SpectrumPhy
65  void SetDevice (Ptr<NetDevice> d);
71 
78 
83  double GetSinr (double noisePower);
84 
89  void Deactivate ();
90 
95  bool IsActive ();
96 
101  void Reset ();
102 
103 private:
106 
108  double m_sumPower;
109 
110  bool m_active;
111 
112 };
113 
114 
115 
116 
117 
118 
119 }
120 
121 
122 
123 
124 
125 #endif /* REM_SPECTRUM_PHY_H */
Ptr< MobilityModel > GetMobility()
get the associated MobilityModel instance
double GetSinr(double noisePower)
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:45
void SetRxSpectrumModel(Ptr< const SpectrumModel > m)
set the RX spectrum model to be used
Ptr< AntennaModel > GetRxAntenna()
get the AntennaModel used by the NetDevice for reception
Ptr< NetDevice > GetDevice()
get the associated NetDevice instance
void Reset()
Reset the SINR calculator.
This minimal SpectrumPhy implemetation calculates the SINR with respect to the strongest signal for a...
void Deactivate()
make StartRx a no-op from now on, and mark instance as inactive
void StartRx(Ptr< SpectrumSignalParameters > params)
Notify the SpectrumPhy instance of an incoming signal.
Ptr< const SpectrumModel > m_rxSpectrumModel
Ptr< MobilityModel > m_mobility
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
static TypeId GetTypeId(void)
a unique identifier for an interface.
Definition: type-id.h:49
Ptr< const SpectrumModel > GetRxSpectrumModel() const
void SetDevice(Ptr< NetDevice > d)
set the associated NetDevice instance