Commit 020b415f authored by aligungr's avatar aligungr

UL NAS transport improvement

parent 5b72232c
......@@ -28,8 +28,8 @@ class NasSm
std::unique_ptr<Logger> m_logger;
NasMm *m_mm;
std::array<PduSession, 16> m_pduSessions{};
ProcedureTransaction m_procedureTransactions[255]{};
std::array<PduSession*, 16> m_pduSessions{};
std::array<ProcedureTransaction, 255> m_procedureTransactions{};
friend class UeCmdHandler;
......@@ -48,12 +48,14 @@ class NasSm
/* Resource */
void localReleaseSession(int psi);
void localReleaseAllSessions();
bool anyEmergencySession();
private:
/* Transport */
void sendSmMessage(int psi, const nas::SmMessage &msg);
void receiveSmStatus(const nas::FiveGSmStatus &msg);
void receiveSmCause(const nas::IE5gSmCause &msg);
void sendSmCause(const nas::ESmCause &cause, int psi);
/* Allocation */
int allocatePduSessionId(const SessionConfig &config);
......
......@@ -7,8 +7,8 @@
//
#include "sm.hpp"
#include <ue/mm/mm.hpp>
#include <nas/utils.hpp>
#include <ue/mm/mm.hpp>
namespace nr::ue
{
......@@ -23,13 +23,17 @@ void NasSm::sendSmMessage(int psi, const nas::SmMessage &msg)
m.pduSessionId = nas::IEPduSessionIdentity2{};
m.pduSessionId->value = psi;
m.requestType = nas::IERequestType{};
m.requestType->requestType = nas::ERequestType::INITIAL_REQUEST; // TODO
m.requestType->requestType =
session->isEmergency ? nas::ERequestType::INITIAL_EMERGENCY_REQUEST : nas::ERequestType::INITIAL_REQUEST;
if (session.sNssai.has_value())
m.sNssa = nas::utils::SNssaiFrom(*session.sNssai);
if (!session->isEmergency)
{
if (session->sNssai.has_value())
m.sNssa = nas::utils::SNssaiFrom(*session->sNssai);
if (session.apn.has_value())
m.dnn = nas::utils::DnnFromApn(*session.apn);
if (session->apn.has_value())
m.dnn = nas::utils::DnnFromApn(*session->apn);
}
m_mm->deliverUlTransport(m);
}
......@@ -65,4 +69,10 @@ void NasSm::receiveSmCause(const nas::IE5gSmCause &msg)
m_logger->err("SM cause received: %s", nas::utils::EnumToString(msg.value));
}
void NasSm::sendSmCause(const nas::ESmCause &cause, int psi)
{
m_logger->warn("Sending SM Cause[%s] for PSI[%d]", nas::utils::EnumToString(cause), psi);
// TODO
}
} // namespace nr::ue
\ No newline at end of file
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