Commit 510cbb63 authored by aligungr's avatar aligungr

RRC developments

parent 0bcefde1
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include "task.hpp"
#include <lib/asn/rrc.hpp>
#include <lib/asn/utils.hpp>
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
namespace nr::ue
{
void UeRrcTask::performCycle()
{
// TODO
}
} // namespace nr::ue
\ No newline at end of file
......@@ -17,6 +17,9 @@
#include <ue/rls/task.hpp>
#include <utils/common.hpp>
static constexpr const int TIMER_ID_MACHINE_CYCLE = 1;
static constexpr const int TIMER_PERIOD_MACHINE_CYCLE = 2500;
namespace nr::ue
{
......@@ -29,6 +32,7 @@ UeRrcTask::UeRrcTask(TaskBase *base) : m_base{base}
void UeRrcTask::onStart()
{
setTimer(TIMER_ID_MACHINE_CYCLE, TIMER_PERIOD_MACHINE_CYCLE);
}
void UeRrcTask::onQuit()
......@@ -69,6 +73,15 @@ void UeRrcTask::onLoop()
handleRlsSapMessage(*dynamic_cast<NwUeRlsToRrc *>(msg));
break;
}
case NtsMessageType::TIMER_EXPIRED: {
auto *w = dynamic_cast<NwTimerExpired *>(msg);
if (w->timerId == TIMER_ID_MACHINE_CYCLE)
{
setTimer(TIMER_ID_MACHINE_CYCLE, TIMER_PERIOD_MACHINE_CYCLE);
performCycle();
}
break;
}
default:
m_logger->unhandledNts(msg);
break;
......
......@@ -97,6 +97,9 @@ class UeRrcTask : public NtsTask
/* RLS Service Access Point */
void handleRlsSapMessage(NwUeRlsToRrc &msg);
/* State Management */
void performCycle();
/* Cell Management */
void handleCellSignalChange(int cellId, int dbm);
void notifyCellDetected(int cellId, int dbm);
......
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