author | mmiozzo |
Tue, 29 Mar 2011 17:20:57 +0200 | |
changeset 7910 | d7083e401e59 |
parent 7887 | 78911c978517 |
child 7914 | 301cd877dee5 |
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 |
/** |
|
7887 | 37 |
* LteEnbPhy models the physical layer for the eNodeB |
6705 | 38 |
*/ |
7887 | 39 |
class LteEnbPhy : public LtePhy |
6705 | 40 |
{ |
41 |
||
7886 | 42 |
friend class EnbMemberLteEnbPhySapProvider; |
43 |
||
6705 | 44 |
public: |
7887 | 45 |
LteEnbPhy (); |
6705 | 46 |
|
47 |
/** |
|
48 |
* \brief Create the eNB phy layer |
|
49 |
* \param d the device where the phy layer is attached |
|
50 |
*/ |
|
7887 | 51 |
LteEnbPhy (Ptr<LteNetDevice> d); |
52 |
virtual ~LteEnbPhy (); |
|
6705 | 53 |
|
54 |
static TypeId GetTypeId (void); |
|
55 |
||
7886 | 56 |
|
6705 | 57 |
/** |
7886 | 58 |
* \brief Get the PHY SAP provider |
59 |
* \return a pointer to the SAP Provider of the PHY |
|
60 |
*/ |
|
61 |
LteEnbPhySapProvider* GetLteEnbPhySapProvider (); |
|
62 |
||
63 |
/** |
|
64 |
* \brief Set the PHY SAP User |
|
65 |
* \param s a pointer to the PHY SAP user |
|
66 |
*/ |
|
67 |
void SetLteEnbPhySapUser (LteEnbPhySapUser* s); |
|
68 |
||
69 |
||
70 |
/** |
|
71 |
* \brief Queue the MAC PDU to be sent |
|
72 |
* \param p the MAC PDU to sent |
|
73 |
*/ |
|
74 |
virtual void DoSendMacPdu (Ptr<Packet> p); |
|
75 |
||
76 |
||
6705 | 77 |
void DoSetDownlinkSubChannels (); |
78 |
||
79 |
/** |
|
80 |
* \brief Create the PSD for TX |
|
81 |
*/ |
|
82 |
virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (); |
|
83 |
||
84 |
/** |
|
85 |
* \brief Calculate the channel quality for a given UE |
|
86 |
* \param sinr a list of computed SINR |
|
87 |
* \param ue the UE |
|
88 |
*/ |
|
89 |
void CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue); |
|
90 |
||
91 |
/** |
|
92 |
* \brief Send the control message |
|
93 |
* \param msg the message to send |
|
94 |
*/ |
|
7886 | 95 |
// virtual void SendIdealControlMessage (Ptr<IdealControlMessage> msg); // legacy |
6705 | 96 |
/** |
97 |
* \brief Receive the control message |
|
98 |
* \param msg the received message |
|
99 |
*/ |
|
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6705
diff
changeset
|
100 |
virtual void ReceiveIdealControlMessage (Ptr<IdealControlMessage> msg); |
7910 | 101 |
|
102 |
/** |
|
103 |
* \brief Create the UL CQI feedback from SINR values perceived at |
|
104 |
* the physical layer with the signal received from eNB |
|
105 |
* \param sinr SINR values vector |
|
106 |
*/ |
|
107 |
Ptr<UlCqiIdealControlMessage> CreateUlCqiFeedbackMessage (const SpectrumValue& sinr); |
|
6705 | 108 |
|
109 |
||
7886 | 110 |
void DoSendIdealControlMessage (Ptr<IdealControlMessage> msg); |
111 |
||
7887 | 112 |
bool AddUePhy (uint8_t rnti, Ptr<LteUePhy> phy); |
7886 | 113 |
|
114 |
bool DeleteUePhy (uint8_t rnti); |
|
115 |
||
116 |
||
6705 | 117 |
/** |
118 |
* \brief Start a LTE frame |
|
119 |
*/ |
|
120 |
void StartFrame (void); |
|
121 |
/** |
|
122 |
* \brief Start a LTE sub frame |
|
123 |
*/ |
|
124 |
void StartSubFrame (void); |
|
125 |
/** |
|
126 |
* \brief End a LTE sub frame |
|
127 |
*/ |
|
128 |
void EndSubFrame (void); |
|
129 |
/** |
|
130 |
* \brief End a LTE frame |
|
131 |
*/ |
|
132 |
void EndFrame (void); |
|
133 |
||
7886 | 134 |
/** |
135 |
* \brief PhySpectrum received a new PHY-PDU |
|
136 |
*/ |
|
137 |
void PhyPduReceived (Ptr<Packet> p); |
|
138 |
||
139 |
// inherited from LtePhy |
|
140 |
virtual void GenerateCqiFeedback (const SpectrumValue& sinr); |
|
141 |
||
6705 | 142 |
|
143 |
private: |
|
7887 | 144 |
std::map <uint8_t, Ptr<LteUePhy> > m_ueAttached; |
7886 | 145 |
|
146 |
LteEnbPhySapProvider* m_enbPhySapProvider; |
|
147 |
LteEnbPhySapUser* m_enbPhySapUser; |
|
148 |
||
149 |
uint32_t m_nrFrames; |
|
150 |
uint32_t m_nrSubFrames; |
|
6705 | 151 |
}; |
152 |
||
153 |
||
154 |
} |
|
155 |
||
7887 | 156 |
#endif /* LTE_ENB_PHY_H */ |