A Discrete-Event Network Simulator
API
lte-ue-cphy-sap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Nicola Baldo <nbaldo@cttc.es>,
18  * Marco Miozzo <mmiozzo@cttc.es>
19  */
20 
21 #ifndef LTE_UE_CPHY_SAP_H
22 #define LTE_UE_CPHY_SAP_H
23 
24 #include "lte-rrc-sap.h"
25 
26 #include <ns3/ptr.h>
27 
28 #include <stdint.h>
29 
30 namespace ns3
31 {
32 
33 class LteEnbNetDevice;
34 
42 {
43  public:
47  virtual ~LteUeCphySapProvider();
48 
52  virtual void Reset() = 0;
53 
67  virtual void StartCellSearch(uint32_t dlEarfcn) = 0;
68 
84  virtual void SynchronizeWithEnb(uint16_t cellId) = 0;
85 
102  virtual void SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn) = 0;
103 
108  virtual uint16_t GetCellId() = 0;
109 
114  virtual uint32_t GetDlEarfcn() = 0;
115 
119  virtual void SetDlBandwidth(uint16_t dlBandwidth) = 0;
120 
127  virtual void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth) = 0;
128 
134  virtual void ConfigureReferenceSignalPower(int8_t referenceSignalPower) = 0;
135 
141  virtual void SetRnti(uint16_t rnti) = 0;
142 
148  virtual void SetTransmissionMode(uint8_t txMode) = 0;
149 
155  virtual void SetSrsConfigurationIndex(uint16_t srcCi) = 0;
156 
162  virtual void SetPa(double pa) = 0;
163 
173  virtual void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) = 0;
174 
180  virtual void ResetPhyAfterRlf() = 0;
181 
189  virtual void ResetRlfParams() = 0;
190 
198  virtual void StartInSyncDetection() = 0;
199 
204  virtual void SetImsi(uint64_t imsi) = 0;
205 };
206 
214 {
215  public:
219  virtual ~LteUeCphySapUser();
220 
226  {
227  uint16_t m_cellId;
228  double m_rsrp;
229  double m_rsrq;
230  };
231 
234  {
235  std::vector<UeMeasurementsElement> m_ueMeasurementsList;
237  };
238 
248  virtual void RecvMasterInformationBlock(uint16_t cellId,
250 
260  virtual void RecvSystemInformationBlockType1(uint16_t cellId,
262 
270 
277  virtual void NotifyOutOfSync() = 0;
278 
285  virtual void NotifyInSync() = 0;
286 
293  virtual void ResetSyncIndicationCounter() = 0;
294 };
295 
300 template <class C>
302 {
303  public:
309  MemberLteUeCphySapProvider(C* owner);
310 
311  // Delete default constructor to avoid misuse
313 
314  // inherited from LteUeCphySapProvider
315  void Reset() override;
316  void StartCellSearch(uint32_t dlEarfcn) override;
317  void SynchronizeWithEnb(uint16_t cellId) override;
318  void SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn) override;
319  uint16_t GetCellId() override;
320  uint32_t GetDlEarfcn() override;
321  void SetDlBandwidth(uint16_t dlBandwidth) override;
322  void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth) override;
323  void ConfigureReferenceSignalPower(int8_t referenceSignalPower) override;
324  void SetRnti(uint16_t rnti) override;
325  void SetTransmissionMode(uint8_t txMode) override;
326  void SetSrsConfigurationIndex(uint16_t srcCi) override;
327  void SetPa(double pa) override;
328  void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) override;
329  void ResetPhyAfterRlf() override;
330  void ResetRlfParams() override;
331  void StartInSyncDetection() override;
332  void SetImsi(uint64_t imsi) override;
333 
334  private:
335  C* m_owner;
336 };
337 
338 template <class C>
340  : m_owner(owner)
341 {
342 }
343 
344 template <class C>
345 void
347 {
348  m_owner->DoReset();
349 }
350 
351 template <class C>
352 void
354 {
355  m_owner->DoStartCellSearch(dlEarfcn);
356 }
357 
358 template <class C>
359 void
361 {
362  m_owner->DoSynchronizeWithEnb(cellId);
363 }
364 
365 template <class C>
366 void
367 MemberLteUeCphySapProvider<C>::SynchronizeWithEnb(uint16_t cellId, uint32_t dlEarfcn)
368 {
369  m_owner->DoSynchronizeWithEnb(cellId, dlEarfcn);
370 }
371 
372 template <class C>
373 uint16_t
375 {
376  return m_owner->DoGetCellId();
377 }
378 
379 template <class C>
380 uint32_t
382 {
383  return m_owner->DoGetDlEarfcn();
384 }
385 
386 template <class C>
387 void
389 {
390  m_owner->DoSetDlBandwidth(dlBandwidth);
391 }
392 
393 template <class C>
394 void
395 MemberLteUeCphySapProvider<C>::ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth)
396 {
397  m_owner->DoConfigureUplink(ulEarfcn, ulBandwidth);
398 }
399 
400 template <class C>
401 void
403 {
404  m_owner->DoConfigureReferenceSignalPower(referenceSignalPower);
405 }
406 
407 template <class C>
408 void
410 {
411  m_owner->DoSetRnti(rnti);
412 }
413 
414 template <class C>
415 void
417 {
418  m_owner->DoSetTransmissionMode(txMode);
419 }
420 
421 template <class C>
422 void
424 {
425  m_owner->DoSetSrsConfigurationIndex(srcCi);
426 }
427 
428 template <class C>
429 void
431 {
432  m_owner->DoSetPa(pa);
433 }
434 
435 template <class C>
436 void
438 {
439  m_owner->DoSetRsrpFilterCoefficient(rsrpFilterCoefficient);
440 }
441 
442 template <class C>
443 void
445 {
446  m_owner->DoResetPhyAfterRlf();
447 }
448 
449 template <class C>
450 void
452 {
453  m_owner->DoResetRlfParams();
454 }
455 
456 template <class C>
457 void
459 {
460  m_owner->DoStartInSyncDetection();
461 }
462 
463 template <class C>
464 void
466 {
467  m_owner->DoSetImsi(imsi);
468 }
469 
474 template <class C>
476 {
477  public:
483  MemberLteUeCphySapUser(C* owner);
484 
485  // Delete default constructor to avoid misuse
487 
488  // methods inherited from LteUeCphySapUser go here
489  void RecvMasterInformationBlock(uint16_t cellId,
490  LteRrcSap::MasterInformationBlock mib) override;
491  void RecvSystemInformationBlockType1(uint16_t cellId,
494  void NotifyOutOfSync() override;
495  void NotifyInSync() override;
496  void ResetSyncIndicationCounter() override;
497 
498  private:
499  C* m_owner;
500 };
501 
502 template <class C>
504  : m_owner(owner)
505 {
506 }
507 
508 template <class C>
509 void
512 {
513  m_owner->DoRecvMasterInformationBlock(cellId, mib);
514 }
515 
516 template <class C>
517 void
519  uint16_t cellId,
521 {
522  m_owner->DoRecvSystemInformationBlockType1(cellId, sib1);
523 }
524 
525 template <class C>
526 void
528 {
529  m_owner->DoReportUeMeasurements(params);
530 }
531 
532 template <class C>
533 void
535 {
536  m_owner->DoNotifyOutOfSync();
537 }
538 
539 template <class C>
540 void
542 {
543  m_owner->DoNotifyInSync();
544 }
545 
546 template <class C>
547 void
549 {
550  m_owner->DoResetSyncIndicationCounter();
551 }
552 
553 } // namespace ns3
554 
555 #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 StartInSyncDetection()=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...
void SetDlBandwidth(uint16_t dlBandwidth) override
void ConfigureReferenceSignalPower(int8_t referenceSignalPower) override
Configure referenceSignalPower.
void Reset() override
Reset the PHY.
uint16_t GetCellId() override
Get PHY cell ID.
void SetSrsConfigurationIndex(uint16_t srcCi) override
Set SRS configuration index.
void SetRnti(uint16_t rnti) override
Set Rnti function.
void ResetPhyAfterRlf() override
Reset the PHY after radio link failure function It resets the physical layer parameters of the UE aft...
void SetImsi(uint64_t imsi) override
A method call by UE RRC to communicate the IMSI to the UE PHY.
void ResetRlfParams() override
Reset radio link failure parameters.
void SetPa(double pa) override
Set P_A value for UE power control.
uint32_t GetDlEarfcn() override
Get PHY DL EARFCN.
void ConfigureUplink(uint32_t ulEarfcn, uint16_t ulBandwidth) override
Configure uplink (normally done after reception of SIB2)
void SetTransmissionMode(uint8_t txMode) override
Set transmission mode.
void StartCellSearch(uint32_t dlEarfcn) override
Tell the PHY entity to listen to PSS from surrounding cells and measure the RSRP.
void StartInSyncDetection() override
Start in-sync detection function When T310 timer is started, it indicates that physical layer problem...
void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) override
Set RSRP filter coefficient.
void SynchronizeWithEnb(uint16_t cellId) override
Tell the PHY entity to synchronize with a given eNodeB over the currently active EARFCN for communica...
Template for the implementation of the LteUeCphySapUser as a member of an owner class of type C to wh...
void NotifyOutOfSync() override
Send an out of sync indication to UE RRC.
void ResetSyncIndicationCounter() override
Reset the sync indication counter.
C * m_owner
the owner class
void ReportUeMeasurements(LteUeCphySapUser::UeMeasurementsParameters params) override
Send a report of RSRP and RSRQ values perceived from PSS by the PHY entity (after applying layer-1 fi...
void NotifyInSync() override
Send an in sync indication to UE RRC.
void RecvSystemInformationBlockType1(uint16_t cellId, LteRrcSap::SystemInformationBlockType1 sib1) override
Relay an SIB1 message from the PHY entity to the RRC layer.
void RecvMasterInformationBlock(uint16_t cellId, LteRrcSap::MasterInformationBlock mib) override
Relay an MIB message from the PHY entity to the RRC layer.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
MasterInformationBlock structure.
Definition: lte-rrc-sap.h:622
SystemInformationBlockType1 structure.
Definition: lte-rrc-sap.h:629
Parameters of the ReportUeMeasurements primitive: RSRP [dBm] and RSRQ [dB] See section 5....
UeMeasurementsParameters structure.
uint8_t m_componentCarrierId
component carrier ID
std::vector< UeMeasurementsElement > m_ueMeasurementsList
UE measurement list.