author | Marco Miozzo <marco.miozzo@cttc.es> |
Fri, 16 Sep 2011 15:41:07 +0200 | |
changeset 8180 | 5429db8b8c37 |
parent 8148 | 09e2d03022a2 |
child 8253 | 6faee3d1d1d0 |
permissions | -rw-r--r-- |
6705 | 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> |
|
7886 | 19 |
* Author: Marco Miozzo <marco.miozzo@cttc.es> |
6705 | 20 |
*/ |
21 |
||
22 |
#ifndef ENB_LTE_PHY_H |
|
23 |
#define ENB_LTE_PHY_H |
|
24 |
||
25 |
||
26 |
#include "lte-phy.h" |
|
7886 | 27 |
#include <ns3/lte-enb-phy-sap.h> |
28 |
#include <map> |
|
7887 | 29 |
#include <ns3/lte-ue-phy.h> |
6705 | 30 |
|
31 |
namespace ns3 { |
|
32 |
||
33 |
class PacketBurst; |
|
34 |
class LteNetDevice; |
|
35 |
||
36 |
/** |
|
7238
85a7e87bb4cc
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6852
diff
changeset
|
37 |
* \ingroup lte |
7887 | 38 |
* LteEnbPhy models the physical layer for the eNodeB |
6705 | 39 |
*/ |
7887 | 40 |
class LteEnbPhy : public LtePhy |
6705 | 41 |
{ |
42 |
||
7886 | 43 |
friend class EnbMemberLteEnbPhySapProvider; |
44 |
||
6705 | 45 |
public: |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
46 |
/** |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
47 |
* @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
|
48 |
*/ |
7887 | 49 |
LteEnbPhy (); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
50 |
|
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
51 |
/** |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
52 |
* |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
53 |
* \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
|
54 |
* \param ulPhy the uplink LteSpectrumPhy instance |
6705 | 55 |
*/ |
7980
f07d99163a56
LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents:
7949
diff
changeset
|
56 |
LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
57 |
|
7887 | 58 |
virtual ~LteEnbPhy (); |
6705 | 59 |
|
8015 | 60 |
// inherited from Object |
6705 | 61 |
static TypeId GetTypeId (void); |
8015 | 62 |
virtual void DoStart (void); |
7913
ed3a9f8a76d7
added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
63 |
virtual void DoDispose (void); |
6705 | 64 |
|
7886 | 65 |
|
6705 | 66 |
/** |
7886 | 67 |
* \brief Get the PHY SAP provider |
68 |
* \return a pointer to the SAP Provider of the PHY |
|
69 |
*/ |
|
70 |
LteEnbPhySapProvider* GetLteEnbPhySapProvider (); |
|
71 |
||
72 |
/** |
|
73 |
* \brief Set the PHY SAP User |
|
74 |
* \param s a pointer to the PHY SAP user |
|
75 |
*/ |
|
76 |
void SetLteEnbPhySapUser (LteEnbPhySapUser* s); |
|
77 |
||
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
78 |
/** |
7949 | 79 |
* \param pw the transmission power in dBm |
80 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
81 |
void SetTxPower (double pow); |
7949 | 82 |
|
83 |
/** |
|
84 |
* \return the transmission power in dBm |
|
85 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
86 |
double GetTxPower () const; |
7886 | 87 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
88 |
/** |
7981 | 89 |
* \param pw the noise figure in dB |
90 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
91 |
void SetNoiseFigure (double pow); |
7981 | 92 |
|
93 |
/** |
|
94 |
* \return the noise figure in dB |
|
95 |
*/ |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
96 |
double GetNoiseFigure () const; |
7981 | 97 |
|
7886 | 98 |
/** |
99 |
* \brief Queue the MAC PDU to be sent |
|
100 |
* \param p the MAC PDU to sent |
|
101 |
*/ |
|
102 |
virtual void DoSendMacPdu (Ptr<Packet> p); |
|
103 |
||
104 |
||
6705 | 105 |
void DoSetDownlinkSubChannels (); |
106 |
||
107 |
/** |
|
108 |
* \brief Create the PSD for TX |
|
109 |
*/ |
|
110 |
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (); |
|
111 |
||
112 |
/** |
|
113 |
* \brief Calculate the channel quality for a given UE |
|
114 |
* \param sinr a list of computed SINR |
|
115 |
* \param ue the UE |
|
116 |
*/ |
|
117 |
void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue); |
|
118 |
||
119 |
/** |
|
120 |
* \brief Send the control message |
|
121 |
* \param msg the message to send |
|
122 |
*/ |
|
7886 | 123 |
// virtual void SendIdealControlMessage (Ptr<IdealControlMessage> msg); // legacy |
6705 | 124 |
/** |
125 |
* \brief Receive the control message |
|
126 |
* \param msg the received message |
|
127 |
*/ |
|
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6705
diff
changeset
|
128 |
virtual void ReceiveIdealControlMessage (Ptr<IdealControlMessage> msg); |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
129 |
|
7910 | 130 |
/** |
131 |
* \brief Create the UL CQI feedback from SINR values perceived at |
|
132 |
* the physical layer with the signal received from eNB |
|
133 |
* \param sinr SINR values vector |
|
134 |
*/ |
|
7937
b710e8c3c7f7
fixed compilation error in lte-enb-phy.h
Nicola Baldo <nbaldo@cttc.es>
parents:
7934
diff
changeset
|
135 |
UlCqi_s CreateUlCqiReport (const SpectrumValue& sinr); |
6705 | 136 |
|
137 |
||
7886 | 138 |
void DoSendIdealControlMessage (Ptr<IdealControlMessage> msg); |
139 |
||
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
140 |
bool AddUePhy (uint16_t rnti, Ptr<LteUePhy> phy); |
7886 | 141 |
|
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
142 |
bool DeleteUePhy (uint16_t rnti); |
7886 | 143 |
|
144 |
||
6705 | 145 |
/** |
146 |
* \brief Start a LTE frame |
|
147 |
*/ |
|
148 |
void StartFrame (void); |
|
149 |
/** |
|
150 |
* \brief Start a LTE sub frame |
|
151 |
*/ |
|
152 |
void StartSubFrame (void); |
|
153 |
/** |
|
154 |
* \brief End a LTE sub frame |
|
155 |
*/ |
|
156 |
void EndSubFrame (void); |
|
157 |
/** |
|
158 |
* \brief End a LTE frame |
|
159 |
*/ |
|
160 |
void EndFrame (void); |
|
161 |
||
7886 | 162 |
/** |
163 |
* \brief PhySpectrum received a new PHY-PDU |
|
164 |
*/ |
|
165 |
void PhyPduReceived (Ptr<Packet> p); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
166 |
|
7886 | 167 |
// inherited from LtePhy |
168 |
virtual void GenerateCqiFeedback (const SpectrumValue& sinr); |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8098
diff
changeset
|
169 |
|
6705 | 170 |
|
171 |
private: |
|
8180
5429db8b8c37
Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8148
diff
changeset
|
172 |
std::map <uint16_t, Ptr<LteUePhy> > m_ueAttached; |
7886 | 173 |
|
174 |
LteEnbPhySapProvider* m_enbPhySapProvider; |
|
175 |
LteEnbPhySapUser* m_enbPhySapUser; |
|
176 |
||
177 |
uint32_t m_nrFrames; |
|
178 |
uint32_t m_nrSubFrames; |
|
6705 | 179 |
}; |
180 |
||
181 |
||
182 |
} |
|
183 |
||
7887 | 184 |
#endif /* LTE_ENB_PHY_H */ |