Commit c5bb895b authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 9cc4615f
......@@ -105,7 +105,7 @@ void NasMm::performPlmnSelection()
}
else if (lastSelectedPlmn != selected)
{
m_logger->info("Selected PLMN[%s]", ToJson(selected).str().c_str());
m_logger->info("Selected plmn[%s]", ToJson(selected).str().c_str());
m_base->rrcTask->push(new NwUeNasToRrc(NwUeNasToRrc::RRC_NOTIFY));
}
......@@ -151,46 +151,60 @@ void NasMm::handleActiveCellChange(const Tai &lastTai)
return;
}
Tai currentTai = m_base->shCtx.getCurrentTai();
auto currentCell = m_base->shCtx.currentCell.get();
Tai currentTai = Tai{currentCell.plmn, currentCell.tac};
}
/*void NasMm::handleServingCellChange(const UeCellInfo &servingCell)
{
if (m_cmState == ECmState::CM_CONNECTED)
if (m_mmState == EMmState::MM_REGISTERED)
{
m_logger->err("Serving cell change in CM-CONNECTED");
return;
}
if (currentCell.cellId == 0)
{
if (m_mmSubState != EMmSubState::MM_REGISTERED_PLMN_SEARCH &&
m_mmSubState != EMmSubState::MM_REGISTERED_NO_CELL_AVAILABLE)
{
switchMmState(EMmSubState::MM_REGISTERED_PLMN_SEARCH);
}
}
else
{
if (currentCell.category == ECellCategory::SUITABLE_CELL)
switchMmState(EMmSubState::MM_REGISTERED_NORMAL_SERVICE);
else if (currentCell.category == ECellCategory::ACCEPTABLE_CELL)
switchMmState(EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
else
switchMmState(EMmSubState::MM_REGISTERED_PS);
if (servingCell.cellCategory != ECellCategory::ACCEPTABLE_CELL &&
servingCell.cellCategory != ECellCategory::SUITABLE_CELL)
{
m_logger->err("Serving cell change with unhandled cell category");
return;
if (!nas::utils::TaiListContains(m_usim->m_taiList, nas::VTrackingAreaIdentity{currentTai}))
sendMobilityRegistration(ERegUpdateCause::ENTER_UNLISTED_TRACKING_AREA);
}
}
m_logger->info("Serving cell determined [%s]", servingCell.gnbName.c_str());
if (m_mmState == EMmState::MM_REGISTERED || m_mmState == EMmState::MM_DEREGISTERED)
else if (m_mmState == EMmState::MM_DEREGISTERED)
{
bool isSuitable = servingCell.cellCategory == ECellCategory::SUITABLE_CELL;
if (m_mmState == EMmState::MM_REGISTERED)
switchMmState(EMmState::MM_REGISTERED, isSuitable ? EMmSubState::MM_REGISTERED_NORMAL_SERVICE
: EMmSubState::MM_REGISTERED_LIMITED_SERVICE);
if (currentCell.cellId == 0)
{
if (m_mmSubState != EMmSubState::MM_DEREGISTERED_PLMN_SEARCH &&
m_mmSubState != EMmSubState::MM_DEREGISTERED_NO_CELL_AVAILABLE)
{
switchMmState(EMmSubState::MM_DEREGISTERED_PLMN_SEARCH);
}
}
else
switchMmState(EMmState::MM_DEREGISTERED, isSuitable ? EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE
: EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
{
if (currentCell.category == ECellCategory::SUITABLE_CELL)
switchMmState(EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE);
else if (currentCell.category == ECellCategory::ACCEPTABLE_CELL)
switchMmState(EMmSubState::MM_DEREGISTERED_LIMITED_SERVICE);
else
switchMmState(EMmSubState::MM_DEREGISTERED_PS);
}
}
// todo: else, other states abnormal case
resetRegAttemptCounter();
m_usim->m_servingCell = servingCell;
m_usim->m_currentTai =
nas::VTrackingAreaIdentity{nas::utils::PlmnFrom(servingCell.cellId.plmn), octet3{servingCell.tac}};
}*/
else if (m_mmState == EMmState::MM_REGISTERED_INITIATED || m_mmState == EMmState::MM_DEREGISTERED_INITIATED ||
m_mmState == EMmState::MM_SERVICE_REQUEST_INITIATED)
{
// This should never happen
m_logger->err("Active cell change in [CM-IDLE] state while MM specific procedure is ongoing");
localReleaseConnection();
}
}
void NasMm::handleRrcConnectionSetup()
{
......@@ -219,6 +233,9 @@ void NasMm::handleRadioLinkFailure()
void NasMm::localReleaseConnection()
{
if (m_cmState == ECmState::CM_IDLE)
return;
m_logger->info("Performing local release of NAS connection");
m_base->rrcTask->push(new NwUeNasToRrc(NwUeNasToRrc::LOCAL_RELEASE_CONNECTION));
......
......@@ -37,7 +37,7 @@ void NasSm::establishInitialSessions()
return;
}
m_logger->info("Initial PDU sessions are establishing [%d#]", m_base->config->initSessions.size());
m_logger->debug("Initial PDU sessions are establishing [%d#]", m_base->config->initSessions.size());
for (auto &sess : m_base->config->initSessions)
sendEstablishmentRequest(sess);
......
......@@ -94,7 +94,8 @@ void UeRrcTask::performCellSelection()
m_base->shCtx.currentCell.set(cellInfo);
if (selectedCell != 0 && selectedCell != lastCell)
m_logger->info("Selected cell id[%d] category[%s]", selectedCell, ToJson(cellInfo.category).str().c_str());
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());
if (selectedCell != lastCell)
{
......
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