Commit a5a4974a authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent aaeea510
......@@ -51,24 +51,6 @@ void UeAppTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::UE_RLS_TO_APP: {
auto *w = dynamic_cast<NmUeRlsToApp *>(msg);
switch (w->present)
{
case NmUeRlsToApp::DATA_PDU_DELIVERY: {
auto *tunTask = m_tunTasks[w->psi];
if (tunTask)
{
auto *m = new NmAppToTun(NmAppToTun::DATA_PDU_DELIVERY);
m->psi = w->psi;
m->data = std::move(w->pdu);
tunTask->push(m);
}
break;
}
}
break;
}
case NtsMessageType::UE_TUN_TO_APP: {
auto *w = dynamic_cast<NmUeTunToApp *>(msg);
switch (w->present)
......@@ -95,6 +77,17 @@ void UeAppTask::onLoop()
setTimer(SWITCH_OFF_TIMER_ID, SWITCH_OFF_DELAY);
break;
}
case NmUeNasToApp::DOWNLINK_DATA_DELIVERY: {
auto *tunTask = m_tunTasks[w->psi];
if (tunTask)
{
auto *m = new NmAppToTun(NmAppToTun::DATA_PDU_DELIVERY);
m->psi = w->psi;
m->data = std::move(w->data);
tunTask->push(m);
}
break;
}
}
break;
}
......
......@@ -49,7 +49,11 @@ void NasSm::onTimerTick()
void NasSm::handleUplinkDataRequest(int psi, OctetString &&data)
{
if (m_mm->m_mmState == EMmState::MM_NULL)
auto state = m_mm->m_mmSubState;
if (state != EMmSubState::MM_REGISTERED_INITIATED_PS && state != EMmSubState::MM_REGISTERED_NORMAL_SERVICE &&
state != EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE &&
state != EMmSubState::MM_REGISTERED_LIMITED_SERVICE && state != EMmSubState::MM_DEREGISTERED_INITIATED_PS &&
state != EMmSubState::MM_SERVICE_REQUEST_INITIATED_PS)
return;
if (m_pduSessions[psi]->psState != EPsState::ACTIVE)
......@@ -81,4 +85,20 @@ void NasSm::handleUplinkDataRequest(int psi, OctetString &&data)
}
}
void NasSm::handleDownlinkDataRequest(int psi, OctetString &&data)
{
auto state = m_mm->m_mmSubState;
if (state != EMmSubState::MM_REGISTERED_INITIATED_PS && state != EMmSubState::MM_REGISTERED_NORMAL_SERVICE &&
state != EMmSubState::MM_REGISTERED_NON_ALLOWED_SERVICE &&
state != EMmSubState::MM_REGISTERED_LIMITED_SERVICE && state != EMmSubState::MM_DEREGISTERED_INITIATED_PS &&
state != EMmSubState::MM_SERVICE_REQUEST_INITIATED_PS)
return;
auto *w = new NmUeNasToApp(NmUeNasToApp::DOWNLINK_DATA_DELIVERY);
w->psi = psi;
w->data = std::move(data);
m_base->appTask->push(w);
}
} // namespace nr::ue
......@@ -93,6 +93,7 @@ class NasSm
void handleNasEvent(const NmUeNasToNas &msg);
void onTimerTick();
void handleUplinkDataRequest(int psi, OctetString &&data);
void handleDownlinkDataRequest(int psi, OctetString &&data);
};
} // namespace nr::ue
\ No newline at end of file
......@@ -93,6 +93,18 @@ void NasTask::onLoop()
}
break;
}
case NtsMessageType::UE_RLS_TO_NAS: {
auto *w = dynamic_cast<NmUeRlsToNas *>(msg);
switch (w->present)
{
case NmUeRlsToNas::DATA_PDU_DELIVERY: {
sm->handleDownlinkDataRequest(w->psi, std::move(w->pdu));
break;
}
}
break;
}
case NtsMessageType::TIMER_EXPIRED: {
auto *w = dynamic_cast<NmTimerExpired *>(msg);
int timerId = w->timerId;
......
......@@ -187,8 +187,13 @@ struct NmUeNasToApp : NtsMessage
enum PR
{
PERFORM_SWITCH_OFF,
DOWNLINK_DATA_DELIVERY
} present;
// DOWNLINK_DATA_DELIVERY
int psi{};
OctetString data;
explicit NmUeNasToApp(PR present) : NtsMessage(NtsMessageType::UE_NAS_TO_APP), present(present)
{
}
......@@ -226,7 +231,7 @@ struct NmUeNasToRls : NtsMessage
}
};
struct NmUeRlsToApp : NtsMessage
struct NmUeRlsToNas : NtsMessage
{
enum PR
{
......@@ -237,7 +242,7 @@ struct NmUeRlsToApp : NtsMessage
int psi{};
OctetString pdu{};
explicit NmUeRlsToApp(PR present) : NtsMessage(NtsMessageType::UE_RLS_TO_APP), present(present)
explicit NmUeRlsToNas(PR present) : NtsMessage(NtsMessageType::UE_RLS_TO_NAS), present(present)
{
}
};
......
......@@ -9,6 +9,7 @@
#include "task.hpp"
#include <ue/app/task.hpp>
#include <ue/nas/task.hpp>
#include <ue/rrc/task.hpp>
#include <utils/common.hpp>
#include <utils/constants.hpp>
......@@ -55,10 +56,10 @@ void UeRlsTask::onLoop()
break;
}
case NmUeRlsToRls::DOWNLINK_DATA: {
auto *m = new NmUeRlsToApp(NmUeRlsToApp::DATA_PDU_DELIVERY);
auto *m = new NmUeRlsToNas(NmUeRlsToNas::DATA_PDU_DELIVERY);
m->psi = w->psi;
m->pdu = std::move(w->data);
m_base->appTask->push(m);
m_base->nasTask->push(m);
break;
}
case NmUeRlsToRls::DOWNLINK_RRC: {
......
......@@ -45,7 +45,6 @@ enum class NtsMessageType
GNB_NGAP_TO_GTP,
GNB_SCTP,
UE_APP_TO_RLS,
UE_APP_TO_TUN,
UE_APP_TO_NAS,
UE_TUN_TO_APP,
......@@ -55,7 +54,7 @@ enum class NtsMessageType
UE_RRC_TO_RRC,
UE_NAS_TO_NAS,
UE_RLS_TO_RRC,
UE_RLS_TO_APP,
UE_RLS_TO_NAS,
UE_RLS_TO_RLS,
UE_NAS_TO_APP,
UE_NAS_TO_RLS,
......
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