Commit d2bf24c4 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent c7e88bc1
......@@ -54,7 +54,7 @@ static EMmState GetMmStateFromSubState(EMmSubState subState)
std::terminate();
}
NasMm::NasMm(TaskBase *base, NasTimers *timers) : m_base{base}, m_timers{timers}, m_sm{}, m_usim{}
NasMm::NasMm(TaskBase *base, NasTimers *timers) : m_base{base}, m_timers{timers}, m_sm{}, m_usim{}, m_procCtl{}
{
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "nas");
......
......@@ -37,6 +37,8 @@ class NasMm
EMmState m_mmState;
EMmSubState m_mmSubState;
// Procedure management
ProcControl m_procCtl;
// Most recent registration request
std::unique_ptr<nas::RegistrationRequest> m_lastRegistrationRequest{};
// Most recent service request
......@@ -57,8 +59,6 @@ class NasMm
bool m_registeredForEmergency{};
// Network feature support information
nas::IE5gsNetworkFeatureSupport m_nwFeatureSupport{};
// Last time Service Request needed indication for Data
int64_t m_lastTimeServiceReqNeededIndForData{};
// Number of times the network failing the authentication check
int m_nwConsecutiveAuthFailure{};
// Last time PLMN search failure logged
......
......@@ -21,53 +21,39 @@ namespace nr::ue
void NasMm::initialRegistrationRequired(EInitialRegCause cause)
{
// TODO
m_procCtl.initialRegistration = cause;
triggerMmCycle();
}
void NasMm::mobilityUpdatingRequired(ERegUpdateCause cause)
{
// TODO
m_procCtl.mobilityRegistration = cause;
triggerMmCycle();
// TODO: "the periodic registration update procedure is delayed until the UE returns to
// 5GMM-REGISTERED.NORMAL-SERVICE over 3GPP access." See 5.3.7
triggerMmCycle();
}
void NasMm::serviceRequestRequiredForSignalling()
{
// TODO
serviceRequestRequired(EServiceReqCause::IDLE_UPLINK_SIGNAL_PENDING);
}
void NasMm::serviceRequestRequiredForData()
{
static constexpr const int64_t SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD = 1000;
auto currentTime = utils::CurrentTimeMillis();
if (currentTime - m_lastTimeServiceReqNeededIndForData > SERVICE_REQUEST_NEEDED_FOR_DATA_THRESHOLD)
{
serviceRequestRequired(m_cmState == ECmState::CM_CONNECTED ? EServiceReqCause::CONNECTED_UPLINK_DATA_PENDING
: EServiceReqCause::IDLE_UPLINK_DATA_PENDING);
m_lastTimeServiceReqNeededIndForData = currentTime;
triggerMmCycle();
}
serviceRequestRequired(m_cmState == ECmState::CM_CONNECTED ? EServiceReqCause::CONNECTED_UPLINK_DATA_PENDING
: EServiceReqCause::IDLE_UPLINK_DATA_PENDING);
}
void NasMm::serviceRequestRequired(EServiceReqCause cause)
{
// TODO
m_procCtl.serviceRequest = cause;
triggerMmCycle();
}
void NasMm::deregistrationRequired(EDeregCause cause)
{
// TODO
m_procCtl.deregistration = cause;
triggerMmCycle();
}
......
......@@ -550,6 +550,14 @@ enum class EServiceReqCause
FALLBACK_INDICATION
};
struct ProcControl
{
std::optional<EInitialRegCause> initialRegistration{};
std::optional<ERegUpdateCause> mobilityRegistration{};
std::optional<EServiceReqCause> serviceRequest{};
std::optional<EDeregCause> deregistration{};
};
Json ToJson(const ECmState &state);
Json ToJson(const ERmState &state);
Json ToJson(const EMmState &state);
......
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