Commit 4fce9d0b authored by aligungr's avatar aligungr

Uplink data status handling in SM

parent 342fbf2f
...@@ -89,6 +89,7 @@ void NasSm::sendEstablishmentRequest(const SessionConfig &config) ...@@ -89,6 +89,7 @@ void NasSm::sendEstablishmentRequest(const SessionConfig &config)
ps->sessionAmbr = {}; ps->sessionAmbr = {};
ps->authorizedQoSFlowDescriptions = {}; ps->authorizedQoSFlowDescriptions = {};
ps->pduAddress = {}; ps->pduAddress = {};
ps->uplinkPending = false;
/* Make PCO */ /* Make PCO */
nas::ProtocolConfigurationOptions opt{}; nas::ProtocolConfigurationOptions opt{};
......
...@@ -39,4 +39,22 @@ void NasSm::onTimerTick() ...@@ -39,4 +39,22 @@ void NasSm::onTimerTick()
} }
} }
bool NasSm::anyUplinkDataPending()
{
auto status = getUplinkDataStatus();
for (int i = 1; i < 16; i++)
if (status[i])
return true;
return false;
}
std::bitset<16> NasSm::getUplinkDataStatus()
{
std::bitset<16> res{};
for (int i = 1; i < 16; i++)
if (m_pduSessions[i]->psState == EPsState::ACTIVE && m_pduSessions[i]->uplinkPending)
res[i] = true;
return res;
}
} // namespace nr::ue } // namespace nr::ue
...@@ -61,6 +61,9 @@ bool NasSm::anyEmergencySession() ...@@ -61,6 +61,9 @@ bool NasSm::anyEmergencySession()
void NasSm::handleUplinkStatusChange(int psi, bool isPending) void NasSm::handleUplinkStatusChange(int psi, bool isPending)
{ {
m_logger->debug("Uplink data status changed PSI[%d] pending[%s]", psi, isPending ? "true" : "false"); m_logger->debug("Uplink data status changed PSI[%d] pending[%s]", psi, isPending ? "true" : "false");
m_pduSessions[psi]->uplinkPending = isPending;
// TODO // TODO
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#pragma once #pragma once
#include <array> #include <array>
#include <bitset>
#include <nas/nas.hpp> #include <nas/nas.hpp>
#include <nas/timer.hpp> #include <nas/timer.hpp>
#include <ue/nts.hpp> #include <ue/nts.hpp>
...@@ -50,6 +51,8 @@ class NasSm ...@@ -50,6 +51,8 @@ class NasSm
void localReleaseAllSessions(); void localReleaseAllSessions();
bool anyEmergencySession(); bool anyEmergencySession();
void handleUplinkStatusChange(int psi, bool isPending); void handleUplinkStatusChange(int psi, bool isPending);
bool anyUplinkDataPending();
std::bitset<16> getUplinkDataStatus();
/* Session Release */ /* Session Release */
void sendReleaseRequest(int psi); void sendReleaseRequest(int psi);
......
...@@ -250,6 +250,7 @@ struct PduSession ...@@ -250,6 +250,7 @@ struct PduSession
const int psi; const int psi;
EPsState psState{}; EPsState psState{};
bool uplinkPending{};
nas::EPduSessionType sessionType{}; nas::EPduSessionType sessionType{};
std::optional<std::string> apn{}; std::optional<std::string> apn{};
......
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