reset LteUePhy upon handover
This commit is contained in:
@@ -47,6 +47,12 @@ public:
|
||||
*/
|
||||
virtual ~LteUeCphySapProvider ();
|
||||
|
||||
/**
|
||||
* reset the PHY
|
||||
*
|
||||
*/
|
||||
virtual void Reset () = 0;
|
||||
|
||||
/**
|
||||
* tell the PHY to synchronize with a given eNB for communication purposes
|
||||
*
|
||||
@@ -125,6 +131,7 @@ public:
|
||||
MemberLteUeCphySapProvider (C* owner);
|
||||
|
||||
// inherited from LteUeCphySapProvider
|
||||
virtual void Reset ();
|
||||
virtual void SyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn);
|
||||
virtual void SetDlBandwidth (uint8_t ulBandwidth);
|
||||
virtual void ConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth);
|
||||
@@ -148,6 +155,13 @@ MemberLteUeCphySapProvider<C>::MemberLteUeCphySapProvider ()
|
||||
{
|
||||
}
|
||||
|
||||
template <class C>
|
||||
void
|
||||
MemberLteUeCphySapProvider<C>::Reset ()
|
||||
{
|
||||
m_owner->DoReset ();
|
||||
}
|
||||
|
||||
template <class C>
|
||||
void
|
||||
MemberLteUeCphySapProvider<C>::SyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
|
||||
|
||||
@@ -117,42 +117,21 @@ LteUePhy::LteUePhy ()
|
||||
|
||||
LteUePhy::LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy)
|
||||
: LtePhy (dlPhy, ulPhy),
|
||||
m_p10CqiPeriocity (MilliSeconds (1)),
|
||||
// ideal behavior
|
||||
m_p10CqiLast (MilliSeconds (0)),
|
||||
m_a30CqiPeriocity (MilliSeconds (1)),
|
||||
// ideal behavior
|
||||
m_a30CqiLast (MilliSeconds (0)),
|
||||
m_p10CqiPeriocity (MilliSeconds (1)), // ideal behavior
|
||||
m_a30CqiPeriocity (MilliSeconds (1)), // ideal behavior
|
||||
m_uePhySapUser (0),
|
||||
m_ueCphySapUser (0),
|
||||
m_rnti (0),
|
||||
m_transmissionMode (0),
|
||||
m_srsPeriodicity (0),
|
||||
m_srsConfigured (false),
|
||||
m_dlConfigured (false),
|
||||
m_ulConfigured (false),
|
||||
m_addedToDlChannel (false),
|
||||
m_raPreambleId (255), // value out of range
|
||||
m_raRnti (11), // value out of range
|
||||
m_rsrpRsrqSampleCounter (0)
|
||||
m_ueCphySapUser (0)
|
||||
{
|
||||
m_amc = CreateObject <LteAmc> ();
|
||||
m_uePhySapProvider = new UeMemberLteUePhySapProvider (this);
|
||||
m_ueCphySapProvider = new MemberLteUeCphySapProvider<LteUePhy> (this);
|
||||
m_macChTtiDelay = UL_PUSCH_TTIS_DELAY;
|
||||
for (int i = 0; i < m_macChTtiDelay; i++)
|
||||
{
|
||||
Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
|
||||
m_packetBurstQueue.push_back (pb);
|
||||
std::list<Ptr<LteControlMessage> > l;
|
||||
m_controlMessagesQueue.push_back (l);
|
||||
}
|
||||
std::vector <int> ulRb;
|
||||
m_subChannelsForTransmissionQueue.resize (m_macChTtiDelay, ulRb);
|
||||
|
||||
|
||||
NS_ASSERT_MSG (Simulator::Now ().GetNanoSeconds () == 0,
|
||||
"Cannot create UE devices after simulation started");
|
||||
Simulator::ScheduleNow (&LteUePhy::SubframeIndication, this, 1, 1);
|
||||
|
||||
DoReset ();
|
||||
}
|
||||
|
||||
|
||||
@@ -709,9 +688,9 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
if ((((frameNo-1)*10 + (subframeNo-1)) % m_srsPeriodicity) == m_srsSubframeOffset)
|
||||
{
|
||||
NS_LOG_INFO ("frame " << frameNo << " subframe " << subframeNo << " sending SRS (offset=" << m_srsSubframeOffset << ", period=" << m_srsPeriodicity << ")");
|
||||
Simulator::Schedule (UL_SRS_DELAY_FROM_SUBFRAME_START,
|
||||
&LteUePhy::SendSrs,
|
||||
this);
|
||||
m_sendSrsEvent = Simulator::Schedule (UL_SRS_DELAY_FROM_SUBFRAME_START,
|
||||
&LteUePhy::SendSrs,
|
||||
this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,6 +751,38 @@ LteUePhy::SendSrs ()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteUePhy::DoReset ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
m_rnti = 0;
|
||||
m_transmissionMode = 0;
|
||||
m_srsPeriodicity = 0;
|
||||
m_srsConfigured = false;
|
||||
m_dlConfigured = false;
|
||||
m_ulConfigured = false;
|
||||
m_raPreambleId = 255; // value out of range
|
||||
m_raRnti = 11; // value out of range
|
||||
m_rsrpRsrqSampleCounter = 0;
|
||||
m_p10CqiLast = Simulator::Now ();
|
||||
m_a30CqiLast = Simulator::Now ();
|
||||
|
||||
m_packetBurstQueue.clear ();
|
||||
m_controlMessagesQueue.clear ();
|
||||
m_subChannelsForTransmissionQueue.clear ();
|
||||
for (int i = 0; i < m_macChTtiDelay; i++)
|
||||
{
|
||||
Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
|
||||
m_packetBurstQueue.push_back (pb);
|
||||
std::list<Ptr<LteControlMessage> > l;
|
||||
m_controlMessagesQueue.push_back (l);
|
||||
}
|
||||
std::vector <int> ulRb;
|
||||
m_subChannelsForTransmissionQueue.resize (m_macChTtiDelay, ulRb);
|
||||
|
||||
m_sendSrsEvent.Cancel ();
|
||||
}
|
||||
|
||||
void
|
||||
LteUePhy::DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
|
||||
|
||||
@@ -216,6 +216,7 @@ private:
|
||||
void QueueSubChannelsForTransmission (std::vector <int> rbMap);
|
||||
|
||||
// UE CPHY SAP methods
|
||||
void DoReset ();
|
||||
void DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn);
|
||||
void DoSetDlBandwidth (uint8_t ulBandwidth);
|
||||
void DoConfigureUplink (uint16_t ulEarfcn, uint8_t ulBandwidth);
|
||||
@@ -262,7 +263,6 @@ private:
|
||||
|
||||
bool m_dlConfigured;
|
||||
bool m_ulConfigured;
|
||||
bool m_addedToDlChannel;
|
||||
|
||||
Ptr<LteHarqPhy> m_harqPhyModule;
|
||||
|
||||
@@ -277,6 +277,8 @@ private:
|
||||
uint16_t m_rsrpRsrqSamplePeriod;
|
||||
uint16_t m_rsrpRsrqSampleCounter;
|
||||
|
||||
EventId m_sendSrsEvent;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -608,6 +608,8 @@ LteUeRrc::DoRecvRrcConnectionReconfiguration (LteRrcSap::RrcConnectionReconfigur
|
||||
SwitchToState (CONNECTED_HANDOVER);
|
||||
const LteRrcSap::MobilityControlInfo& mci = msg.mobilityControlInfo;
|
||||
m_handoverStartTrace (m_imsi, m_cellId, m_rnti, mci.targetPhysCellId);
|
||||
m_cmacSapProvider->Reset ();
|
||||
m_cphySapProvider->Reset ();
|
||||
m_cellId = mci.targetPhysCellId;
|
||||
NS_ASSERT (mci.haveCarrierFreq);
|
||||
NS_ASSERT (mci.haveCarrierBandwidth);
|
||||
@@ -616,7 +618,6 @@ LteUeRrc::DoRecvRrcConnectionReconfiguration (LteRrcSap::RrcConnectionReconfigur
|
||||
m_cphySapProvider->ConfigureUplink (mci.carrierFreq.ulCarrierFreq, mci.carrierBandwidth.ulBandwidth);
|
||||
m_rnti = msg.mobilityControlInfo.newUeIdentity;
|
||||
m_srb0->m_rlc->SetRnti (m_rnti);
|
||||
m_cmacSapProvider->Reset ();
|
||||
NS_ASSERT_MSG (mci.haveRachConfigDedicated, "handover is only supported with non-contention-based random access procedure");
|
||||
m_cmacSapProvider->StartNonContentionBasedRandomAccessProcedure (m_rnti, mci.rachConfigDedicated.raPreambleIndex, mci.rachConfigDedicated.raPrachMaskIndex);
|
||||
m_cphySapProvider->SetRnti (m_rnti);
|
||||
|
||||
Reference in New Issue
Block a user