A Discrete-Event Network Simulator
API
wifi-spectrum-phy-interface.cc
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 #include <ns3/log.h>
22 #include <ns3/spectrum-value.h>
24 #include "spectrum-wifi-phy.h"
25 
26 NS_LOG_COMPONENT_DEFINE ("WifiSpectrumPhyInterface");
27 
28 namespace ns3 {
29 
30 NS_OBJECT_ENSURE_REGISTERED (WifiSpectrumPhyInterface);
31 
32 TypeId
34 {
35  static TypeId tid = TypeId ("ns3::WifiSpectrumPhyInterface")
37  .SetGroupName ("Wifi");
38  return tid;
39 }
40 
42 {
43  NS_LOG_FUNCTION (this);
44 }
45 
46 void
48 {
49  NS_LOG_FUNCTION (this);
51  m_netDevice = 0;
52  m_channel = 0;
53 }
54 
56 {
57  m_spectrumWifiPhy = spectrumWifiPhy;
58 }
59 
62 {
63  return m_netDevice;
64 }
65 
68 {
69  return m_spectrumWifiPhy->GetMobility ();
70 }
71 
72 void
74 {
75  m_netDevice = d;
76 }
77 
78 void
80 {
82 }
83 
84 void
86 {
87  NS_LOG_FUNCTION (this << c);
88  m_channel = c;
89 }
90 
93 {
95 }
96 
99 {
100  NS_LOG_FUNCTION (this);
101  return m_spectrumWifiPhy->GetRxAntenna ();
102 }
103 
104 void
106 {
107  m_spectrumWifiPhy->StartRx (params);
108 }
109 
110 } //namespace ns3
void SetDevice(const Ptr< NetDevice > d)
Set the associated NetDevice instance.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:45
Ptr< NetDevice > GetDevice() const
Get the associated NetDevice instance.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level Phy interface to this Sp...
void SetSpectrumWifiPhy(const Ptr< SpectrumWifiPhy > phy)
Connect SpectrumWifiPhy object.
Ptr< SpectrumChannel > m_channel
spectrum channel
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:682
static TypeId GetTypeId(void)
Get the type ID.
void StartRx(Ptr< SpectrumSignalParameters > params)
Notify the SpectrumPhy instance of an incoming signal.
Ptr< const SpectrumModel > GetRxSpectrumModel() const
Ptr< NetDevice > m_netDevice
the device
Ptr< MobilityModel > GetMobility()
Get the associated MobilityModel instance.
virtual void DoDispose(void)
Destructor implementation.
Ptr< AntennaModel > GetRxAntenna(void) const
Get the antenna model used for reception.
void SetChannel(const Ptr< SpectrumChannel > c)
Set the channel attached to this device.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< AntennaModel > GetRxAntenna()
Get the AntennaModel used by the NetDevice for reception.
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:688
Ptr< const SpectrumModel > GetRxSpectrumModel() const
Ptr< SpectrumWifiPhy > m_spectrumWifiPhy
spectrum phy
void SetMobility(const Ptr< MobilityModel > m)
Set the mobility model associated with this device.
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:914