Commit cba865df authored by aligungr's avatar aligungr

MM refactor

parent 61d09a6e
...@@ -47,4 +47,16 @@ void NasMm::handleRrcEvent(const NwUeRrcToNas &msg) ...@@ -47,4 +47,16 @@ void NasMm::handleRrcEvent(const NwUeRrcToNas &msg)
} }
} }
void NasMm::handleNasEvent(const NwUeNasToNas &msg)
{
switch (msg.present)
{
case NwUeNasToNas::NAS_TIMER_EXPIRE:
onTimerExpire(*msg.timer);
break;
default:
break;
}
}
} // namespace nr::ue } // namespace nr::ue
...@@ -157,11 +157,12 @@ class NasMm ...@@ -157,11 +157,12 @@ class NasMm
bool startECallInactivityIfNeeded(); bool startECallInactivityIfNeeded();
bool switchToECallInactivityIfNeeded(); bool switchToECallInactivityIfNeeded();
public: /* Timer */ private: /* Timer */
void onTimerExpire(nas::NasTimer &timer); void onTimerExpire(nas::NasTimer &timer);
public: /* Interface */ public: /* Interface */
void handleRrcEvent(const NwUeRrcToNas &msg); void handleRrcEvent(const NwUeRrcToNas &msg);
void handleNasEvent(const NwUeNasToNas &msg);
}; };
} // namespace nr::ue } // namespace nr::ue
\ No newline at end of file
...@@ -67,7 +67,12 @@ void NasTask::onLoop() ...@@ -67,7 +67,12 @@ void NasTask::onLoop()
mm->performMmCycle(); mm->performMmCycle();
break; break;
case NwUeNasToNas::NAS_TIMER_EXPIRE: case NwUeNasToNas::NAS_TIMER_EXPIRE:
onTimerExpire(*w->timer); if (w->timer->isMmTimer())
mm->handleNasEvent(*w);
else
{
// TODO, handle SM timer
}
break; break;
case NwUeNasToNas::ESTABLISH_INITIAL_SESSIONS: case NwUeNasToNas::ESTABLISH_INITIAL_SESSIONS:
sm->establishInitialSessions(); sm->establishInitialSessions();
...@@ -98,16 +103,6 @@ void NasTask::onLoop() ...@@ -98,16 +103,6 @@ void NasTask::onLoop()
delete msg; delete msg;
} }
void NasTask::onTimerExpire(nas::NasTimer &timer)
{
if (timer.isMmTimer())
mm->onTimerExpire(timer);
else
{
// TODO
}
}
void NasTask::performTick() void NasTask::performTick()
{ {
auto sendExpireMsg = [this](nas::NasTimer *timer) { auto sendExpireMsg = [this](nas::NasTimer *timer) {
......
...@@ -42,7 +42,6 @@ class NasTask : public NtsTask ...@@ -42,7 +42,6 @@ class NasTask : public NtsTask
void onQuit() override; void onQuit() override;
private: private:
void onTimerExpire(nas::NasTimer &timer);
void performTick(); void performTick();
}; };
......
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