author | Nicola Baldo <nbaldo@cttc.es> |
Mon, 05 Mar 2012 15:52:14 +0100 | |
changeset 8664 | ab4c821fc251 |
parent 8522 | 795ea37db2ff |
child 8670 | 8f63d16fb2e8 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents:
7238
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6705 | 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> |
|
7886 | 19 |
* Author: Marco Miozzo <mmiozzo@cttc.es> |
6705 | 20 |
*/ |
21 |
||
7887 | 22 |
#ifndef LTE_UE_PHY_H |
23 |
#define LTE_UE_PHY_H |
|
6705 | 24 |
|
25 |
||
7886 | 26 |
#include <ns3/lte-phy.h> |
27 |
#include <ns3/ff-mac-common.h> |
|
28 |
||
29 |
#include <ns3/ideal-control-messages.h> |
|
7887 | 30 |
#include <ns3/lte-amc.h> |
7886 | 31 |
#include <ns3/lte-ue-phy-sap.h> |
32 |
#include <ns3/ptr.h> |
|
8517
4446f1535b9e
Update LteUePhy for working with new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
33 |
#include <ns3/lte-amc.h> |
7886 | 34 |
|
6705 | 35 |
|
36 |
namespace ns3 { |
|
37 |
||
38 |
class PacketBurst; |
|
39 |
class LteNetDevice; |
|
7887 | 40 |
class LteEnbPhy; |
6705 | 41 |
|
42 |
/** |
|
7238
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
43 |
* \ingroup lte |
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
44 |
* |
6705 | 45 |
* The LteSpectrumPhy models the physical layer of LTE |
46 |
*/ |
|
7887 | 47 |
class LteUePhy : public LtePhy |
6705 | 48 |
{ |
49 |
||
7887 | 50 |
friend class UeMemberLteUePhySapProvider; |
7886 | 51 |
|
6705 | 52 |
public: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
53 |
/** |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
54 |
* @warning the default constructor should not be used |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
55 |
*/ |
7887 | 56 |
LteUePhy (); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
57 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
58 |
/** |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
59 |
* |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
60 |
* \param dlPhy the downlink LteSpectrumPhy instance |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
61 |
* \param ulPhy the uplink LteSpectrumPhy instance |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
62 |
*/ |
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
63 |
LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
64 |
|
7887 | 65 |
virtual ~LteUePhy (); |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
66 |
|
8015 | 67 |
// inherited from Object |
7886 | 68 |
static TypeId GetTypeId (void); |
8015 | 69 |
virtual void DoStart (void); |
70 |
virtual void DoDispose (void); |
|
6705 | 71 |
|
72 |
/** |
|
7886 | 73 |
* \brief Get the PHY SAP provider |
74 |
* \return a pointer to the SAP Provider of the PHY |
|
6705 | 75 |
*/ |
7886 | 76 |
LteUePhySapProvider* GetLteUePhySapProvider (); |
6705 | 77 |
|
78 |
/** |
|
7886 | 79 |
* \brief Set the PHY SAP User |
80 |
* \param s a pointer to the PHY SAP user |
|
81 |
*/ |
|
82 |
void SetLteUePhySapUser (LteUePhySapUser* s); |
|
83 |
||
7949 | 84 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
85 |
/** |
7949 | 86 |
* \param pw the transmission power in dBm |
87 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
88 |
void SetTxPower (double pow); |
7949 | 89 |
|
90 |
/** |
|
91 |
* \return the transmission power in dBm |
|
92 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
93 |
double GetTxPower () const; |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
94 |
/** |
7981 | 95 |
* \param pw the noise figure in dB |
96 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
97 |
void SetNoiseFigure (double pow); |
7981 | 98 |
|
99 |
/** |
|
100 |
* \return the noise figure in dB |
|
101 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
102 |
double GetNoiseFigure () const; |
7949 | 103 |
|
7886 | 104 |
/** |
105 |
* \brief Queue the MAC PDU to be sent |
|
106 |
* \param p the MAC PDU to sent |
|
6705 | 107 |
*/ |
7886 | 108 |
virtual void DoSendMacPdu (Ptr<Packet> p); |
6705 | 109 |
|
110 |
/** |
|
111 |
* \brief Create the PSD for the TX |
|
112 |
* \return the pointer to the PSD |
|
113 |
*/ |
|
114 |
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (); |
|
115 |
||
116 |
/** |
|
117 |
* \brief Update available channel for TX |
|
118 |
*/ |
|
119 |
virtual void DoSetUplinkSubChannels (); |
|
120 |
||
121 |
/** |
|
122 |
* \brief Set a list of sub channels to use in TX |
|
123 |
* \param mask a list of sub channels |
|
124 |
*/ |
|
125 |
void SetSubChannelsForTransmission (std::vector <int> mask); |
|
126 |
/** |
|
127 |
* \brief Get a list of sub channels to use in RX |
|
128 |
* \return a list of sub channels |
|
129 |
*/ |
|
130 |
std::vector <int> GetSubChannelsForTransmission (void); |
|
131 |
||
132 |
/** |
|
133 |
* \brief Get a list of sub channels to use in RX |
|
134 |
* \param mask list of sub channels |
|
135 |
*/ |
|
136 |
void SetSubChannelsForReception (std::vector <int> mask); |
|
137 |
/** |
|
138 |
* \brief Get a list of sub channels to use in RX |
|
139 |
* \return a list of sub channels |
|
140 |
*/ |
|
141 |
std::vector <int> GetSubChannelsForReception (void); |
|
142 |
||
143 |
||
144 |
/** |
|
7886 | 145 |
* \brief Create the DL CQI feedback from SINR values perceived at |
146 |
* the physical layer with the signal received from eNB |
|
147 |
* \param sinr SINR values vector |
|
148 |
*/ |
|
149 |
Ptr<DlCqiIdealControlMessage> CreateDlCqiFeedbackMessage (const SpectrumValue& sinr); |
|
150 |
||
151 |
||
152 |
||
153 |
// inherited from LtePhy |
|
8664
ab4c821fc251
revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents:
8522
diff
changeset
|
154 |
virtual void GenerateCqiReport (const SpectrumValue& sinr); |
7886 | 155 |
|
156 |
virtual void DoSendIdealControlMessage (Ptr<IdealControlMessage> msg); |
|
157 |
virtual void ReceiveIdealControlMessage (Ptr<IdealControlMessage> msg); |
|
158 |
||
159 |
||
160 |
||
161 |
/** |
|
162 |
* \brief PhySpectrum received a new PHY-PDU |
|
6705 | 163 |
*/ |
7886 | 164 |
void PhyPduReceived (Ptr<Packet> p); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
165 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
166 |
|
7886 | 167 |
/** |
168 |
* \brief trigger from eNB the start from a new frame |
|
169 |
* |
|
170 |
* \param frameNo frame number |
|
171 |
* \param subframeNo subframe number |
|
172 |
*/ |
|
173 |
void SubframeIndication (uint32_t frameNo, uint32_t subframeNo); |
|
174 |
||
6705 | 175 |
|
7886 | 176 |
/** |
177 |
* \param rnti the rnti assigned to the UE |
|
178 |
*/ |
|
179 |
void SetRnti (uint16_t rnti); |
|
180 |
||
181 |
||
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
182 |
/** |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
183 |
* set the cellId of the eNb this PHY is synchronized with |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
184 |
* |
7886 | 185 |
* \param cellId the cell identifier of the eNB |
186 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
187 |
void SetEnbCellId (uint16_t cellId); |
7886 | 188 |
|
6705 | 189 |
|
190 |
private: |
|
191 |
std::vector <int> m_subChannelsForTransmission; |
|
192 |
std::vector <int> m_subChannelsForReception; |
|
8517
4446f1535b9e
Update LteUePhy for working with new LteAmc object
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8253
diff
changeset
|
193 |
|
8522
795ea37db2ff
Change LteAmc* to Ptr<LteAmc> in LteUePhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8517
diff
changeset
|
194 |
Ptr<LteAmc> m_amc; |
7886 | 195 |
|
196 |
Time m_p10CqiPeriocity; /**< Wideband Periodic CQI: 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms */ |
|
197 |
Time m_p10CqiLast; |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
198 |
|
7895
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
199 |
/**< SubBand Aperiodic CQI: activated by DCI format 0 or Random Access Response Grant */ |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
200 |
// NOTE defines a periodicity for academic studies |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
201 |
Time m_a30CqiPeriocity; |
f20bb71f9b71
Aperiodic high layer configured subband CQI (A30 type) implemented
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7893
diff
changeset
|
202 |
Time m_a30CqiLast; |
7886 | 203 |
|
204 |
LteUePhySapProvider* m_uePhySapProvider; |
|
205 |
LteUePhySapUser* m_uePhySapUser; |
|
206 |
||
207 |
uint16_t m_rnti; |
|
208 |
||
7893 | 209 |
uint16_t m_enbCellId; |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
210 |
|
6705 | 211 |
}; |
212 |
||
213 |
||
214 |
} |
|
215 |
||
7887 | 216 |
#endif /* LTE_UE_PHY_H */ |