added TX power attribute

This commit is contained in:
Nicola Baldo
2011-04-06 14:48:55 +02:00
parent 14dda92abb
commit 0ce02e123b
6 changed files with 62 additions and 29 deletions

View File

@@ -23,7 +23,10 @@
#include <ns3/log.h>
#include <math.h>
#include <ns3/simulator.h>
#include "ns3/spectrum-error-model.h"
#include <ns3/attribute-accessor-helper.h>
#include <ns3/double.h>
#include "lte-enb-phy.h"
#include "lte-net-device.h"
#include "lte-spectrum-value-helper.h"
@@ -112,6 +115,12 @@ LteEnbPhy::GetTypeId (void)
static TypeId tid = TypeId ("ns3::LteEnbPhy")
.SetParent<LtePhy> ()
.AddConstructor<LteEnbPhy> ()
.AddAttribute ("TxPower",
"Transmission power in dBm",
DoubleValue (30.0),
MakeDoubleAccessor (&LteEnbPhy::SetTxPower,
&LteEnbPhy::GetTxPower),
MakeDoubleChecker<double> ())
;
return tid;
}
@@ -142,7 +151,19 @@ LteEnbPhy::GetLteEnbPhySapProvider ()
return (m_enbPhySapProvider);
}
void
LteEnbPhy::SetTxPower (double pow)
{
NS_LOG_FUNCTION (this << pow);
m_txPower = pow;
}
double
LteEnbPhy::GetTxPower () const
{
NS_LOG_FUNCTION (this);
return m_txPower;
}
bool
LteEnbPhy::AddUePhy (uint8_t rnti, Ptr<LteUePhy> phy)

View File

@@ -67,6 +67,15 @@ public:
*/
void SetLteEnbPhySapUser (LteEnbPhySapUser* s);
/**
* \param pw the transmission power in dBm
*/
void SetTxPower (double pow);
/**
* \return the transmission power in dBm
*/
double GetTxPower () const;
/**
* \brief Queue the MAC PDU to be sent

View File

@@ -183,22 +183,6 @@ LtePhy::GetUplinkSubChannels (void)
return m_listOfUplinkSubchannel;
}
void
LtePhy::SetTxPower (double pw)
{
NS_LOG_FUNCTION (this << pw);
m_txPower = pw;
}
double
LtePhy::GetTxPower (void)
{
NS_LOG_FUNCTION (this);
return m_txPower;
}
void
LtePhy::SetTti (double tti)
{

View File

@@ -136,17 +136,6 @@ public:
*/
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity () = 0;
/**
* \brief Set the power transmisison, expressed in dBm
* \param pw the power transmission
*/
void SetTxPower (double pw);
/**
* \brief Get the power transmission, expressed in dBm
* \return the power transmission
*/
double GetTxPower (void);
void DoDispose ();
/**

View File

@@ -24,7 +24,7 @@
#include <ns3/log.h>
#include <math.h>
#include <ns3/simulator.h>
#include <ns3/spectrum-error-model.h>
#include <ns3/double.h>
#include "lte-ue-phy.h"
#include "lte-enb-phy.h"
#include "lte-net-device.h"
@@ -124,6 +124,12 @@ LteUePhy::GetTypeId (void)
static TypeId tid = TypeId ("ns3::LteUePhy")
.SetParent<LtePhy> ()
.AddConstructor<LteUePhy> ()
.AddAttribute ("TxPower",
"Transmission power in dBm",
DoubleValue (10.0),
MakeDoubleAccessor (&LteUePhy::SetTxPower,
&LteUePhy::GetTxPower),
MakeDoubleChecker<double> ())
;
return tid;
}
@@ -143,6 +149,19 @@ LteUePhy::GetLteUePhySapProvider ()
return (m_uePhySapProvider);
}
void
LteUePhy::SetTxPower (double pow)
{
NS_LOG_FUNCTION (this << pow);
m_txPower = pow;
}
double
LteUePhy::GetTxPower () const
{
NS_LOG_FUNCTION (this);
return m_txPower;
}
void
LteUePhy::DoSendMacPdu (Ptr<Packet> p)

View File

@@ -66,6 +66,17 @@ public:
*/
void SetLteUePhySapUser (LteUePhySapUser* s);
/**
* \param pw the transmission power in dBm
*/
void SetTxPower (double pow);
/**
* \return the transmission power in dBm
*/
double GetTxPower () const;
/**
* \brief Queue the MAC PDU to be sent
* \param p the MAC PDU to sent