Commit 2dae5580 authored by aligungr's avatar aligungr

RRC developments

parent 5c09ed2b
...@@ -69,7 +69,7 @@ static ASN_RRC_BCCH_DL_SCH_Message *ConstructSib1Message(bool cellReserved, int ...@@ -69,7 +69,7 @@ static ASN_RRC_BCCH_DL_SCH_Message *ConstructSib1Message(bool cellReserved, int
plmnInfo->cellReservedForOperatorUse = cellReserved plmnInfo->cellReservedForOperatorUse = cellReserved
? ASN_RRC_PLMN_IdentityInfo__cellReservedForOperatorUse_reserved ? ASN_RRC_PLMN_IdentityInfo__cellReservedForOperatorUse_reserved
: ASN_RRC_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved; : ASN_RRC_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
plmnInfo->trackingAreaCode = asn::NewFor(plmnInfo->trackingAreaCode); asn::MakeNew(plmnInfo->trackingAreaCode);
asn::SetBitStringInt<24>(tac, *plmnInfo->trackingAreaCode); asn::SetBitStringInt<24>(tac, *plmnInfo->trackingAreaCode);
asn::SetBitStringLong<36>(nci, plmnInfo->cellIdentity); asn::SetBitStringLong<36>(nci, plmnInfo->cellIdentity);
asn::SequenceAdd(plmnInfo->plmn_IdentityList, asn::rrc::NewPlmnId(plmn)); asn::SequenceAdd(plmnInfo->plmn_IdentityList, asn::rrc::NewPlmnId(plmn));
......
...@@ -8,9 +8,13 @@ ...@@ -8,9 +8,13 @@
#include "rrc.hpp" #include "rrc.hpp"
#include <stdexcept>
#include <lib/asn/utils.hpp> #include <lib/asn/utils.hpp>
#include <asn/rrc/ASN_RRC_MCC-MNC-Digit.h>
#include <asn/rrc/ASN_RRC_MCC.h> #include <asn/rrc/ASN_RRC_MCC.h>
#include <asn/rrc/ASN_RRC_MNC.h>
namespace asn::rrc namespace asn::rrc
{ {
...@@ -48,4 +52,26 @@ ASN_RRC_MCC_MNC_Digit_t *NewMccMncDigit(int digit) ...@@ -48,4 +52,26 @@ ASN_RRC_MCC_MNC_Digit_t *NewMccMncDigit(int digit)
return value; return value;
} }
Plmn GetPlmnId(const ASN_RRC_PLMN_Identity &value)
{
if (value.mcc == nullptr)
throw std::runtime_error("");
Plmn plmn;
asn::ForeachItem(*value.mcc, [&plmn](auto &i) {
plmn.mcc *= 10;
plmn.mcc += static_cast<int>(i);
});
asn::ForeachItem(value.mnc, [&plmn](auto &i) {
plmn.mnc *= 10;
plmn.mnc += static_cast<int>(i);
});
plmn.isLongMnc = value.mnc.list.count == 3;
return plmn;
}
} // namespace asn::rrc } // namespace asn::rrc
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
// and subject to the terms and conditions defined in LICENSE file. // and subject to the terms and conditions defined in LICENSE file.
// //
#include <asn/rrc/ASN_RRC_PLMN-Identity.h>
#include <utils/common.hpp> #include <utils/common.hpp>
#include <asn/rrc/ASN_RRC_PLMN-Identity.h>
namespace asn::rrc namespace asn::rrc
{ {
...@@ -18,4 +19,6 @@ ASN_RRC_PLMN_Identity *NewPlmnId(const Plmn &plmn); ...@@ -18,4 +19,6 @@ ASN_RRC_PLMN_Identity *NewPlmnId(const Plmn &plmn);
ASN_RRC_MCC_MNC_Digit_t *NewMccMncDigit(int digit); ASN_RRC_MCC_MNC_Digit_t *NewMccMncDigit(int digit);
Plmn GetPlmnId(const ASN_RRC_PLMN_Identity& value);
} // namespace asn::rrc } // namespace asn::rrc
...@@ -8,14 +8,16 @@ ...@@ -8,14 +8,16 @@
#include "task.hpp" #include "task.hpp"
#include <lib/asn/rrc.hpp>
#include <lib/asn/utils.hpp> #include <lib/asn/utils.hpp>
#include <lib/rrc/encode.hpp> #include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp> #include <ue/nas/task.hpp>
#include <ue/nts.hpp>
#include <utils/common.hpp>
#include <asn/rrc/ASN_RRC_MIB.h> #include <asn/rrc/ASN_RRC_MIB.h>
#include <asn/rrc/ASN_RRC_PLMN-IdentityInfo.h>
#include <asn/rrc/ASN_RRC_PLMN-IdentityInfoList.h>
#include <asn/rrc/ASN_RRC_SIB1.h> #include <asn/rrc/ASN_RRC_SIB1.h>
#include <asn/rrc/ASN_RRC_UAC-BarringInfoSet.h>
namespace nr::ue namespace nr::ue
{ {
...@@ -24,17 +26,37 @@ void UeRrcTask::receiveMib(int cellId, const ASN_RRC_MIB &msg) ...@@ -24,17 +26,37 @@ void UeRrcTask::receiveMib(int cellId, const ASN_RRC_MIB &msg)
{ {
auto &desc = m_cellDesc[cellId]; auto &desc = m_cellDesc[cellId];
desc.isBarredByMib = msg.cellBarred == ASN_RRC_MIB__cellBarred_barred; desc.mib.isBarred = msg.cellBarred == ASN_RRC_MIB__cellBarred_barred;
desc.isIntraFreqReselectAllowed = msg.intraFreqReselection == ASN_RRC_MIB__intraFreqReselection_allowed; desc.mib.isIntraFreqReselectAllowed = msg.intraFreqReselection == ASN_RRC_MIB__intraFreqReselection_allowed;
} }
void UeRrcTask::receiveSib1(int cellId, const ASN_RRC_SIB1 &msg) void UeRrcTask::receiveSib1(int cellId, const ASN_RRC_SIB1 &msg)
{ {
auto &desc = m_cellDesc[cellId]; auto &desc = m_cellDesc[cellId];
desc.isReserved = msg.cellAccessRelatedInfo.cellReservedForOtherUse != nullptr; desc.sib1.isReserved = msg.cellAccessRelatedInfo.cellReservedForOtherUse != nullptr;
// TODO auto *plmnIdentityInfo = msg.cellAccessRelatedInfo.plmn_IdentityList.list.array[0];
desc.sib1.nci = asn::GetBitStringLong<36>(plmnIdentityInfo->cellIdentity);
desc.sib1.isReserved &=
plmnIdentityInfo->cellReservedForOperatorUse == ASN_RRC_PLMN_IdentityInfo__cellReservedForOperatorUse_reserved;
desc.sib1.tac = asn::GetBitStringInt<24>(*plmnIdentityInfo->trackingAreaCode);
auto plmnIdentity = plmnIdentityInfo->plmn_IdentityList.list.array[0];
desc.sib1.plmn = asn::rrc::GetPlmnId(*plmnIdentity);
auto *barringInfo = msg.uac_BarringInfo->uac_BarringInfoSetList.list.array[0];
int barringBits = asn::GetBitStringInt<7>(barringInfo->uac_BarringForAccessIdentity);
desc.sib1.aiBarringSet.ai15 = bits::BitAt<0>(barringBits);
desc.sib1.aiBarringSet.ai14 = bits::BitAt<1>(barringBits);
desc.sib1.aiBarringSet.ai13 = bits::BitAt<2>(barringBits);
desc.sib1.aiBarringSet.ai12 = bits::BitAt<3>(barringBits);
desc.sib1.aiBarringSet.ai11 = bits::BitAt<4>(barringBits);
desc.sib1.aiBarringSet.ai2 = bits::BitAt<5>(barringBits);
desc.sib1.aiBarringSet.ai1 = bits::BitAt<6>(barringBits);
} }
} // namespace nr::ue } // namespace nr::ue
\ No newline at end of file
...@@ -32,9 +32,23 @@ class UserEquipment; ...@@ -32,9 +32,23 @@ class UserEquipment;
struct UeCellDesc struct UeCellDesc
{ {
int dbm{}; int dbm{};
bool isBarredByMib = true;
bool isIntraFreqReselectAllowed = true; struct
bool isReserved = false; {
bool hasMib = false;
bool isBarred = true;
bool isIntraFreqReselectAllowed = true;
} mib{};
struct
{
bool hasSib1 = false;
bool isReserved = false;
int64_t nci = 0;
int tac = 0;
Plmn plmn;
UacAiBarringSet aiBarringSet;
} sib1{};
}; };
struct SupportedAlgs struct SupportedAlgs
......
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