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"
23#include "ns3/mobility-model.h"
24#include "ns3/net-device.h"
26#include "spectrum-wifi-phy.h"
27
28NS_LOG_COMPONENT_DEFINE ("WifiSpectrumPhyInterface");
29
30namespace ns3 {
31
32NS_OBJECT_ENSURE_REGISTERED (WifiSpectrumPhyInterface);
33
34TypeId
36{
37 static TypeId tid = TypeId ("ns3::WifiSpectrumPhyInterface")
39 .SetGroupName ("Wifi");
40 return tid;
41}
42
44{
45 NS_LOG_FUNCTION (this);
46}
47
48void
50{
51 NS_LOG_FUNCTION (this);
53 m_netDevice = 0;
54 m_channel = 0;
55}
56
58{
59 m_spectrumWifiPhy = spectrumWifiPhy;
60}
61
64{
65 return m_netDevice;
66}
67
70{
72}
73
74void
76{
77 m_netDevice = d;
78}
79
80void
82{
84}
85
86void
88{
89 NS_LOG_FUNCTION (this << c);
90 m_channel = c;
91}
92
95{
97}
98
101{
102 NS_LOG_FUNCTION (this);
103 return m_spectrumWifiPhy->GetAntenna ();
104}
105
106void
108{
109 m_spectrumWifiPhy->StartRx (params);
110}
111
112} //namespace ns3
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:47
Ptr< Object > GetAntenna(void) const
Get the antenna model used for reception.
Ptr< const SpectrumModel > GetRxSpectrumModel()
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:922
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:544
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:538
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.
static TypeId GetTypeId(void)
Get the type ID.
Ptr< NetDevice > m_netDevice
the device
void SetChannel(const Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
void DoDispose(void) 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.
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:205
#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:45
Every class exported by the ns3 library is enclosed in the ns3 namespace.