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