Index: src/lte/model/lte-ue-rrc.cc |
=================================================================== |
--- a/src/lte/model/lte-ue-rrc.cc |
+++ b/src/lte/model/lte-ue-rrc.cc |
@@ -139,16 +139,19 @@ |
{ |
NS_LOG_FUNCTION (this); |
//m_cphySapUser = new MemberLteUeCphySapUser<LteUeRrc> (this); |
- m_cmacSapUser = new UeMemberLteUeCmacSapUser (this); |
+ // m_cmacSapUser = new UeMemberLteUeCmacSapUser (this); |
m_rrcSapProvider = new MemberLteUeRrcSapProvider<LteUeRrc> (this); |
m_drbPdcpSapUser = new LtePdcpSpecificLtePdcpSapUser<LteUeRrc> (this); |
m_asSapProvider = new MemberLteAsSapProvider<LteUeRrc> (this); |
m_supportCa = false; |
m_cphySapUser.resize (1); |
m_cphySapProvider.resize (1); |
+ m_cmacSapUser.resize (1); |
+ m_cmacSapProvider.resize (1); |
for ( uint16_t i = 0; i < m_cphySapUser.size (); i++) |
{ |
m_cphySapUser[i] = new MemberLteUeCphySapUser<LteUeRrc> (this); |
+ m_cmacSapUser[i] = new UeMemberLteUeCmacSapUser (this); |
} |
} |
@@ -163,12 +166,13 @@ |
{ |
NS_LOG_FUNCTION (this); |
//delete m_cphySapUser; |
- delete m_cmacSapUser; |
+ //delete m_cmacSapUser; |
delete m_rrcSapProvider; |
delete m_drbPdcpSapUser; |
delete m_asSapProvider; |
m_drbMap.clear (); |
m_cphySapUser.clear (); |
+ m_cmacSapUser.clear (); |
} |
TypeId |
@@ -290,14 +294,28 @@ |
LteUeRrc::SetLteUeCmacSapProvider (LteUeCmacSapProvider * s) |
{ |
NS_LOG_FUNCTION (this << s); |
- m_cmacSapProvider = s; |
+ m_cmacSapProvider.at (0) = s; |
+} |
+ |
+void |
+LteUeRrc::SetLteUeCmacSapProvider (LteUeCmacSapProvider * s, uint16_t index) |
+{ |
+ NS_LOG_FUNCTION (this << s); |
+ m_cmacSapProvider.at (index) = s; |
} |
LteUeCmacSapUser* |
LteUeRrc::GetLteUeCmacSapUser () |
{ |
NS_LOG_FUNCTION (this); |
- return m_cmacSapUser; |
+ return m_cmacSapUser.at (0); |
+} |
+ |
+LteUeCmacSapUser* |
+LteUeRrc::GetLteUeCmacSapUser (uint16_t index) |
+{ |
+ NS_LOG_FUNCTION (this); |
+ return m_cmacSapUser.at (index); |
} |
void |
@@ -322,6 +340,20 @@ |
} |
void |
+LteUeRrc::SetLteCcmRrcSapProvider (LteCcmRrcSapProvider * s) |
+{ |
+ NS_LOG_FUNCTION (this << s); |
+ m_ccmRrcSapProvider = s; |
+} |
+ |
+LteCcmRrcSapUser* |
+LteUeRrc::GetLteCcmRrcSapUser () |
+{ |
+ NS_LOG_FUNCTION (this); |
+ return m_ccmRrcSapUser; |
+} |
+ |
+void |
LteUeRrc::SetAsSapUser (LteAsSapUser* s) |
{ |
m_asSapUser = s; |
@@ -446,7 +478,7 @@ |
lcConfig.bucketSizeDurationMs = 65535; // maximum |
lcConfig.logicalChannelGroup = 0; // all SRBs mapped to LCG 0 |
- m_cmacSapProvider->AddLc (lcid, lcConfig, rlc->GetLteMacSapUser ()); |
+ m_cmacSapProvider.at(0) ->AddLc (lcid, lcConfig, rlc->GetLteMacSapUser ()); |
} |
@@ -855,7 +887,7 @@ |
rc.numberOfRaPreambles = msg.sib2.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles; |
rc.preambleTransMax = msg.sib2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax; |
rc.raResponseWindowSize = msg.sib2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize; |
- m_cmacSapProvider->ConfigureRach (rc); |
+ m_cmacSapProvider.at (0)->ConfigureRach (rc); |
m_cphySapProvider.at (0)->ConfigureUplink (m_ulEarfcn, m_ulBandwidth); |
m_cphySapProvider.at (0)->ConfigureReferenceSignalPower (msg.sib2.radioResourceConfigCommon.pdschConfigCommon.referenceSignalPower); |
if (m_state == IDLE_WAIT_SIB2) |
@@ -921,7 +953,7 @@ |
SwitchToState (CONNECTED_HANDOVER); |
const LteRrcSap::MobilityControlInfo& mci = msg.mobilityControlInfo; |
m_handoverStartTrace (m_imsi, m_cellId, m_rnti, mci.targetPhysCellId); |
- m_cmacSapProvider->Reset (); |
+ m_cmacSapProvider.at (0)->Reset (); |
m_cphySapProvider[0]->Reset (); |
m_cellId = mci.targetPhysCellId; |
NS_ASSERT (mci.haveCarrierFreq); |
@@ -932,7 +964,7 @@ |
m_rnti = msg.mobilityControlInfo.newUeIdentity; |
m_srb0->m_rlc->SetRnti (m_rnti); |
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_cmacSapProvider.at (0)->StartNonContentionBasedRandomAccessProcedure (m_rnti, mci.rachConfigDedicated.raPreambleIndex, mci.rachConfigDedicated.raPrachMaskIndex); |
m_cphySapProvider[0]->SetRnti (m_rnti); |
m_lastRrcTransactionIdentifier = msg.rrcTransactionIdentifier; |
NS_ASSERT (msg.haveRadioResourceConfigDedicated); |
@@ -1038,7 +1070,7 @@ |
NS_LOG_FUNCTION (this); |
m_connectionTimeout.Cancel (); |
- m_cmacSapProvider->Reset (); // reset the MAC |
+ m_cmacSapProvider.at (0)->Reset (); // reset the MAC |
m_hasReceivedSib2 = false; // invalidate the previously received SIB2 |
SwitchToState (IDLE_CAMPED_NORMALLY); |
m_asSapUser->NotifyConnectionFailed (); // inform upper layer |
@@ -1219,7 +1251,7 @@ |
lcConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs; |
lcConfig.logicalChannelGroup = stamIt->logicalChannelConfig.logicalChannelGroup; |
- m_cmacSapProvider->AddLc (lcid, lcConfig, rlc->GetLteMacSapUser ()); |
+ m_cmacSapProvider.at (0)->AddLc (lcid, lcConfig, rlc->GetLteMacSapUser ()); |
++stamIt; |
NS_ASSERT_MSG (stamIt == rrcd.srbToAddModList.end (), "at most one SrbToAdd supported"); |
@@ -1310,7 +1342,7 @@ |
lcConfig.bucketSizeDurationMs = dtamIt->logicalChannelConfig.bucketSizeDurationMs; |
lcConfig.logicalChannelGroup = dtamIt->logicalChannelConfig.logicalChannelGroup; |
- m_cmacSapProvider->AddLc (dtamIt->logicalChannelIdentity, |
+ m_cmacSapProvider.at (0)->AddLc (dtamIt->logicalChannelIdentity, |
lcConfig, |
rlc->GetLteMacSapUser ()); |
rlc->Initialize (); |
@@ -1335,7 +1367,7 @@ |
m_drbMap.erase (it); |
m_bid2DrbidMap.erase (drbid); |
//Remove LCID |
- m_cmacSapProvider->RemoveLc (drbid + 2); |
+ m_cmacSapProvider.at (0)->RemoveLc (drbid + 2); |
} |
} |
@@ -2793,7 +2825,7 @@ |
NS_ASSERT (m_hasReceivedSib2); |
m_connectionPending = false; // reset the flag |
SwitchToState (IDLE_RANDOM_ACCESS); |
- m_cmacSapProvider->StartContentionBasedRandomAccessProcedure (); |
+ m_cmacSapProvider.at (0)->StartContentionBasedRandomAccessProcedure (); |
} |
void |
@@ -2801,11 +2833,11 @@ |
{ |
NS_LOG_FUNCTION (this << m_imsi); |
m_asSapUser->NotifyConnectionReleased (); |
- m_cmacSapProvider->RemoveLc (1); |
+ m_cmacSapProvider.at (0)->RemoveLc (1); |
std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it; |
for (it = m_drbMap.begin (); it != m_drbMap.end (); ++it) |
{ |
- m_cmacSapProvider->RemoveLc (it->second->m_logicalChannelIdentity); |
+ m_cmacSapProvider.at (0)->RemoveLc (it->second->m_logicalChannelIdentity); |
} |
m_drbMap.clear (); |
m_bid2DrbidMap.clear (); |
@@ -2817,7 +2849,7 @@ |
LteUeRrc::ConnectionTimeout () |
{ |
NS_LOG_FUNCTION (this << m_imsi); |
- m_cmacSapProvider->Reset (); // reset the MAC |
+ m_cmacSapProvider.at (0)->Reset (); // reset the MAC |
m_hasReceivedSib2 = false; // invalidate the previously received SIB2 |
SwitchToState (IDLE_CAMPED_NORMALLY); |
m_connectionTimeoutTrace (m_imsi, m_cellId, m_rnti); |