Commit effbacb2 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 31f77086
......@@ -183,6 +183,8 @@ void NasMm::switchMmState(EMmState state, EMmSubState subState)
m_mmState = state;
m_mmSubState = subState;
m_lastTimeMmStateChange = utils::CurrentTimeMillis();
onSwitchMmState(oldState, m_mmState, oldSubState, m_mmSubState);
if (m_base->nodeListener)
......
......@@ -64,6 +64,8 @@ class NasMm
int m_nwConsecutiveAuthFailure{};
// Last time PLMN search failure logged
int64_t m_lastTimePlmnSearchFailureLogged{};
// Last time MM state changed
int64_t m_lastTimeMmStateChange{};
friend class UeCmdHandler;
......
......@@ -23,10 +23,25 @@ void NasMm::performPlmnSelection()
{
int64_t currentTime = utils::CurrentTimeMillis();
// After some timeout in PLMN_SEARCH states, NO_CELL_AVAILABLE state is selected
if (currentTime - m_lastTimeMmStateChange >= 5'000LL)
{
if (m_mmSubState == EMmSubState::MM_REGISTERED_PLMN_SEARCH)
{
switchMmState(EMmState::MM_REGISTERED, EMmSubState::MM_REGISTERED_NO_CELL_AVAILABLE);
return;
}
else if (m_mmSubState == EMmSubState::MM_DEREGISTERED_PLMN_SEARCH)
{
switchMmState(EMmState::MM_DEREGISTERED, EMmSubState::MM_DEREGISTERED_NO_CELL_AVAILABLE);
return;
}
}
// If the state is PLMN_SEARCH instead of NO_CELL_AVAILABLE, then we log the errors more intensely.
int64_t loggingThreshold = m_mmSubState == EMmSubState::MM_DEREGISTERED_PLMN_SEARCH ||
m_mmSubState == EMmSubState::MM_REGISTERED_PLMN_SEARCH
? 1'000LL
? 2'000LL
: 10'000LL;
bool logFailures = currentTime - m_lastTimePlmnSearchFailureLogged >= loggingThreshold;
......
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