Commit 9684b8f5 authored by aligungr's avatar aligungr

RRC developments

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