Commit 38b92d1f authored by aligungr's avatar aligungr

SM cause send implementation

parent bae4d5c5
......@@ -55,7 +55,7 @@ class NasSm
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);
void sendSmCause(const nas::ESmCause &cause, int pti, int psi);
/* Allocation */
int allocatePduSessionId(const SessionConfig &config);
......
......@@ -72,10 +72,22 @@ 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)
void NasSm::sendSmCause(const nas::ESmCause &cause, int pti, int psi)
{
m_logger->warn("Sending SM Cause[%s] for PSI[%d]", nas::utils::EnumToString(cause), psi);
// TODO
nas::FiveGSmStatus smStatus{};
smStatus.smCause.value = cause;
smStatus.pti = pti;
smStatus.pduSessionId = psi;
nas::UlNasTransport ulTransport{};
ulTransport.payloadContainerType.payloadContainerType = nas::EPayloadContainerType::N1_SM_INFORMATION;
nas::EncodeNasMessage(smStatus, ulTransport.payloadContainer.data);
ulTransport.pduSessionId = nas::IEPduSessionIdentity2{};
ulTransport.pduSessionId->value = psi;
m_mm->deliverUlTransport(ulTransport);
}
} // namespace nr::ue
\ No newline at end of file
......@@ -19,7 +19,7 @@ bool NasSm::checkPtiAndPsi(const nas::SmMessage &msg)
if (msg.pti < ProcedureTransaction::MIN_ID || msg.pti > ProcedureTransaction::MAX_ID)
{
m_logger->err("Received PTI [%d] value is invalid", msg.pti);
sendSmCause(nas::ESmCause::INVALID_PTI_VALUE, msg.pduSessionId);
sendSmCause(nas::ESmCause::INVALID_PTI_VALUE, msg.pti, msg.pduSessionId);
return false;
}
......@@ -27,7 +27,7 @@ bool NasSm::checkPtiAndPsi(const nas::SmMessage &msg)
{
m_logger->err("Received PSI value [%d] is invalid, expected was [%d]", msg.pduSessionId,
m_procedureTransactions[msg.pti].psi);
sendSmCause(nas::ESmCause::INVALID_PTI_VALUE, msg.pduSessionId);
sendSmCause(nas::ESmCause::INVALID_PTI_VALUE, msg.pti, msg.pduSessionId);
return false;
}
......
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