diff --git a/src/lte/model/lte-enb-net-device.cc b/src/lte/model/lte-enb-net-device.cc index c5d248ca4..8b4c5d284 100644 --- a/src/lte/model/lte-enb-net-device.cc +++ b/src/lte/model/lte-enb-net-device.cc @@ -390,7 +390,8 @@ LteEnbNetDevice::UpdateConfig (void) { NS_LOG_LOGIC (this << " Configure cell " << m_cellId); // we have to make sure that this function is called only once - m_rrc->ConfigureCell (m_cellId); + NS_ASSERT (!m_ccMap.empty ()); + m_rrc->ConfigureCell (m_ccMap); m_isConfigured = true; } diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index cb60d1013..c2377e633 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -2002,25 +2002,27 @@ LteEnbRrc::AddUeMeasReportConfig (LteRrcSap::ReportConfigEutra config) } void -LteEnbRrc::ConfigureCell (uint16_t cellId) +LteEnbRrc::ConfigureCell (std::map> ccPhyConf) { - auto it = m_componentCarrierPhyConf.begin (); + auto it = ccPhyConf.begin (); + NS_ASSERT (it != ccPhyConf.end ()); uint8_t ulBandwidth = it->second->GetUlBandwidth (); uint8_t dlBandwidth = it->second->GetDlBandwidth (); uint32_t ulEarfcn = it->second->GetUlEarfcn (); uint32_t dlEarfcn = it->second->GetDlEarfcn (); + uint16_t cellId = it->second->GetCellId (); NS_LOG_FUNCTION (this << (uint16_t) ulBandwidth << (uint16_t) dlBandwidth - << ulEarfcn << dlEarfcn << cellId); + << ulEarfcn << dlEarfcn); NS_ASSERT (!m_configured); - for (it = m_componentCarrierPhyConf.begin (); it != m_componentCarrierPhyConf.end (); ++it) + for (const auto &it: ccPhyConf) { - m_cphySapProvider[it->first]->SetBandwidth (it->second->GetUlBandwidth (), it->second->GetDlBandwidth ()); - m_cphySapProvider[it->first]->SetEarfcn (it->second->GetUlEarfcn (), it->second->GetDlEarfcn ()); - m_cphySapProvider[it->first]->SetCellId (cellId); - m_cmacSapProvider[it->first]->ConfigureMac (it->second->GetUlBandwidth (), it->second->GetDlBandwidth ()); - m_ffrRrcSapProvider[it->first]->SetCellId (cellId); - m_ffrRrcSapProvider[it->first]->SetBandwidth (it->second->GetUlBandwidth (), it->second->GetDlBandwidth ()); + m_cphySapProvider.at (it.first)->SetBandwidth (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ()); + m_cphySapProvider.at (it.first)->SetEarfcn (it.second->GetUlEarfcn (), it.second->GetDlEarfcn ()); + m_cphySapProvider.at (it.first)->SetCellId (it.second->GetCellId ()); + m_cmacSapProvider.at (it.first)->ConfigureMac (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ()); + m_ffrRrcSapProvider.at (it.first)->SetCellId (it.second->GetCellId ()); + m_ffrRrcSapProvider.at (it.first)->SetBandwidth (it.second->GetUlBandwidth (), it.second->GetDlBandwidth ()); } m_dlEarfcn = dlEarfcn; @@ -2064,10 +2066,10 @@ LteEnbRrc::ConfigureCell (uint16_t cellId) m_sib1.cellSelectionInfo.qQualMin = -34; // not used, set as minimum value m_sib1.cellSelectionInfo.qRxLevMin = m_qRxLevMin; // set as minimum value - for (it = m_componentCarrierPhyConf.begin (); it != m_componentCarrierPhyConf.end (); ++it) + for (const auto &it: ccPhyConf) { - m_cphySapProvider.at (it->first)->SetMasterInformationBlock (mib); - m_cphySapProvider.at (it->first)->SetSystemInformationBlockType1 (m_sib1); + m_cphySapProvider.at (it.first)->SetMasterInformationBlock (mib); + m_cphySapProvider.at (it.first)->SetSystemInformationBlockType1 (m_sib1); } /* * Enabling transmission of other SIB. The first time System Information is diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index f4893ebd4..49a6113dd 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -843,8 +843,10 @@ public: * `LteHelper::InstallEnbDevice` (i.e. before the simulation starts). * * \warning Raises an error when executed more than once. + * + * \param ccPhyConf the component carrier configuration */ - void ConfigureCell (uint16_t cellId); + void ConfigureCell (std::map> ccPhyConf); /** * \brief Configure carriers.