From b9842ebe43ab83943b77aa7e5293040bd7d1ff49 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Thu, 8 Jun 2017 18:30:23 +0300 Subject: [PATCH] lte: Add LteEnbRrc::CellToComponentCarrierId --- src/lte/model/lte-enb-rrc.cc | 14 ++++++++++++++ src/lte/model/lte-enb-rrc.h | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index ad8c283d9..08e29fec4 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -2099,6 +2099,20 @@ LteEnbRrc::SetCellId (uint16_t cellId, uint8_t ccIndex) m_cphySapProvider[ccIndex]->SetSystemInformationBlockType1 (m_sib1); } +uint8_t +LteEnbRrc::CellToComponentCarrierId (uint16_t cellId) +{ + NS_LOG_FUNCTION (this << cellId); + for (auto &it: m_componentCarrierPhyConf) + { + if (it.second->GetCellId () == cellId) + { + return it.first; + } + } + NS_FATAL_ERROR ("Cell " << cellId << " not found in CC map"); +} + bool LteEnbRrc::SendData (Ptr packet) { diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index a61dd896f..0aaaa2881 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -873,6 +873,15 @@ public: */ void SetCellId (uint16_t m_cellId, uint8_t ccIndex); + /** + * convert the cell id to component carrier id + * + * \param cellId Cell ID + * + * \return corresponding component carrier id + */ + uint8_t CellToComponentCarrierId (uint16_t cellId); + /** * Enqueue an IP data packet on the proper bearer for downlink * transmission. Normally expected to be called by the NetDevice