Commit 7cba7f5f authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 52fe70b7
...@@ -161,7 +161,7 @@ class NasMm ...@@ -161,7 +161,7 @@ class NasMm
private: /* Radio */ private: /* Radio */
void performPlmnSelection(); void performPlmnSelection();
void localReleaseConnection(); void localReleaseConnection();
void handleActiveCellChange(); void handleActiveCellChange(const Tai& prevTai);
void handleRrcConnectionSetup(); void handleRrcConnectionSetup();
void handleRrcConnectionRelease(); void handleRrcConnectionRelease();
void handleRrcEstablishmentFailure(); void handleRrcEstablishmentFailure();
......
...@@ -148,7 +148,7 @@ void NasMm::performPlmnSelection() ...@@ -148,7 +148,7 @@ void NasMm::performPlmnSelection()
} }
} }
void NasMm::handleActiveCellChange() void NasMm::handleActiveCellChange(const Tai &prevTai)
{ {
if (m_cmState == ECmState::CM_CONNECTED) if (m_cmState == ECmState::CM_CONNECTED)
{ {
...@@ -163,6 +163,15 @@ void NasMm::handleActiveCellChange() ...@@ -163,6 +163,15 @@ void NasMm::handleActiveCellChange()
if (currentCell.hasValue() && !m_storage->equivalentPlmnList->contains(currentCell.plmn)) if (currentCell.hasValue() && !m_storage->equivalentPlmnList->contains(currentCell.plmn))
m_timers->t3346.stop(); m_timers->t3346.stop();
if (currentCell.hasValue() && prevTai != currentTai)
{
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_ATTEMPTING_REGISTRATION ||
m_mmSubState == EMmSubState::MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE)
{
resetRegAttemptCounter();
}
}
if (m_mmState == EMmState::MM_REGISTERED) if (m_mmState == EMmState::MM_REGISTERED)
{ {
if (currentCell.cellId == 0) if (currentCell.cellId == 0)
......
...@@ -45,7 +45,7 @@ void NasMm::handleRrcEvent(const NwUeRrcToNas &msg) ...@@ -45,7 +45,7 @@ void NasMm::handleRrcEvent(const NwUeRrcToNas &msg)
break; break;
} }
case NwUeRrcToNas::ACTIVE_CELL_CHANGED: { case NwUeRrcToNas::ACTIVE_CELL_CHANGED: {
handleActiveCellChange(); handleActiveCellChange(msg.previousTai);
break; break;
} }
case NwUeRrcToNas::RRC_ESTABLISHMENT_FAILURE: { case NwUeRrcToNas::RRC_ESTABLISHMENT_FAILURE: {
......
...@@ -79,6 +79,9 @@ struct NwUeRrcToNas : NtsMessage ...@@ -79,6 +79,9 @@ struct NwUeRrcToNas : NtsMessage
// PAGING // PAGING
std::vector<GutiMobileIdentity> pagingTmsi; std::vector<GutiMobileIdentity> pagingTmsi;
// ACTIVE_CELL_CHANGED
Tai previousTai;
explicit NwUeRrcToNas(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_NAS), present(present) explicit NwUeRrcToNas(PR present) : NtsMessage(NtsMessageType::UE_RRC_TO_NAS), present(present)
{ {
} }
......
...@@ -27,9 +27,9 @@ void UeRrcTask::performCellSelection() ...@@ -27,9 +27,9 @@ void UeRrcTask::performCellSelection()
if (currentTime - m_startedTime <= 1000LL && m_cellDesc.empty()) if (currentTime - m_startedTime <= 1000LL && m_cellDesc.empty())
return; return;
int lastCell = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; }); auto lastCell = m_base->shCtx.currentCell.get();
bool shouldLogErrors = lastCell != 0 || (currentTime - m_lastTimePlmnSearchFailureLogged >= 30'000LL); bool shouldLogErrors = lastCell.cellId != 0 || (currentTime - m_lastTimePlmnSearchFailureLogged >= 30'000LL);
ActiveCellInfo cellInfo; ActiveCellInfo cellInfo;
CellSelectionReport report; CellSelectionReport report;
...@@ -92,17 +92,18 @@ void UeRrcTask::performCellSelection() ...@@ -92,17 +92,18 @@ void UeRrcTask::performCellSelection()
int selectedCell = cellInfo.cellId; int selectedCell = cellInfo.cellId;
m_base->shCtx.currentCell.set(cellInfo); m_base->shCtx.currentCell.set(cellInfo);
if (selectedCell != 0 && selectedCell != lastCell) if (selectedCell != 0 && selectedCell != lastCell.cellId)
m_logger->info("Selected cell plmn[%s] tac[%d] category[%s]", ToJson(cellInfo.plmn).str().c_str(), cellInfo.tac, m_logger->info("Selected cell plmn[%s] tac[%d] category[%s]", ToJson(cellInfo.plmn).str().c_str(), cellInfo.tac,
ToJson(cellInfo.category).str().c_str()); ToJson(cellInfo.category).str().c_str());
if (selectedCell != lastCell) if (selectedCell != lastCell.cellId)
{ {
auto *w1 = new NwUeRrcToRls(NwUeRrcToRls::ASSIGN_CURRENT_CELL); auto *w1 = new NwUeRrcToRls(NwUeRrcToRls::ASSIGN_CURRENT_CELL);
w1->cellId = selectedCell; w1->cellId = selectedCell;
m_base->rlsTask->push(w1); m_base->rlsTask->push(w1);
auto w2 = new NwUeRrcToNas(NwUeRrcToNas::ACTIVE_CELL_CHANGED); auto w2 = new NwUeRrcToNas(NwUeRrcToNas::ACTIVE_CELL_CHANGED);
w2->previousTai = Tai{lastCell.plmn, lastCell.tac};
m_base->nasTask->push(w2); m_base->nasTask->push(w2);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment