A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
spectrum-analyzer.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 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 SPECTRUM_ANALYZER_H
22 #define SPECTRUM_ANALYZER_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 
49 {
50 
51 public:
53  virtual ~SpectrumAnalyzer ();
54 
55  static TypeId GetTypeId (void);
56 
57 // inherited from SpectrumPhy
60  void SetDevice (Ptr<NetDevice> d);
66 
67 
74 
81 
86  virtual void Start ();
87 
92  virtual void Stop ();
93 
94 
95 protected:
96  void DoDispose ();
97 
98 private:
103 
104  virtual void GenerateReport ();
105 
109 
116  bool m_active;
117 
119 
120 };
121 
122 
123 
124 
125 
126 
127 }
128 
129 
130 
131 
132 
133 #endif /* SPECTRUM_ANALYZER_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:79
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
Ptr< NetDevice > m_netDevice
void StartRx(Ptr< SpectrumSignalParameters > params)
Notify the SpectrumPhy instance of an incoming signal.
Ptr< NetDevice > GetDevice()
get the associated NetDevice instance
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Ptr< AntennaModel > m_antenna
virtual void Start()
Start the spectrum analyzer.
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
Ptr< SpectrumChannel > m_channel
static TypeId GetTypeId(void)
virtual void Stop()
Stop the spectrum analyzer.
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Set the spectrum model used by the SpectrumAnalyzer to represent incoming signals.
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
void SetDevice(Ptr< NetDevice > d)
set the associated NetDevice instance
Simple SpectrumPhy implemetation that averages the spectrum power density of incoming transmissions t...
void AddSignal(Ptr< const SpectrumValue > psd)
TracedCallback< Ptr< const SpectrumValue > > m_averagePowerSpectralDensityReportTrace
Ptr< SpectrumValue > m_sumPowerSpectralDensity
Ptr< SpectrumModel > m_spectrumModel
Ptr< MobilityModel > GetMobility()
get the associated MobilityModel instance
virtual void GenerateReport()
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
Ptr< const SpectrumModel > GetRxSpectrumModel() const
Ptr< AntennaModel > GetRxAntenna()
get the AntennaModel used by the NetDevice for reception
void SubtractSignal(Ptr< const SpectrumValue > psd)
a unique identifier for an interface.
Definition: type-id.h:49
Ptr< MobilityModel > m_mobility
Ptr< SpectrumValue > m_energySpectralDensity
void SetAntenna(Ptr< AntennaModel > a)
set the AntennaModel to be used