A Discrete-Event Network Simulator
API
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 (uint32_t dlEarfcn) = 0;
70 
86  virtual void SynchronizeWithEnb (uint16_t cellId) = 0;
87 
104  virtual void SynchronizeWithEnb (uint16_t cellId, uint32_t dlEarfcn) = 0;
105 
110  virtual uint16_t GetCellId () = 0;
111 
116  virtual uint32_t GetDlEarfcn () = 0;
117 
121  virtual void SetDlBandwidth (uint16_t dlBandwidth) = 0;
122 
129  virtual void ConfigureUplink (uint32_t ulEarfcn, uint16_t ulBandwidth) = 0;
130 
136  virtual void ConfigureReferenceSignalPower (int8_t referenceSignalPower) = 0;
137 
143  virtual void SetRnti (uint16_t rnti) = 0;
144 
150  virtual void SetTransmissionMode (uint8_t txMode) = 0;
151 
157  virtual void SetSrsConfigurationIndex (uint16_t srcCi) = 0;
158 
164  virtual void SetPa (double pa) = 0;
165 
175  virtual void SetRsrpFilterCoefficient (uint8_t rsrpFilterCoefficient) = 0;
176 
183  virtual void ResetPhyAfterRlf () = 0;
184 
193  virtual void ResetRlfParams () = 0;
194 
203  virtual void StartInSnycDetection () = 0;
204 
209  virtual void SetImsi (uint64_t imsi) = 0;
210 
211 };
212 
213 
221 {
222 public:
223 
227  virtual ~LteUeCphySapUser ();
228 
229 
235  {
236  uint16_t m_cellId;
237  double m_rsrp;
238  double m_rsrq;
239  };
240 
243  {
244  std::vector <struct UeMeasurementsElement> m_ueMeasurementsList;
246  };
247 
248 
258  virtual void RecvMasterInformationBlock (uint16_t cellId,
260 
270  virtual void RecvSystemInformationBlockType1 (uint16_t cellId,
272 
280 
287  virtual void NotifyOutOfSync () = 0;
288 
295  virtual void NotifyInSync () = 0;
296 
303  virtual void ResetSyncIndicationCounter () = 0;
304 
305 };
306 
307 
308 
309 
315 template <class C>
317 {
318 public:
324  MemberLteUeCphySapProvider (C* owner);
325 
326  // inherited from LteUeCphySapProvider
327  virtual void Reset ();
328  virtual void StartCellSearch (uint32_t dlEarfcn);
329  virtual void SynchronizeWithEnb (uint16_t cellId);
330  virtual void SynchronizeWithEnb (uint16_t cellId, uint32_t dlEarfcn);
331  virtual uint16_t GetCellId ();
332  virtual uint32_t GetDlEarfcn ();
333  virtual void SetDlBandwidth (uint16_t dlBandwidth);
334  virtual void ConfigureUplink (uint32_t ulEarfcn, uint16_t ulBandwidth);
335  virtual void ConfigureReferenceSignalPower (int8_t referenceSignalPower);
336  virtual void SetRnti (uint16_t rnti);
337  virtual void SetTransmissionMode (uint8_t txMode);
338  virtual void SetSrsConfigurationIndex (uint16_t srcCi);
339  virtual void SetPa (double pa);
340  virtual void SetRsrpFilterCoefficient (uint8_t rsrpFilterCoefficient);
341  virtual void ResetPhyAfterRlf ();
342  virtual void ResetRlfParams ();
343  virtual void StartInSnycDetection ();
344  virtual void SetImsi (uint64_t imsi);
345 
346 private:
348  C* m_owner;
349 };
350 
351 template <class C>
353  : m_owner (owner)
354 {
355 }
356 
357 template <class C>
359 {
360 }
361 
362 template <class C>
363 void
365 {
366  m_owner->DoReset ();
367 }
368 
369 template <class C>
370 void
372 {
373  m_owner->DoStartCellSearch (dlEarfcn);
374 }
375 
376 template <class C>
377 void
379 {
380  m_owner->DoSynchronizeWithEnb (cellId);
381 }
382 
383 template <class C>
384 void
385 MemberLteUeCphySapProvider<C>::SynchronizeWithEnb (uint16_t cellId, uint32_t dlEarfcn)
386 {
387  m_owner->DoSynchronizeWithEnb (cellId, dlEarfcn);
388 }
389 
390 template <class C>
391 uint16_t
393 {
394  return m_owner->DoGetCellId ();
395 }
396 
397 template <class C>
398 uint32_t
400 {
401  return m_owner->DoGetDlEarfcn ();
402 }
403 
404 template <class C>
405 void
407 {
408  m_owner->DoSetDlBandwidth (dlBandwidth);
409 }
410 
411 template <class C>
412 void
413 MemberLteUeCphySapProvider<C>::ConfigureUplink (uint32_t ulEarfcn, uint16_t ulBandwidth)
414 {
415  m_owner->DoConfigureUplink (ulEarfcn, ulBandwidth);
416 }
417 
418 template <class C>
419 void
421 {
422  m_owner->DoConfigureReferenceSignalPower (referenceSignalPower);
423 }
424 
425 template <class C>
426 void
428 {
429  m_owner->DoSetRnti (rnti);
430 }
431 
432 template <class C>
433 void
435 {
436  m_owner->DoSetTransmissionMode (txMode);
437 }
438 
439 template <class C>
440 void
442 {
443  m_owner->DoSetSrsConfigurationIndex (srcCi);
444 }
445 
446 template <class C>
447 void
449 {
450  m_owner->DoSetPa (pa);
451 }
452 
453 template <class C>
454 void
456 {
457  m_owner->DoSetRsrpFilterCoefficient (rsrpFilterCoefficient);
458 }
459 
460 template <class C>
461 void
463 {
464  m_owner->DoResetPhyAfterRlf ();
465 }
466 
467 template <class C>
469 {
470  m_owner->DoResetRlfParams ();
471 }
472 
473 template <class C>
475 {
476  m_owner->DoStartInSnycDetection ();
477 }
478 
479 template <class C>
481 {
482  m_owner->DoSetImsi (imsi);
483 }
484 
485 
486 
492 template <class C>
494 {
495 public:
501  MemberLteUeCphySapUser (C* owner);
502 
503  // methods inherited from LteUeCphySapUser go here
504  virtual void RecvMasterInformationBlock (uint16_t cellId,
506  virtual void RecvSystemInformationBlockType1 (uint16_t cellId,
509  virtual void NotifyOutOfSync ();
510  virtual void NotifyInSync ();
511  virtual void ResetSyncIndicationCounter ();
512 
513 private:
515  C* m_owner;
516 };
517 
518 template <class C>
520  : m_owner (owner)
521 {
522 }
523 
524 template <class C>
526 {
527 }
528 
529 template <class C>
530 void
533 {
534  m_owner->DoRecvMasterInformationBlock (cellId, mib);
535 }
536 
537 template <class C>
538 void
541 {
542  m_owner->DoRecvSystemInformationBlockType1 (cellId, sib1);
543 }
544 
545 template <class C>
546 void
548 {
549  m_owner->DoReportUeMeasurements (params);
550 }
551 
552 template <class C>
553 void
555 {
556  m_owner->DoNotifyOutOfSync ();
557 }
558 
559 template <class C>
560 void
562 {
563  m_owner->DoNotifyInSync ();
564 }
565 
566 template <class C>
567 void
569 {
570  m_owner->DoResetSyncIndicationCounter ();
571 }
572 
573 
574 } // namespace ns3
575 
576 
577 #endif // LTE_UE_CPHY_SAP_H
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn)=0
Tell the PHY entity to align to the given EARFCN and synchronize with a given eNodeB for communicatio...
virtual uint16_t GetCellId()=0
Get PHY cell ID.
virtual void ResetPhyAfterRlf()=0
Reset the PHY after radio link failure function It resets the physical layer parameters of the UE aft...
virtual void SetRnti(uint16_t rnti)=0
Set Rnti function.
virtual void ConfigureReferenceSignalPower(int8_t referenceSignalPower)=0
Configure referenceSignalPower.
virtual void StartCellSearch(uint32_t dlEarfcn)=0
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP.
virtual void SetTransmissionMode(uint8_t txMode)=0
Set transmission mode.
virtual ~LteUeCphySapProvider()
destructor
virtual void SetSrsConfigurationIndex(uint16_t srcCi)=0
Set SRS configuration index.
virtual void SetPa(double pa)=0
Set P_A value for UE power control.
virtual void ResetRlfParams()=0
Reset radio link failure parameters.
virtual void Reset()=0
reset the PHY
virtual void SetImsi(uint64_t imsi)=0
A method call by UE RRC to communicate the IMSI to the UE PHY.
virtual void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)=0
Set RSRP filter coefficient.
virtual void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)=0
Configure uplink (normally done after reception of SIB2)
virtual uint32_t GetDlEarfcn()=0
Get PHY DL EARFCN.
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 SetDlBandwidth(uint16_t dlBandwidth)=0
virtual void StartInSnycDetection()=0
Start in-sync detection function When T310 timer is started, it indicates that physical layer problem...
Service Access Point (SAP) offered by the UE PHY to the UE RRC for control purposes.
virtual void NotifyInSync()=0
Send an in sync indication to UE RRC.
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...
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)=0
Relay an MIB message from the PHY entity to the RRC layer.
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)=0
Relay an SIB1 message from the PHY entity to the RRC layer.
virtual void NotifyOutOfSync()=0
Send an out of sync indication to UE RRC.
virtual void ResetSyncIndicationCounter()=0
Reset the sync indication counter.
virtual ~LteUeCphySapUser()
destructor
Template for the implementation of the LteUeCphySapProvider as a member of an owner class of type C t...
virtual void SetPa(double pa)
Set P_A value for UE power control.
virtual void SetSrsConfigurationIndex(uint16_t srcCi)
Set SRS configuration index.
virtual void StartCellSearch(uint32_t dlEarfcn)
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP.
virtual void SetRnti(uint16_t rnti)
Set Rnti function.
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 ResetRlfParams()
Reset radio link failure parameters.
virtual void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient)
Set RSRP filter coefficient.
virtual void ResetPhyAfterRlf()
Reset the PHY after radio link failure function It resets the physical layer parameters of the UE aft...
virtual uint16_t GetCellId()
Get PHY cell ID.
virtual void SetDlBandwidth(uint16_t dlBandwidth)
virtual void StartInSnycDetection()
Start in-sync detection function When T310 timer is started, it indicates that physical layer problem...
virtual void SetTransmissionMode(uint8_t txMode)
Set transmission mode.
virtual void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
Configure uplink (normally done after reception of SIB2)
virtual void ConfigureReferenceSignalPower(int8_t referenceSignalPower)
Configure referenceSignalPower.
virtual uint32_t GetDlEarfcn()
Get PHY DL EARFCN.
virtual void Reset()
reset the PHY
virtual void SetImsi(uint64_t imsi)
A method call by UE RRC to communicate the IMSI to the UE PHY.
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
C * m_owner
the owner class
virtual void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib)
Relay an MIB message from the PHY entity to the RRC layer.
virtual void NotifyInSync()
Send an in sync indication to UE RRC.
virtual void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1)
Relay an SIB1 message from the PHY entity to the RRC layer.
virtual void ResetSyncIndicationCounter()
Reset the sync indication counter.
virtual void NotifyOutOfSync()
Send an out of sync indication to UE RRC.
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...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:588
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:595
Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB] See section 5....
UeMeasurementsParameters structure.
uint8_t m_componentCarrierId
component carrier ID
std::vector< struct UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.