A Discrete-Event Network Simulator
API
lte-ue-power-control.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Piotr Gawlowicz
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: Piotr Gawlowicz <gawlowicz.p@gmail.com>
19  *
20  */
21 
22 #ifndef LTE_UE_POWER_CONTROL_H
23 #define LTE_UE_POWER_CONTROL_H
24 
25 #include <ns3/ptr.h>
26 #include <ns3/traced-callback.h>
27 #include <ns3/object.h>
28 #include <vector>
29 
30 
31 namespace ns3 {
32 
54 class LteUePowerControl : public Object
55 {
56 public:
57 
59  virtual ~LteUePowerControl ();
60 
61  // inherited from Object
62  static TypeId GetTypeId (void);
63  virtual void DoInitialize (void);
64  virtual void DoDispose (void);
65 
66  void SetPcmax (double value);
67  double GetPcmax ();
68 
69  void SetTxPower (double value);
70  void ConfigureReferenceSignalPower (int8_t referenceSignalPower);
71 
72  void SetCellId (uint16_t cellId);
73  void SetRnti (uint16_t rnti);
74 
75  void SetPoNominalPusch (int16_t value);
76  void SetPoUePusch (int16_t value);
77  void SetAlpha (double value);
78 
79  void SetRsrp (double value);
80  void ReportTpc (uint8_t tpc);
81 
82  void CalculatePuschTxPower ();
83  void CalculatePucchTxPower ();
84  void CalculateSrsTxPower ();
85 
86  double GetPuschTxPower (std::vector <int> rb);
87  double GetPucchTxPower (std::vector <int> rb);
88  double GetSrsTxPower (std::vector <int> rb);
89 
97  typedef void (* TxPowerTracedCallback)
98  (uint16_t cellId, uint16_t rnti, double power);
99 
100 private:
101  void SetSubChannelMask (std::vector <int> mask);
102 
103  double m_txPower;
104  double m_Pcmax;
105  double m_Pcmin;
106 
110 
112  bool m_rsrpSet;
113  double m_rsrp;
114 
115  std::vector<int16_t> m_PoNominalPusch;
116  std::vector<int16_t> m_PoUePusch;
117 
118  int16_t m_PsrsOffset;
119 
120  uint16_t m_M_Pusch;
121  std::vector<double> m_alpha;
122  double m_pathLoss;
123  double m_deltaTF;
124 
125  std::vector<int8_t> m_deltaPusch;
126  double m_fc;
127 
128  uint16_t m_srsBandwidth;
129 
132 
133  uint16_t m_cellId;
134  uint16_t m_rnti;
142 
143 };
144 
145 
146 }
147 
148 #endif /* LTE_UE_POWER_CONTROL_H */
void SetTxPower(double value)
void SetSubChannelMask(std::vector< int > mask)
std::vector< int16_t > m_PoNominalPusch
void SetCellId(uint16_t cellId)
double GetPuschTxPower(std::vector< int > rb)
void SetPoUePusch(int16_t value)
std::vector< int8_t > m_deltaPusch
TracedCallback< uint16_t, uint16_t, double > m_reportPucchTxPower
TracedCallback< uint16_t, uint16_t, double > m_reportSrsTxPower
virtual void DoInitialize(void)
Initialize() implementation.
TracedCallback< uint16_t, uint16_t, double > m_reportPuschTxPower
Trace information regarding Uplink TxPower uint16_t cellId, uint16_t rnti, double txPower...
static TypeId GetTypeId(void)
std::vector< int16_t > m_PoUePusch
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetPoNominalPusch(int16_t value)
std::vector< double > m_alpha
This class realizes Uplink Power Control functionality.
void SetRnti(uint16_t rnti)
void(* TxPowerTracedCallback)(uint16_t cellId, uint16_t rnti, double power)
TracedCallback signature for uplink transmit power.
double GetPucchTxPower(std::vector< int > rb)
double GetSrsTxPower(std::vector< int > rb)
A base class which provides memory management and object aggregation.
Definition: object.h:87
void ConfigureReferenceSignalPower(int8_t referenceSignalPower)
a unique identifier for an interface.
Definition: type-id.h:58
virtual void DoDispose(void)
Destructor implementation.