Commit 5938236d authored by aligungr's avatar aligungr

Service Request on uplink data pending

parent 069fb23c
......@@ -10,6 +10,8 @@
#include <utils/common.hpp>
static constexpr const int64_t SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD = 1000;
namespace nr::ue
{
......@@ -76,4 +78,16 @@ bool NasMm::isRegisteredForEmergency()
return isRegistered() && m_registeredForEmergency;
}
void NasMm::serviceNeededForUplinkData()
{
auto currentTime = utils::CurrentTimeMillis();
if (currentTime - m_lastTimeServiceReqNeededIndForData <= SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD)
{
sendServiceRequest(m_cmState == ECmState::CM_CONNECTED ? EServiceReqCause::CONNECTED_UPLINK_DATA_PENDING
: EServiceReqCause::IDLE_UPLINK_DATA_PENDING);
m_lastTimeServiceReqNeededIndForData = currentTime;
}
}
} // namespace nr::ue
......@@ -56,6 +56,8 @@ class NasMm
bool m_registeredForEmergency{};
// Network feature support information
nas::IE5gsNetworkFeatureSupport m_nwFeatureSupport{};
// Last time Service Request needed indication for Data
long m_lastTimeServiceReqNeededIndForData{};
friend class UeCmdHandler;
......@@ -173,6 +175,7 @@ class NasMm
void deliverUlTransport(const nas::UlNasTransport &msg); // used by SM
bool isRegistered(); // used by SM
bool isRegisteredForEmergency(); // used by SM
void serviceNeededForUplinkData(); // used by SM
};
} // namespace nr::ue
\ No newline at end of file
......@@ -11,6 +11,7 @@
#include <nas/proto_conf.hpp>
#include <nas/utils.hpp>
#include <ue/app/task.hpp>
#include <ue/nas/mm/mm.hpp>
namespace nr::ue
{
......@@ -64,7 +65,8 @@ void NasSm::handleUplinkStatusChange(int psi, bool isPending)
m_pduSessions[psi]->uplinkPending = isPending;
// TODO
if (isPending)
m_mm->serviceNeededForUplinkData();
}
bool NasSm::anyUplinkDataPending()
......
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