Commit d3623907 authored by aligungr's avatar aligungr

RRC paging handling

parent fee7dfd3
......@@ -28,42 +28,6 @@ void GnbRrcTask::handleUplinkRrc(int ueId, rrc::RrcChannel channel, const OctetS
asn::Free(asn_DEF_ASN_RRC_BCCH_BCH_Message, pdu);
break;
}
case rrc::RrcChannel::BCCH_DL_SCH: {
auto *pdu = rrc::encode::Decode<ASN_RRC_BCCH_DL_SCH_Message>(asn_DEF_ASN_RRC_BCCH_DL_SCH_Message, rrcPdu);
if (pdu == nullptr)
m_logger->err("RRC BCCH-DL-SCH PDU decoding failed.");
else
receiveRrcMessage(ueId, pdu);
asn::Free(asn_DEF_ASN_RRC_BCCH_DL_SCH_Message, pdu);
break;
}
case rrc::RrcChannel::DL_CCCH: {
auto *pdu = rrc::encode::Decode<ASN_RRC_DL_CCCH_Message>(asn_DEF_ASN_RRC_DL_CCCH_Message, rrcPdu);
if (pdu == nullptr)
m_logger->err("RRC DL-CCCH PDU decoding failed.");
else
receiveRrcMessage(ueId, pdu);
asn::Free(asn_DEF_ASN_RRC_DL_CCCH_Message, pdu);
break;
}
case rrc::RrcChannel::DL_DCCH: {
auto *pdu = rrc::encode::Decode<ASN_RRC_DL_DCCH_Message>(asn_DEF_ASN_RRC_DL_DCCH_Message, rrcPdu);
if (pdu == nullptr)
m_logger->err("RRC DL-DCCH PDU decoding failed.");
else
receiveRrcMessage(ueId, pdu);
asn::Free(asn_DEF_ASN_RRC_DL_DCCH_Message, pdu);
break;
}
case rrc::RrcChannel::PCCH: {
auto *pdu = rrc::encode::Decode<ASN_RRC_PCCH_Message>(asn_DEF_ASN_RRC_PCCH_Message, rrcPdu);
if (pdu == nullptr)
m_logger->err("RRC PCCH PDU decoding failed.");
else
receiveRrcMessage(ueId, pdu);
asn::Free(asn_DEF_ASN_RRC_PCCH_Message, pdu);
break;
}
case rrc::RrcChannel::UL_CCCH: {
auto *pdu = rrc::encode::Decode<ASN_RRC_UL_CCCH_Message>(asn_DEF_ASN_RRC_UL_CCCH_Message, rrcPdu);
if (pdu == nullptr)
......@@ -91,6 +55,11 @@ void GnbRrcTask::handleUplinkRrc(int ueId, rrc::RrcChannel channel, const OctetS
asn::Free(asn_DEF_ASN_RRC_UL_DCCH_Message, pdu);
break;
}
case rrc::RrcChannel::PCCH:
case rrc::RrcChannel::BCCH_DL_SCH:
case rrc::RrcChannel::DL_CCCH:
case rrc::RrcChannel::DL_DCCH:
break;
}
}
......@@ -158,7 +127,7 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_DL_DCCH_Message *msg)
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg)
void GnbRrcTask::sendRrcMessage(ASN_RRC_PCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_PCCH_Message, msg);
if (pdu.length() == 0)
......@@ -168,85 +137,17 @@ void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg)
}
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->ueId = 0;
w->channel = rrc::RrcChannel::PCCH;
w->pdu = std::move(pdu);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_CCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_UL_CCCH_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC UL-CCCH encoding failed.");
return;
}
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::UL_CCCH;
w->pdu = std::move(pdu);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_CCCH1_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_UL_CCCH1_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC UL-CCCH1 encoding failed.");
return;
}
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::UL_CCCH1;
w->pdu = std::move(pdu);
m_base->rlsTask->push(w);
}
void GnbRrcTask::sendRrcMessage(int ueId, ASN_RRC_UL_DCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_UL_DCCH_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC UL-DCCH encoding failed.");
return;
}
auto *w = new NwGnbRrcToRls(NwGnbRrcToRls::RRC_PDU_DELIVERY);
w->ueId = ueId;
w->channel = rrc::RrcChannel::UL_DCCH;
w->pdu = std::move(pdu);
m_base->rlsTask->push(w);
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_BCCH_BCH_Message *msg)
{
// TODO
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_BCCH_DL_SCH_Message *msg)
{
// TODO
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_DL_CCCH_Message *msg)
{
// TODO
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_DL_DCCH_Message *msg)
{
// TODO
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg)
{
// TODO
}
void GnbRrcTask::receiveRrcMessage(int ueId, ASN_RRC_UL_CCCH_Message *msg)
{
if (msg->message.present != ASN_RRC_UL_CCCH_MessageType_PR_c1)
......
......@@ -19,6 +19,9 @@
#include <asn/rrc/ASN_RRC_DLInformationTransfer-IEs.h>
#include <asn/rrc/ASN_RRC_DLInformationTransfer.h>
#include <asn/rrc/ASN_RRC_PCCH-Message.h>
#include <asn/rrc/ASN_RRC_Paging.h>
#include <asn/rrc/ASN_RRC_PagingRecord.h>
#include <asn/rrc/ASN_RRC_PagingRecordList.h>
#include <asn/rrc/ASN_RRC_RRCRelease-IEs.h>
#include <asn/rrc/ASN_RRC_RRCRelease.h>
#include <asn/rrc/ASN_RRC_RRCSetup-IEs.h>
......@@ -169,10 +172,23 @@ void GnbRrcTask::handleRadioLinkFailure(int ueId)
m_ueCtx.erase(ueId);
}
void GnbRrcTask::handlePaging(const asn::Unique<ASN_NGAP_FiveG_S_TMSI> &tmsi,
const asn::Unique<ASN_NGAP_TAIListForPaging> &taiList)
void GnbRrcTask::handlePaging(const OctetString &tmsi, const asn::Unique<ASN_NGAP_TAIListForPaging> &taiList)
{
// TODO
// Construct and send a Paging message
auto *pdu = asn::New<ASN_RRC_PCCH_Message>();
pdu->message.present = ASN_RRC_PCCH_MessageType_PR_c1;
pdu->message.choice.c1 = asn::NewFor(pdu->message.choice.c1);
pdu->message.choice.c1->present = ASN_RRC_PCCH_MessageType__c1_PR_paging;
auto &paging = pdu->message.choice.c1->choice.paging = asn::New<ASN_RRC_Paging>();
auto *record = asn::New<ASN_RRC_PagingRecord>();
record->ue_Identity.present = ASN_RRC_PagingUE_Identity_PR_ng_5G_S_TMSI;
asn::SetBitString(record->ue_Identity.choice.ng_5G_S_TMSI, tmsi);
paging->pagingRecordList = asn::NewFor(paging->pagingRecordList);
asn::SequenceAdd(*paging->pagingRecordList, record);
sendRrcMessage(pdu);
}
} // namespace nr::gnb
\ No newline at end of file
......@@ -81,17 +81,10 @@ class GnbRrcTask : public NtsTask
void sendRrcMessage(int ueId, ASN_RRC_BCCH_DL_SCH_Message *msg);
void sendRrcMessage(int ueId, ASN_RRC_DL_CCCH_Message *msg);
void sendRrcMessage(int ueId, ASN_RRC_DL_DCCH_Message *msg);
void sendRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg);
void sendRrcMessage(int ueId, ASN_RRC_UL_CCCH_Message *msg);
void sendRrcMessage(int ueId, ASN_RRC_UL_CCCH1_Message *msg);
void sendRrcMessage(int ueId, ASN_RRC_UL_DCCH_Message *msg);
void sendRrcMessage(ASN_RRC_PCCH_Message *msg);
/* RRC channel receive message */
void receiveRrcMessage(int ueId, ASN_RRC_BCCH_BCH_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_BCCH_DL_SCH_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_DL_CCCH_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_DL_DCCH_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_PCCH_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_UL_CCCH_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_UL_CCCH1_Message *msg);
void receiveRrcMessage(int ueId, ASN_RRC_UL_DCCH_Message *msg);
......
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