A Discrete-Event Network Simulator
API
tv-spectrum-transmitter.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 University of Washington
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: Benjamin Cizdziel <ben.cizdziel@gmail.com>
19  */
20 
21 #ifndef TV_SPECTRUM_TRANSMITTER_H
22 #define TV_SPECTRUM_TRANSMITTER_H
23 
24 #include <ns3/spectrum-value.h>
25 #include <ns3/spectrum-phy.h>
26 #include <ns3/spectrum-channel.h>
27 #include <ns3/antenna-model.h>
28 #include <ns3/spectrum-signal-parameters.h>
29 #include <ns3/mobility-model.h>
30 #include <ns3/net-device.h>
31 
32 namespace ns3
33 {
34 
35 
47 {
48 
49 public:
53  enum TvType
54  {
58  };
59 
61  virtual ~TvSpectrumTransmitter ();
62 
67  static TypeId GetTypeId (void);
68 
69  // inherited from SpectrumPhy
72  void SetDevice (Ptr<NetDevice> d);
74  Ptr<NetDevice> GetDevice () const;
75  // device does not use Rx but these pure virtual methods must be implemented
79 
86 
110  virtual void CreateTvPsd ();
111 
117  Ptr<SpectrumValue> GetTxPsd () const;
118 
122  virtual void Start ();
123 
127  virtual void Stop ();
128 
129 
130 private:
135 
137  virtual void SetupTx ();
138 
142  double m_basePsd;
146  bool m_active;
147 
148 };
149 
150 } // namespace ns3
151 
152 #endif /* TV_SPECTRUM_TRANSMITTER_H */
void SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
Ptr< SpectrumChannel > m_channel
Pointer to spectrum channel object.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:45
Ptr< SpectrumChannel > GetChannel() const
Get the spectrum channel.
Ptr< AntennaModel > m_antenna
Pointer to antenna model object.
virtual void CreateTvPsd()
Creates power spectral density (PSD) spectrum of the TV transmitter and sets it for transmission...
Ptr< NetDevice > m_netDevice
Pointer to net device object.
void StartRx(Ptr< SpectrumSignalParameters > params)
Notify the SpectrumPhy instance of an incoming signal.
virtual void Stop()
Stops the TV Transmitter&#39;s transmission on the spectrum channel.
Ptr< AntennaModel > GetRxAntenna()
Get the AntennaModel used by the NetDevice for reception.
enum TvType m_tvType
Type of TV transmitter.
bool m_active
True if TV transmitter is transmitting.
Ptr< SpectrumValue > m_txPsd
Pointer to power spectral density of TV transmitter&#39;s signal.
double m_startFrequency
Start frequency (in Hz) of TV transmitter&#39;s signal.
virtual void Start()
Starts the TV Transmitter&#39;s transmission on the spectrum channel.
Ptr< MobilityModel > GetMobility()
Get the associated MobilityModel instance.
double m_channelBandwidth
Bandwidth (in Hz) of TV transmitter&#39;s signal.
Time m_transmitDuration
Length of time that TV transmitter will transmit for.
Time m_startingTime
Timepoint after simulation begins that TV transmitter will begin transmitting.
virtual void SetupTx()
Sets up signal to be transmitted.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< NetDevice > GetDevice() const
Get the associated NetDevice instance.
SpectrumPhy implementation that creates a customizable TV transmitter which transmits a PSD spectrum ...
Ptr< MobilityModel > m_mobility
Pointer to mobility model object.
double m_basePsd
Base power spectral density value (in dBm/Hz) of TV transmitter&#39;s signal.
static TypeId GetTypeId(void)
Register this type.
Ptr< const SpectrumModel > GetRxSpectrumModel() const
void SetMobility(Ptr< MobilityModel > m)
Set the mobility model associated with this device.
void SetDevice(Ptr< NetDevice > d)
Set the associated NetDevice instance.
Ptr< SpectrumValue > GetTxPsd() const
Get the power spectral density of the TV transmitter&#39;s signal.
a unique identifier for an interface.
Definition: type-id.h:58
TvType
types of TV transmitters: analog, digital 8-VSB, or digital COFDM