Commit 2a4de4ba authored by aligungr's avatar aligungr

UE RRC refactor

parent 0c9771a3
......@@ -68,34 +68,11 @@ void UeRrcTask::handleDownlinkRrc(rrc::RrcChannel channel, const OctetString &rr
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)
m_logger->err("RRC UL-CCCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
asn::Free(asn_DEF_ASN_RRC_UL_CCCH_Message, pdu);
break;
}
case rrc::RrcChannel::UL_CCCH1: {
auto *pdu = rrc::encode::Decode<ASN_RRC_UL_CCCH1_Message>(asn_DEF_ASN_RRC_UL_CCCH1_Message, rrcPdu);
if (pdu == nullptr)
m_logger->err("RRC UL-CCCH1 PDU decoding failed.");
else
receiveRrcMessage(pdu);
asn::Free(asn_DEF_ASN_RRC_UL_CCCH1_Message, pdu);
case rrc::RrcChannel::UL_CCCH:
case rrc::RrcChannel::UL_CCCH1:
case rrc::RrcChannel::UL_DCCH:
break;
}
case rrc::RrcChannel::UL_DCCH: {
auto *pdu = rrc::encode::Decode<ASN_RRC_UL_DCCH_Message>(asn_DEF_ASN_RRC_UL_DCCH_Message, rrcPdu);
if (pdu == nullptr)
m_logger->err("RRC UL-DCCH PDU decoding failed.");
else
receiveRrcMessage(pdu);
asn::Free(asn_DEF_ASN_RRC_UL_DCCH_Message, pdu);
break;
}
}
}
void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_BCH_Message *msg)
......@@ -113,66 +90,6 @@ void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_BCH_Message *msg)
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_BCCH_DL_SCH_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC BCCH-DL-SCH encoding failed.");
return;
}
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::BCCH_DL_SCH;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_DL_CCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_DL_CCCH_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC DL-CCCH encoding failed.");
return;
}
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::DL_CCCH;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_DL_DCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_DL_DCCH_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC DL-DCCH encoding failed.");
return;
}
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::DL_DCCH;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_PCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_PCCH_Message, msg);
if (pdu.length() == 0)
{
m_logger->err("RRC PCCH encoding failed.");
return;
}
auto *nw = new NwUeRrcToRls(NwUeRrcToRls::RRC_PDU_DELIVERY);
nw->channel = rrc::RrcChannel::PCCH;
nw->pdu = std::move(pdu);
m_base->rlsTask->push(nw);
}
void UeRrcTask::sendRrcMessage(ASN_RRC_UL_CCCH_Message *msg)
{
OctetString pdu = rrc::encode::EncodeS(asn_DEF_ASN_RRC_UL_CCCH_Message, msg);
......@@ -271,34 +188,4 @@ void UeRrcTask::receiveRrcMessage(ASN_RRC_PCCH_Message *msg)
// TODO
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_UL_CCCH_Message *msg)
{
if (msg->message.present != ASN_RRC_UL_CCCH_MessageType_PR_c1)
return;
auto &c1 = msg->message.choice.c1;
switch (c1->present)
{
case ASN_RRC_UL_CCCH_MessageType__c1_PR_NOTHING:
break;
case ASN_RRC_UL_CCCH_MessageType__c1_PR_rrcSetupRequest:
break; // todo
case ASN_RRC_UL_CCCH_MessageType__c1_PR_rrcResumeRequest:
break; // todo
case ASN_RRC_UL_CCCH_MessageType__c1_PR_rrcReestablishmentRequest:
break; // todo
case ASN_RRC_UL_CCCH_MessageType__c1_PR_rrcSystemInfoRequest:
break; // todo
}
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_UL_CCCH1_Message *msg)
{
// TODO
}
void UeRrcTask::receiveRrcMessage(ASN_RRC_UL_DCCH_Message *msg)
{
}
} // namespace nr::ue
......@@ -78,10 +78,6 @@ class UeRrcTask : public NtsTask
/* RRC channel send message */
void sendRrcMessage(ASN_RRC_BCCH_BCH_Message *msg);
void sendRrcMessage(ASN_RRC_BCCH_DL_SCH_Message *msg);
void sendRrcMessage(ASN_RRC_DL_CCCH_Message *msg);
void sendRrcMessage(ASN_RRC_DL_DCCH_Message *msg);
void sendRrcMessage(ASN_RRC_PCCH_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);
......@@ -92,9 +88,6 @@ class UeRrcTask : public NtsTask
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(ASN_RRC_UL_CCCH_Message *msg);
void receiveRrcMessage(ASN_RRC_UL_CCCH1_Message *msg);
void receiveRrcMessage(ASN_RRC_UL_DCCH_Message *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