A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
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"
23
#include "ns3/mobility-model.h"
24
#include "ns3/net-device.h"
25
#include "
wifi-spectrum-phy-interface.h
"
26
#include "
spectrum-wifi-phy.h
"
27
28
NS_LOG_COMPONENT_DEFINE
(
"WifiSpectrumPhyInterface"
);
29
30
namespace
ns3
{
31
32
NS_OBJECT_ENSURE_REGISTERED
(WifiSpectrumPhyInterface);
33
34
TypeId
35
WifiSpectrumPhyInterface::GetTypeId
(
void
)
36
{
37
static
TypeId
tid =
TypeId
(
"ns3::WifiSpectrumPhyInterface"
)
38
.
SetParent
<
SpectrumPhy
> ()
39
.SetGroupName (
"Wifi"
);
40
return
tid;
41
}
42
43
WifiSpectrumPhyInterface::WifiSpectrumPhyInterface
()
44
{
45
NS_LOG_FUNCTION
(
this
);
46
}
47
48
void
49
WifiSpectrumPhyInterface::DoDispose
(
void
)
50
{
51
NS_LOG_FUNCTION
(
this
);
52
m_spectrumWifiPhy
= 0;
53
m_netDevice
= 0;
54
m_channel
= 0;
55
}
56
57
void
WifiSpectrumPhyInterface::SetSpectrumWifiPhy
(
const
Ptr<SpectrumWifiPhy>
spectrumWifiPhy)
58
{
59
m_spectrumWifiPhy
= spectrumWifiPhy;
60
}
61
62
Ptr<NetDevice>
63
WifiSpectrumPhyInterface::GetDevice
()
const
64
{
65
return
m_netDevice
;
66
}
67
68
Ptr<MobilityModel>
69
WifiSpectrumPhyInterface::GetMobility
()
const
70
{
71
return
m_spectrumWifiPhy
->
GetMobility
();
72
}
73
74
void
75
WifiSpectrumPhyInterface::SetDevice
(
const
Ptr<NetDevice>
d)
76
{
77
m_netDevice
= d;
78
}
79
80
void
81
WifiSpectrumPhyInterface::SetMobility
(
const
Ptr<MobilityModel>
m)
82
{
83
m_spectrumWifiPhy
->
SetMobility
(m);
84
}
85
86
void
87
WifiSpectrumPhyInterface::SetChannel
(
const
Ptr<SpectrumChannel>
c)
88
{
89
NS_LOG_FUNCTION
(
this
<< c);
90
m_channel
= c;
91
}
92
93
Ptr<const SpectrumModel>
94
WifiSpectrumPhyInterface::GetRxSpectrumModel
()
const
95
{
96
return
m_spectrumWifiPhy
->
GetRxSpectrumModel
();
97
}
98
99
Ptr<AntennaModel>
100
WifiSpectrumPhyInterface::GetRxAntenna
(
void
)
const
101
{
102
NS_LOG_FUNCTION
(
this
);
103
return
m_spectrumWifiPhy
->
GetRxAntenna
();
104
}
105
106
void
107
WifiSpectrumPhyInterface::StartRx
(
Ptr<SpectrumSignalParameters>
params)
108
{
109
m_spectrumWifiPhy
->
StartRx
(params);
110
}
111
112
}
//namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:205
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
ns3::SpectrumWifiPhy::StartRx
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
Definition:
spectrum-wifi-phy.cc:283
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiSpectrumPhyInterface::m_netDevice
Ptr< NetDevice > m_netDevice
the device
Definition:
wifi-spectrum-phy-interface.h:70
ns3::SpectrumWifiPhy::GetRxAntenna
Ptr< AntennaModel > GetRxAntenna(void) const
Get the antenna model used for reception.
Definition:
spectrum-wifi-phy.cc:422
ns3::WifiSpectrumPhyInterface::GetRxSpectrumModel
Ptr< const SpectrumModel > GetRxSpectrumModel() const override
Definition:
wifi-spectrum-phy-interface.cc:94
ns3::WifiSpectrumPhyInterface::SetDevice
void SetDevice(const Ptr< NetDevice > d) override
Set the associated NetDevice instance.
Definition:
wifi-spectrum-phy-interface.cc:75
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:923
ns3::WifiSpectrumPhyInterface::StartRx
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
Definition:
wifi-spectrum-phy-interface.cc:107
ns3::Ptr< SpectrumWifiPhy >
ns3::WifiSpectrumPhyInterface::m_channel
Ptr< SpectrumChannel > m_channel
spectrum channel
Definition:
wifi-spectrum-phy-interface.h:71
ns3::WifiSpectrumPhyInterface::GetRxAntenna
Ptr< AntennaModel > GetRxAntenna() const override
Get the AntennaModel used by the NetDevice for reception.
Definition:
wifi-spectrum-phy-interface.cc:100
ns3::WifiSpectrumPhyInterface::DoDispose
void DoDispose(void) override
Destructor implementation.
Definition:
wifi-spectrum-phy-interface.cc:49
ns3::SpectrumPhy
Abstract base class for Spectrum-aware PHY layers.
Definition:
spectrum-phy.h:46
ns3::WifiSpectrumPhyInterface::m_spectrumWifiPhy
Ptr< SpectrumWifiPhy > m_spectrumWifiPhy
spectrum PHY
Definition:
wifi-spectrum-phy-interface.h:69
ns3::WifiSpectrumPhyInterface::GetMobility
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
Definition:
wifi-spectrum-phy-interface.cc:69
spectrum-wifi-phy.h
ns3::WifiSpectrumPhyInterface::WifiSpectrumPhyInterface
WifiSpectrumPhyInterface()
Definition:
wifi-spectrum-phy-interface.cc:43
ns3::WifiSpectrumPhyInterface::GetDevice
Ptr< NetDevice > GetDevice() const override
Get the associated NetDevice instance.
Definition:
wifi-spectrum-phy-interface.cc:63
ns3::WifiPhy::SetMobility
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition:
wifi-phy.cc:789
wifi-spectrum-phy-interface.h
ns3::WifiPhy::GetMobility
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition:
wifi-phy.cc:795
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:244
ns3::WifiSpectrumPhyInterface::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
wifi-spectrum-phy-interface.cc:35
ns3::SpectrumWifiPhy::GetRxSpectrumModel
Ptr< const SpectrumModel > GetRxSpectrumModel()
Definition:
spectrum-wifi-phy.cc:118
ns3::WifiSpectrumPhyInterface::SetChannel
void SetChannel(const Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
Definition:
wifi-spectrum-phy-interface.cc:87
ns3::WifiSpectrumPhyInterface::SetSpectrumWifiPhy
void SetSpectrumWifiPhy(const Ptr< SpectrumWifiPhy > phy)
Connect SpectrumWifiPhy object.
Definition:
wifi-spectrum-phy-interface.cc:57
ns3::WifiSpectrumPhyInterface::SetMobility
void SetMobility(const Ptr< MobilityModel > m) override
Set the mobility model associated with this device.
Definition:
wifi-spectrum-phy-interface.cc:81
src
wifi
model
wifi-spectrum-phy-interface.cc
Generated on Fri Oct 1 2021 17:03:50 for ns-3 by
1.8.20