A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-ue-phy.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
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: Giuseppe Piro <g.piro@poliba.it>
19  * Author: Marco Miozzo <mmiozzo@cttc.es>
20  */
21 
22 #ifndef LTE_UE_PHY_H
23 #define LTE_UE_PHY_H
24 
25 
26 #include <ns3/lte-phy.h>
27 #include <ns3/ff-mac-common.h>
28 
29 #include <ns3/lte-control-messages.h>
30 #include <ns3/lte-amc.h>
31 #include <ns3/lte-ue-phy-sap.h>
32 #include <ns3/lte-ue-cphy-sap.h>
33 #include <ns3/ptr.h>
34 #include <ns3/lte-amc.h>
35 
36 
37 namespace ns3 {
38 
39 class PacketBurst;
40 class LteEnbPhy;
41 class LteHarqPhy;
42 
48 class LteUePhy : public LtePhy
49 {
50 
53 
54 public:
58  LteUePhy ();
59 
66 
67  virtual ~LteUePhy ();
68 
69  // inherited from Object
70  static TypeId GetTypeId (void);
71  virtual void DoInitialize (void);
72  virtual void DoDispose (void);
73 
79 
85 
91 
97 
98 
102  void SetTxPower (double pow);
103 
107  double GetTxPower () const;
111  void SetNoiseFigure (double pow);
112 
116  double GetNoiseFigure () const;
117 
121  uint8_t GetMacChDelay (void) const;
122 
127 
132 
133 
139 
144  void SetSubChannelsForTransmission (std::vector <int> mask);
149  std::vector <int> GetSubChannelsForTransmission (void);
150 
155  void SetSubChannelsForReception (std::vector <int> mask);
160  std::vector <int> GetSubChannelsForReception (void);
161 
162 
169 
170 
171 
172  // inherited from LtePhy
173  virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
174  virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
175  virtual void ReportInterference (const SpectrumValue& interf);
176  virtual void ReportRsReceivedPower (const SpectrumValue& power);
177 
179 
180 
181 
182 
186  void PhyPduReceived (Ptr<Packet> p);
187 
188 
195  void SubframeIndication (uint32_t frameNo, uint32_t subframeNo);
196 
197 
201  void SendSrs ();
202 
207 
211  void SetHarqPhyModule (Ptr<LteHarqPhy> harq);
212 
213 
214 
215 
216 private:
217 
218  void SetTxMode1Gain (double gain);
219  void SetTxMode2Gain (double gain);
220  void SetTxMode3Gain (double gain);
221  void SetTxMode4Gain (double gain);
222  void SetTxMode5Gain (double gain);
223  void SetTxMode6Gain (double gain);
224  void SetTxMode7Gain (double gain);
225  void SetTxModeGain (uint8_t txMode, double gain);
226 
227  void QueueSubChannelsForTransmission (std::vector <int> rbMap);
228 
229  // UE CPHY SAP methods
230  void DoReset ();
231  void DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn);
232  void DoSetDlBandwidth (uint8_t ulBandwidth);
233  void DoConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth);
234  void DoSetRnti (uint16_t rnti);
235  void DoSetTransmissionMode (uint8_t txMode);
236  void DoSetSrsConfigurationIndex (uint16_t srcCi);
237 
238  // UE PHY SAP methods
239  virtual void DoSendMacPdu (Ptr<Packet> p);
241  virtual void DoSendRachPreamble (uint32_t prachId, uint32_t raRnti);
242 
243  std::vector <int> m_subChannelsForTransmission;
244  std::vector <int> m_subChannelsForReception;
245 
246  std::vector< std::vector <int> > m_subChannelsForTransmissionQueue;
247 
248 
250 
253 
255  // NOTE defines a periodicity for academic studies
258 
261 
264 
265  uint16_t m_rnti;
266 
268  std::vector <double> m_txModeGain;
269 
272  uint16_t m_srsConfigured;
274 
277 
280 
282 
283  uint32_t m_raPreambleId;
284  uint32_t m_raRnti;
285 
293 
295 
301 
302 };
303 
304 
305 }
306 
307 #endif /* LTE_UE_PHY_H */