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)
ps->sessionAmbr = {};
ps->authorizedQoSFlowDescriptions = {};
ps->pduAddress = {};
ps->uplinkPending = false;
/* Make PCO */
nas::ProtocolConfigurationOptions opt{};
......
......@@ -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
......@@ -61,6 +61,9 @@ bool NasSm::anyEmergencySession()
void NasSm::handleUplinkStatusChange(int psi, bool isPending)
{
m_logger->debug("Uplink data status changed PSI[%d] pending[%s]", psi, isPending ? "true" : "false");
m_pduSessions[psi]->uplinkPending = isPending;
// TODO
}
......
......@@ -9,6 +9,7 @@
#pragma once
#include <array>
#include <bitset>
#include <nas/nas.hpp>
#include <nas/timer.hpp>
#include <ue/nts.hpp>
......@@ -49,7 +50,9 @@ class NasSm
void localReleaseSession(int psi);
void localReleaseAllSessions();
bool anyEmergencySession();
void handleUplinkStatusChange(int psi, bool isPending);
void handleUplinkStatusChange(int psi, bool isPending);
bool anyUplinkDataPending();
std::bitset<16> getUplinkDataStatus();
/* Session Release */
void sendReleaseRequest(int psi);
......@@ -89,8 +92,8 @@ class NasSm
public:
/* Interface */
void handleNasEvent(const NwUeNasToNas &msg); // used by NAS
void onTimerTick(); // used by NAS
void handleNasEvent(const NwUeNasToNas &msg); // used by NAS
void onTimerTick(); // used by NAS
};
} // namespace nr::ue
\ No newline at end of file
......@@ -250,6 +250,7 @@ struct PduSession
const int psi;
EPsState psState{};
bool uplinkPending{};
nas::EPduSessionType sessionType{};
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