A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-ue-cphy-sap.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Nicola Baldo <nbaldo@cttc.es>,
19  * Marco Miozzo <mmiozzo@cttc.es>
20  */
21 
22 #ifndef LTE_UE_CPHY_SAP_H
23 #define LTE_UE_CPHY_SAP_H
24 
25 #include <stdint.h>
26 #include <ns3/ptr.h>
27 
28 #include <ns3/lte-rrc-sap.h>
29 
30 namespace ns3 {
31 
32 
33 class LteEnbNetDevice;
34 
42 {
43 public:
44 
48  virtual ~LteUeCphySapProvider ();
49 
54  virtual void Reset () = 0;
55 
69  virtual void StartCellSearch (uint16_t dlEarfcn) = 0;
70 
86  virtual void SynchronizeWithEnb (uint16_t cellId) = 0;
87 
104  virtual void SynchronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn) = 0;
105 
109  virtual void SetDlBandwidth (uint8_t dlBandwidth) = 0;
110 
117  virtual void ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth) = 0;
118 
123  virtual void SetRnti (uint16_t rnti) = 0;
124 
128  virtual void SetTransmissionMode (uint8_t txMode) = 0;
129 
133  virtual void SetSrsConfigurationIndex (uint16_t srcCi) = 0;
134 
135 };
136 
137 
145 {
146 public:
147 
151  virtual ~LteUeCphySapUser ();
152 
153 
159  {
160  uint16_t m_cellId;
161  double m_rsrp; // [dBm]
162  double m_rsrq; // [dB]
163  };
164 
166  {
167  std::vector <struct UeMeasurementsElement> m_ueMeasurementsList;
168  };
169 
170 
179  virtual void RecvMasterInformationBlock (uint16_t cellId,
181 
190  virtual void RecvSystemInformationBlockType1 (uint16_t cellId,
192 
198  virtual void ReportUeMeasurements (UeMeasurementsParameters params) = 0;
199 
200 };
201 
202 
203 
204 
210 template <class C>
212 {
213 public:
214  MemberLteUeCphySapProvider (C* owner);
215 
216  // inherited from LteUeCphySapProvider
217  virtual void Reset ();
218  virtual void StartCellSearch (uint16_t dlEarfcn);
219  virtual void SynchronizeWithEnb (uint16_t cellId);
220  virtual void SynchronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn);
221  virtual void SetDlBandwidth (uint8_t dlBandwidth);
222  virtual void ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth);
223  virtual void SetRnti (uint16_t rnti);
224  virtual void SetTransmissionMode (uint8_t txMode);
225  virtual void SetSrsConfigurationIndex (uint16_t srcCi);
226 
227 private:
230 };
231 
232 template <class C>
234  : m_owner (owner)
235 {
236 }
237 
238 template <class C>
240 {
241 }
242 
243 template <class C>
244 void
246 {
247  m_owner->DoReset ();
248 }
249 
250 template <class C>
251 void
253 {
254  m_owner->DoStartCellSearch (dlEarfcn);
255 }
256 
257 template <class C>
258 void
260 {
261  m_owner->DoSynchronizeWithEnb (cellId);
262 }
263 
264 template <class C>
265 void
266 MemberLteUeCphySapProvider<C>::SynchronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
267 {
268  m_owner->DoSynchronizeWithEnb (cellId, dlEarfcn);
269 }
270 
271 template <class C>
272 void
274 {
275  m_owner->DoSetDlBandwidth (dlBandwidth);
276 }
277 
278 template <class C>
279 void
280 MemberLteUeCphySapProvider<C>::ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth)
281 {
282  m_owner->DoConfigureUplink (ulEarfcn, ulBandwidth);
283 }
284 
285 template <class C>
286 void
288 {
289  m_owner->DoSetRnti (rnti);
290 }
291 
292 template <class C>
293 void
295 {
296  m_owner->DoSetTransmissionMode (txMode);
297 }
298 
299 template <class C>
300 void
302 {
303  m_owner->DoSetSrsConfigurationIndex (srcCi);
304 }
305 
306 
307 
313 template <class C>
315 {
316 public:
317  MemberLteUeCphySapUser (C* owner);
318 
319  // methods inherited from LteUeCphySapUser go here
320  virtual void RecvMasterInformationBlock (uint16_t cellId,
322  virtual void RecvSystemInformationBlockType1 (uint16_t cellId,
325 
326 private:
329 };
330 
331 template <class C>
333  : m_owner (owner)
334 {
335 }
336 
337 template <class C>
339 {
340 }
341 
342 template <class C>
343 void
346 {
347  m_owner->DoRecvMasterInformationBlock (cellId, mib);
348 }
349 
350 template <class C>
351 void
354 {
355  m_owner->DoRecvSystemInformationBlockType1 (cellId, sib1);
356 }
357 
358 template <class C>
359 void
361 {
362  m_owner->DoReportUeMeasurements (params);
363 }
364 
365 
366 } // namespace ns3
367 
368 
369 #endif // LTE_UE_CPHY_SAP_H
virtual void Reset()=0
reset the PHY
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
virtual void ConfigureUplink(uint16_t ulEarfcn, uint8_t ulBandwidth)
Configure uplink (normally done after reception of SIB2)
virtual void Reset()
reset the PHY
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
virtual ~LteUeCphySapProvider()
destructor
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)
Relay an MIB message from the PHY entity to the RRC layer.
virtual void SetTransmissionMode(uint8_t txMode)
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void SynchronizeWithEnb(uint16_t cellId)=0
Tell the PHY entity to synchronize with a given eNodeB over the currently active EARFCN for communica...
virtual void SetRnti(uint16_t rnti)=0
virtual void ReportUeMeasurements(LteUeCphySapUser::UeMeasurementsParameters params)
Send a report of RSRP and RSRQ values perceived from PSS by the PHY entity (after applying layer-1 fi...
Template for the implementation of the LteUeCphySapProvider as a member of an owner class of type C t...
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)=0
Relay an SIB1 message from the PHY entity to the RRC layer.
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)=0
Relay an MIB message from the PHY entity to the RRC layer.
virtual void SetDlBandwidth(uint8_t dlBandwidth)
virtual void SetSrsConfigurationIndex(uint16_t srcCi)=0
virtual void StartCellSearch(uint16_t dlEarfcn)=0
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP. ...
virtual ~LteUeCphySapUser()
destructor
virtual void StartCellSearch(uint16_t dlEarfcn)
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP. ...
virtual void SetDlBandwidth(uint8_t dlBandwidth)=0
virtual void SetTransmissionMode(uint8_t txMode)=0
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)
Relay an SIB1 message from the PHY entity to the RRC layer.
virtual void SynchronizeWithEnb(uint16_t cellId)
Tell the PHY entity to synchronize with a given eNodeB over the currently active EARFCN for communica...
virtual void SetRnti(uint16_t rnti)
Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB] See section 5...
virtual void SetSrsConfigurationIndex(uint16_t srcCi)
virtual void ConfigureUplink(uint16_t ulEarfcn, uint8_t ulBandwidth)=0
Configure uplink (normally done after reception of SIB2)
virtual void ReportUeMeasurements(UeMeasurementsParameters params)=0
Send a report of RSRP and RSRQ values perceived from PSS by the PHY entity (after applying layer-1 fi...