A Discrete-Event Network Simulator
API
wifi-spectrum-phy-interface.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 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
21
22#include "spectrum-wifi-phy.h"
23
24#include "ns3/log.h"
25#include "ns3/mobility-model.h"
26#include "ns3/net-device.h"
27#include "ns3/spectrum-value.h"
28
29NS_LOG_COMPONENT_DEFINE("WifiSpectrumPhyInterface");
30
31namespace ns3
32{
33
34NS_OBJECT_ENSURE_REGISTERED(WifiSpectrumPhyInterface);
35
36TypeId
38{
39 static TypeId tid =
40 TypeId("ns3::WifiSpectrumPhyInterface").SetParent<SpectrumPhy>().SetGroupName("Wifi");
41 return tid;
42}
43
45{
46 NS_LOG_FUNCTION(this);
47}
48
49void
51{
52 NS_LOG_FUNCTION(this);
53 m_spectrumWifiPhy = nullptr;
54 m_netDevice = nullptr;
55 m_channel = nullptr;
56}
57
58void
60{
61 m_spectrumWifiPhy = spectrumWifiPhy;
62}
63
66{
67 return m_netDevice;
68}
69
72{
74}
75
76void
78{
79 m_netDevice = d;
80}
81
82void
84{
86}
87
88void
90{
91 NS_LOG_FUNCTION(this << c);
92 m_channel = c;
93}
94
97{
99}
100
103{
105}
106
107void
109{
111}
112
113} // namespace ns3
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:46
Ptr< const SpectrumModel > GetRxSpectrumModel()
Ptr< Object > GetAntenna() const
Get the antenna model used for reception.
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
Ptr< MobilityModel > GetMobility() const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:618
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:612
void SetDevice(const Ptr< NetDevice > d) override
Set the associated NetDevice instance.
Ptr< Object > GetAntenna() const override
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
void SetSpectrumWifiPhy(const Ptr< SpectrumWifiPhy > phy)
Connect SpectrumWifiPhy object.
Ptr< NetDevice > m_netDevice
the device
void SetChannel(const Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
void DoDispose() override
Destructor implementation.
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
Ptr< const SpectrumModel > GetRxSpectrumModel() const override
void SetMobility(const Ptr< MobilityModel > m) override
Set the mobility model associated with this device.
Ptr< NetDevice > GetDevice() const override
Get the associated NetDevice instance.
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
static TypeId GetTypeId()
Get the type ID.
Ptr< SpectrumChannel > m_channel
spectrum channel
Ptr< SpectrumWifiPhy > m_spectrumWifiPhy
spectrum PHY
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
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 ##.