diff --git a/src/lte/helper/lte-helper.cc b/src/lte/helper/lte-helper.cc index 32a624896..ae9742f30 100644 --- a/src/lte/helper/lte-helper.cc +++ b/src/lte/helper/lte-helper.cc @@ -151,7 +151,7 @@ TypeId LteHelper::GetTypeId (void) "The type of handover algorithm to be used for eNBs. " "The allowed values for this attributes are the type names " "of any class inheriting from ns3::HandoverAlgorithm.", - StringValue ("ns3::BareHandoverAlgorithm"), + StringValue ("ns3::NoOpHandoverAlgorithm"), MakeStringAccessor (&LteHelper::SetHandoverAlgorithmType), MakeStringChecker ()) .AddAttribute ("PathlossModel", @@ -783,8 +783,8 @@ DrbActivator::ActivateDrb (uint64_t imsi, uint16_t cellId, uint16_t rnti) if ((!m_active) && (imsi == m_imsi)) { Ptr ueRrc = m_ueDevice->GetObject ()->GetRrc (); - NS_ASSERT (ueRrc->GetState () == LteUeRrc::CONNECTED_NORMALLY); - uint16_t rnti = ueRrc->GetRnti(); + NS_ASSERT (ueRrc->GetState () == LteUeRrc::CONNECTED_NORMALLY); + uint16_t rnti = ueRrc->GetRnti (); Ptr enbLteDevice = m_ueDevice->GetObject ()->GetTargetEnb (); Ptr enbRrc = enbLteDevice->GetObject ()->GetRrc (); NS_ASSERT (ueRrc->GetCellId () == enbLteDevice->GetCellId ()); @@ -800,14 +800,14 @@ DrbActivator::ActivateDrb (uint64_t imsi, uint16_t cellId, uint16_t rnti) m_active = true; } } - + void LteHelper::ActivateDataRadioBearer (Ptr ueDevice, EpsBearer bearer) { NS_LOG_FUNCTION (this << ueDevice); - NS_ASSERT_MSG (m_epcHelper == 0, "this method must not be used when EPC is being used"); - + NS_ASSERT_MSG (m_epcHelper == 0, "this method must not be used when EPC is being used"); + // Normally it is the EPC that takes care of activating DRBs // when the UE gets connected. When the EPC is not used, we achieve // the same behavior by hooking a dedicated DRB activation function @@ -819,7 +819,7 @@ LteHelper::ActivateDataRadioBearer (Ptr ueDevice, EpsBearer bearer) std::ostringstream path; path << "/NodeList/" << enbLteDevice->GetNode ()->GetId () << "/DeviceList/" << enbLteDevice->GetIfIndex () - << "/LteEnbRrc/ConnectionEstablished"; + << "/LteEnbRrc/ConnectionEstablished"; Ptr arg = Create (ueDevice, bearer); Config::Connect (path.str (), MakeBoundCallback (&DrbActivator::ActivateCallback, arg)); } diff --git a/src/lte/model/lte-handover-algorithm.cc b/src/lte/model/lte-handover-algorithm.cc index 776d2399c..8a4c3212f 100644 --- a/src/lte/model/lte-handover-algorithm.cc +++ b/src/lte/model/lte-handover-algorithm.cc @@ -20,7 +20,6 @@ */ #include "lte-handover-algorithm.h" -#include #include NS_LOG_COMPONENT_DEFINE ("LteHandoverAlgorithm"); @@ -56,71 +55,4 @@ LteHandoverAlgorithm::GetTypeId (void) } - -/////////////////////////////////////////// -// Bare Handover Algorithm -/////////////////////////////////////////// - -NS_OBJECT_ENSURE_REGISTERED (BareHandoverAlgorithm); - - -BareHandoverAlgorithm::BareHandoverAlgorithm () - : m_handoverManagementSapUser (0) -{ - m_handoverManagementSapProvider = new MemberLteHandoverManagementSapProvider (this); -} - - -BareHandoverAlgorithm::~BareHandoverAlgorithm () -{ -} - - -void -BareHandoverAlgorithm::DoDispose () -{ - delete m_handoverManagementSapProvider; -} - - -TypeId -BareHandoverAlgorithm::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::BareHandoverAlgorithm") - .SetParent () - .AddConstructor () - ; - return tid; -} - - -void -BareHandoverAlgorithm::SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s) -{ - m_handoverManagementSapUser = s; -} - - -LteHandoverManagementSapProvider* -BareHandoverAlgorithm::GetLteHandoverManagementSapProvider () -{ - return m_handoverManagementSapProvider; -} - - -void -BareHandoverAlgorithm::DoInitialize () -{ - LteHandoverAlgorithm::DoInitialize (); -} - - -void -BareHandoverAlgorithm::DoReportUeMeas (uint16_t rnti, - LteRrcSap::MeasResults measResults) -{ -} - - - } // end of namespace ns3 diff --git a/src/lte/model/lte-handover-algorithm.h b/src/lte/model/lte-handover-algorithm.h index 7dce08278..bfea22c48 100644 --- a/src/lte/model/lte-handover-algorithm.h +++ b/src/lte/model/lte-handover-algorithm.h @@ -24,10 +24,14 @@ #include #include -#include namespace ns3 { + +class LteHandoverManagementSapUser; +class LteHandoverManagementSapProvider; + + /** * \brief This abstract base class identifies the interface by means of which * the helper object can plug on the eNodeB RRC a handover algorithm @@ -61,44 +65,6 @@ public: }; // end of class LteHandoverAlgorithm - -/** - * \brief A sample implementation of the Handover Management SAP which simply - * does nothing. - */ -class BareHandoverAlgorithm : public LteHandoverAlgorithm -{ -public: - BareHandoverAlgorithm (); - virtual ~BareHandoverAlgorithm (); - - // inherited from Object - virtual void DoDispose (void); - static TypeId GetTypeId (void); - - // inherited from LteHandoverAlgorithm - virtual void SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s); - virtual LteHandoverManagementSapProvider* GetLteHandoverManagementSapProvider (); - - friend class MemberLteHandoverManagementSapProvider; - -protected: - // inherited from Object - virtual void DoInitialize (); - -private: - - // Handover Management SAP implementation - void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults); - - // Handover Management SAPs - LteHandoverManagementSapUser* m_handoverManagementSapUser; - LteHandoverManagementSapProvider* m_handoverManagementSapProvider; - -}; // end of class BareHandoverAlgorithm - - - } // end of namespace ns3 diff --git a/src/lte/model/no-op-handover-algorithm.cc b/src/lte/model/no-op-handover-algorithm.cc new file mode 100644 index 000000000..fff3f4ba4 --- /dev/null +++ b/src/lte/model/no-op-handover-algorithm.cc @@ -0,0 +1,90 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2013 University of Jyvaskyla + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Budiarto Herman + * + */ + +#include "no-op-handover-algorithm.h" +#include + +NS_LOG_COMPONENT_DEFINE ("NoOpHandoverAlgorithm"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (NoOpHandoverAlgorithm); + + +NoOpHandoverAlgorithm::NoOpHandoverAlgorithm () + : m_handoverManagementSapUser (0) +{ + m_handoverManagementSapProvider = new MemberLteHandoverManagementSapProvider (this); +} + + +NoOpHandoverAlgorithm::~NoOpHandoverAlgorithm () +{ +} + + +void +NoOpHandoverAlgorithm::DoDispose () +{ + delete m_handoverManagementSapProvider; +} + + +TypeId +NoOpHandoverAlgorithm::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::NoOpHandoverAlgorithm") + .SetParent () + .AddConstructor () + ; + return tid; +} + + +void +NoOpHandoverAlgorithm::SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s) +{ + m_handoverManagementSapUser = s; +} + + +LteHandoverManagementSapProvider* +NoOpHandoverAlgorithm::GetLteHandoverManagementSapProvider () +{ + return m_handoverManagementSapProvider; +} + + +void +NoOpHandoverAlgorithm::DoInitialize () +{ + LteHandoverAlgorithm::DoInitialize (); +} + + +void +NoOpHandoverAlgorithm::DoReportUeMeas (uint16_t rnti, + LteRrcSap::MeasResults measResults) +{ +} + + +} // end of namespace ns3 diff --git a/src/lte/model/no-op-handover-algorithm.h b/src/lte/model/no-op-handover-algorithm.h new file mode 100644 index 000000000..61a97ad3f --- /dev/null +++ b/src/lte/model/no-op-handover-algorithm.h @@ -0,0 +1,71 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2013 University of Jyvaskyla + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Budiarto Herman + * + */ + +#ifndef NO_OP_HANDOVER_ALGORITHM_H +#define NO_OP_HANDOVER_ALGORITHM_H + +#include +#include +#include + +namespace ns3 { + + +/** + * \brief A sample implementation of the Handover Management SAP which simply + * does nothing. + */ +class NoOpHandoverAlgorithm : public LteHandoverAlgorithm +{ +public: + NoOpHandoverAlgorithm (); + virtual ~NoOpHandoverAlgorithm (); + + // inherited from Object + virtual void DoDispose (void); + static TypeId GetTypeId (void); + + // inherited from LteHandoverAlgorithm + virtual void SetLteHandoverManagementSapUser (LteHandoverManagementSapUser* s); + virtual LteHandoverManagementSapProvider* GetLteHandoverManagementSapProvider (); + + friend class MemberLteHandoverManagementSapProvider; + +protected: + // inherited from Object + virtual void DoInitialize (); + +private: + + // Handover Management SAP implementation + void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults); + + // Handover Management SAPs + LteHandoverManagementSapUser* m_handoverManagementSapUser; + LteHandoverManagementSapProvider* m_handoverManagementSapProvider; + +}; // end of class NoOpHandoverAlgorithm + + +} // end of namespace ns3 + + +#endif /* NO_OP_HANDOVER_ALGORITHM_H */ diff --git a/src/lte/wscript b/src/lte/wscript index 53b67b58a..17ce886e4 100644 --- a/src/lte/wscript +++ b/src/lte/wscript @@ -101,6 +101,7 @@ def build(bld): 'model/lte-handover-management-sap.cc', 'model/lte-handover-algorithm.cc', 'model/a2-rsrq-handover-algorithm.cc', + 'model/no-op-handover-algorithm.cc', 'model/lte-anr-sap.cc', 'model/lte-anr.cc', ] @@ -251,6 +252,7 @@ def build(bld): 'model/lte-handover-management-sap.h', 'model/lte-handover-algorithm.h', 'model/a2-rsrq-handover-algorithm.h', + 'model/no-op-handover-algorithm.h', 'model/lte-anr-sap.h', 'model/lte-anr.h', ]