Commit 9684b8f5 authored by aligungr's avatar aligungr

RRC developments

parent 85da3bc4
......@@ -144,21 +144,13 @@ struct NwUeRlsToRrc : NtsMessage
{
enum PR
{
PLMN_SEARCH_RESPONSE,
SERVING_CELL_CHANGE,
RRC_PDU_DELIVERY,
RADIO_LINK_FAILURE
DOWNLINK_RRC_DELIVERY
} present;
// PLMN_SEARCH_RESPONSE
std::vector<UeCellMeasurement> measurements{};
// SERVING_CELL_CHANGE
UeCellInfo servingCell{};
// RRC_PDU_DELIVERY
// DOWNLINK_RRC_DELIVERY
int cellId{};
rrc::RrcChannel channel{};
OctetString pdu{};
OctetString pdu;
explicit NwUeRlsToRrc(PR present) : NtsMessage(NtsMessageType::UE_RLS_TO_RRC), present(present)
{
......
......@@ -8,6 +8,7 @@
#include "task.hpp"
#include <ue/rrc/task.hpp>
#include <utils/common.hpp>
#include <utils/constants.hpp>
......@@ -54,7 +55,11 @@ void UeRlsTask::onLoop()
break;
}
case NwUeRlsToRls::DOWNLINK_RRC: {
m_logger->debug("downlink rrc cellId[%d]", w->cellId);
auto *m = new NwUeRlsToRrc(NwUeRlsToRrc::DOWNLINK_RRC_DELIVERY);
m->cellId = w->cellId;
m->channel = w->rrcChannel;
m->pdu = std::move(w->data);
m_base->rrcTask->push(m);
break;
}
case NwUeRlsToRls::RADIO_LINK_FAILURE: {
......
......@@ -19,7 +19,7 @@
namespace nr::ue
{
void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rrcPdu)
void UeRrcTask::handleDownlinkRrc(int cellId, rrc::RrcChannel channel, const OctetString &rrcPdu)
{
switch (channel)
{
......@@ -28,7 +28,7 @@ void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rr
if (pdu == nullptr)
m_logger->err("RRC BCCH-BCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
receiveRrcMessage(cellId, pdu);
asn::Free(asn_DEF_ASN_RRC_BCCH_BCH_Message, pdu);
break;
}
......@@ -37,7 +37,7 @@ void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rr
if (pdu == nullptr)
m_logger->err("RRC BCCH-DL-SCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
receiveRrcMessage(cellId, pdu);
asn::Free(asn_DEF_ASN_RRC_BCCH_DL_SCH_Message, pdu);
break;
}
......@@ -46,7 +46,7 @@ void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rr
if (pdu == nullptr)
m_logger->err("RRC DL-CCCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
receiveRrcMessage(cellId, pdu);
asn::Free(asn_DEF_ASN_RRC_DL_CCCH_Message, pdu);
break;
}
......@@ -55,7 +55,7 @@ void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rr
if (pdu == nullptr)
m_logger->err("RRC DL-DCCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
receiveRrcMessage(cellId, pdu);
asn::Free(asn_DEF_ASN_RRC_DL_DCCH_Message, pdu);
break;
};
......@@ -64,7 +64,7 @@ void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rr
if (pdu == nullptr)
m_logger->err("RRC PCCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
receiveRrcMessage(cellId, pdu);
asn::Free(asn_DEF_ASN_RRC_PCCH_Message, pdu);
break;
}
......@@ -135,17 +135,17 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
m_base->rlsTask->push(nw);
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_BCCH_BCH_Message *msg)
void UeRrcTask::receiveRrcMessage(int, ASN_RRC_BCCH_BCH_Message *msg)
{
// TODO
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg)
void UeRrcTask::receiveRrcMessage(int, ASN_RRC_BCCH_DL_SCH_Message *msg)
{
// TODO
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_DL_CCCH_Message *msg)
void UeRrcTask::receiveRrcMessage(int, ASN_RRC_DL_CCCH_Message *msg)
{
if (msg->message.present != ASN_RRC_DL_CCCH_MessageType_PR_c1)
return;
......@@ -164,7 +164,7 @@ void UeRrcTask::receiveRrcMessage(ASN_RRC_DL_CCCH_Message *msg)
}
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_DL_DCCH_Message *msg)
void UeRrcTask::receiveRrcMessage(int, ASN_RRC_DL_DCCH_Message *msg)
{
if (msg->message.present != ASN_RRC_DL_DCCH_MessageType_PR_c1)
return;
......@@ -183,7 +183,7 @@ void UeRrcTask::receiveRrcMessage(ASN_RRC_DL_DCCH_Message *msg)
}
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_PCCH_Message *msg)
void UeRrcTask::receiveRrcMessage(int, ASN_RRC_PCCH_Message *msg)
{
if (msg->message.present != ASN_RRC_PCCH_MessageType_PR_c1)
return;
......
//
// 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/utils.hpp>
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
#include <ue/nts.hpp>
#include <utils/common.hpp>
namespace nr::ue
{
void UeRrcTask::handleRlsSapMessage(NwUeRlsToRrc &msg)
{
switch (msg.present)
{
case NwUeRlsToRrc::DOWNLINK_RRC_DELIVERY: {
handleDownlinkRrc(msg.cellId, msg.channel, msg.pdu);
break;
}
}
}
} // namespace nr::ue
\ No newline at end of file
......@@ -77,30 +77,7 @@ void UeRrcTask::onLoop()
break;
}
case NtsMessageType::UE_RLS_TO_RRC: {
auto *w = dynamic_cast<NwUeRlsToRrc *>(msg);
switch (w->present)
{
case NwUeRlsToRrc::PLMN_SEARCH_RESPONSE: {
auto *wr = new NwUeRrcToNas(NwUeRrcToNas::PLMN_SEARCH_RESPONSE);
wr->measurements = std::move(w->measurements);
m_base->nasTask->push(wr);
break;
}
case NwUeRlsToRrc::SERVING_CELL_CHANGE: {
auto *wr = new NwUeRrcToNas(NwUeRrcToNas::SERVING_CELL_CHANGE);
wr->servingCell = w->servingCell;
m_base->nasTask->push(wr);
break;
}
case NwUeRlsToRrc::RRC_PDU_DELIVERY: {
handleDownlinkRrc(w->channel, w->pdu);
break;
}
case NwUeRlsToRrc::RADIO_LINK_FAILURE: {
handleRadioLinkFailure();
break;
}
}
handleRlsSapMessage(*dynamic_cast<NwUeRlsToRrc *>(msg));
break;
}
default:
......
......@@ -66,7 +66,7 @@ class UeRrcTask : public NtsTask
private:
/* Handlers */
void handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &pdu);
void handleDownlinkRrc(int cellId, rrc::RrcChannel channel, const OctetString &pdu);
void deliverInitialNas(OctetString &&nasPdu, long establishmentCause);
void deliverUplinkNas(OctetString &&nasPdu);
......@@ -78,18 +78,19 @@ class UeRrcTask : public NtsTask
void handleRadioLinkFailure();
/* RRC channel send message */
/* RRC send and receive message */
void sendRrcMessage(ASN_RRC_BCCH_BCH_Message *msg);
void sendRrcMessage(ASN_RRC_UL_CCCH_Message *msg);
void sendRrcMessage(ASN_RRC_UL_CCCH1_Message *msg);
void sendRrcMessage(ASN_RRC_UL_DCCH_Message *msg);
/* RRC channel receive message */
void receiveRrcMessage(ASN_RRC_BCCH_BCH_Message *msg);
void receiveRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg);
void receiveRrcMessage(ASN_RRC_DL_CCCH_Message *msg);
void receiveRrcMessage(ASN_RRC_DL_DCCH_Message *msg);
void receiveRrcMessage(ASN_RRC_PCCH_Message *msg);
void receiveRrcMessage(int, ASN_RRC_BCCH_BCH_Message *msg);
void receiveRrcMessage(int, ASN_RRC_BCCH_DL_SCH_Message *msg);
void receiveRrcMessage(int, ASN_RRC_DL_CCCH_Message *msg);
void receiveRrcMessage(int, ASN_RRC_DL_DCCH_Message *msg);
void receiveRrcMessage(int, ASN_RRC_PCCH_Message *msg);
/* RLS Service Access Point */
void handleRlsSapMessage(NwUeRlsToRrc &msg);
};
} // namespace nr::ue
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