From 0702fd3d11098cbc7e3bfcce8a595e076a8077bf Mon Sep 17 00:00:00 2001 From: ZorazeAli Date: Fri, 3 May 2019 16:59:00 +0200 Subject: [PATCH] lte: Verify that the num of SF used for in/out of Sync evaluation are multiple of 10 --- src/lte/model/lte-ue-phy.cc | 38 +++++++++++++++++++++++++++++++++-- src/lte/model/lte-ue-phy.h | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index 12bbea9e8..ad2c40507 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -330,13 +330,15 @@ LteUePhy::GetTypeId (void) "This specifies the total number of consecutive subframes" "which corresponds to the Qout evaluation period", UintegerValue (200), //see 3GPP 3GPP TS 36.133 7.6.2.1 - MakeUintegerAccessor (&LteUePhy::m_numOfQoutEvalSf), + MakeUintegerAccessor (&LteUePhy::SetNumQoutEvalSf, + &LteUePhy::GetNumQoutEvalSf), MakeUintegerChecker ()) .AddAttribute ("NumQinEvalSf", "This specifies the total number of consecutive subframes" "which corresponds to the Qin evaluation period", UintegerValue (100), //see 3GPP 3GPP TS 36.133 7.6.2.1 - MakeUintegerAccessor (&LteUePhy::m_numOfQinEvalSf), + MakeUintegerAccessor (&LteUePhy::SetNumQinEvalSf, + &LteUePhy::GetNumQinEvalSf), MakeUintegerChecker ()) .AddAttribute ("EnableRlfDetection", "If true, RLF detection will be enabled.", @@ -448,6 +450,38 @@ LteUePhy::GetUlSpectrumPhy () const return m_uplinkSpectrumPhy; } +void +LteUePhy::SetNumQoutEvalSf (uint16_t numSubframes) +{ + NS_LOG_FUNCTION (this << numSubframes); + NS_ABORT_MSG_IF (numSubframes % 10 != 0, "Number of subframes used for Qout " + "evaluation must be multiple of 10"); + m_numOfQoutEvalSf = numSubframes; +} + +void +LteUePhy::SetNumQinEvalSf (uint16_t numSubframes) +{ + NS_LOG_FUNCTION (this << numSubframes); + NS_ABORT_MSG_IF (numSubframes % 10 != 0, "Number of subframes used for Qin " + "evaluation must be multiple of 10"); + m_numOfQinEvalSf = numSubframes; +} + +uint16_t +LteUePhy::GetNumQoutEvalSf (void) const +{ + NS_LOG_FUNCTION (this); + return m_numOfQoutEvalSf; +} + +uint16_t +LteUePhy::GetNumQinEvalSf (void) const +{ + NS_LOG_FUNCTION (this); + return m_numOfQinEvalSf; +} + void LteUePhy::DoSendMacPdu (Ptr p) { diff --git a/src/lte/model/lte-ue-phy.h b/src/lte/model/lte-ue-phy.h index 455b2c30e..00b233234 100644 --- a/src/lte/model/lte-ue-phy.h +++ b/src/lte/model/lte-ue-phy.h @@ -421,6 +421,46 @@ private: * \param s the destination state */ void SwitchToState (State s); + /** + * \brief Set number of Qout evaluation subframes + * + * The number passed to this method should be multiple + * of 10. This number specifies the total number of consecutive + * subframes, which corresponds to the Qout evaluation period. + * + * \param numSubframes the number of subframes + */ + void SetNumQoutEvalSf (uint16_t numSubframes); + /** + * \brief Set number of Qin evaluation subframes + * + * The number passed to this method should be multiple + * of 10. This number specifies the total number of consecutive + * subframes, which corresponds to the Qin evaluation period. + * + * \param numSubframes the number of subframes + */ + void SetNumQinEvalSf (uint16_t numSubframes); + /** + * \brief Get number of Qout evaluation subframes + * + * The number returned by this method specifies the + * total number of consecutive subframes, which corresponds + * to the Qout evaluation period. + * + * \return the number of consecutive subframes used for Qout evaluation + */ + uint16_t GetNumQoutEvalSf () const; + /** + * \brief Get number of Qin evaluation subframes + * + * The number returned by this method specifies the + * total number of consecutive subframes, which corresponds + * to the Qin evaluation period. + * + * \return the number of consecutive subframes used for Qin evaluation + */ + uint16_t GetNumQinEvalSf () const; // UE CPHY SAP methods /**