diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index 2aa05bc48..6fc7cb833 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -952,6 +952,58 @@ LteEnbPhy::DoRemoveUe (uint16_t rnti) m_paMap.erase (it); } + //additional data to be removed + m_uplinkSpectrumPhy->RemoveExpectedTb (rnti); + //remove srs info to avoid trace errors + std::map::iterator sit = m_srsSampleCounterMap.find (rnti); + if (sit != m_srsSampleCounterMap.end ()) + { + m_srsSampleCounterMap.erase (rnti); + } + //remove DL_DCI message otherwise errors occur for m_dlPhyTransmission trace + //remove also any UL_DCI message for the UE to be removed + + for (auto & ctrlMessageList : m_controlMessagesQueue) + { + std::list >::iterator ctrlMsgListIt = ctrlMessageList.begin (); + while (ctrlMsgListIt != ctrlMessageList.end ()) + { + Ptr msg = (*ctrlMsgListIt); + if (msg->GetMessageType () == LteControlMessage::DL_DCI) + { + auto dci = DynamicCast (msg); + if (dci->GetDci ().m_rnti == rnti) + { + NS_LOG_INFO ("DL_DCI to be sent from cell id : " + << m_cellId << " to RNTI : " << rnti << " is deleted"); + ctrlMsgListIt = ctrlMessageList.erase (ctrlMsgListIt); + } + else + { + ++ctrlMsgListIt; + } + } + else if (msg->GetMessageType () == LteControlMessage::UL_DCI) + { + auto dci = DynamicCast (msg); + if (dci->GetDci ().m_rnti == rnti) + { + NS_LOG_INFO ("UL_DCI to be sent from cell id : " + << m_cellId << " to RNTI : " << rnti << " is deleted"); + ctrlMsgListIt = ctrlMessageList.erase (ctrlMsgListIt); + } + else + { + ++ctrlMsgListIt; + } + } + else + { + ++ctrlMsgListIt; + } + } + } + } void