Commit 4581a722 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Refactor TAI/TAC

parent 0344ddc8
......@@ -80,5 +80,6 @@ class conv {
const std::string& str, OCTET_STRING_t& o_str);
static bool int8_2_octet_string(const uint8_t& value, OCTET_STRING_t& o_str);
static bool octet_string_2_int8(const OCTET_STRING_t& o_str, uint8_t& value);
// TODO: bitstring_2_int32
};
#endif /* FILE_CONVERSIONS_HPP_SEEN */
......@@ -86,7 +86,7 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
(Ngap_TAIListForInactiveItem_t*) calloc(
1, sizeof(Ngap_TAIListForInactiveItem_t));
if (!taiListForInactiveItem) return false;
if (!it->encode2TAI(&taiListForInactiveItem->tAI)) return false;
if (!it->encode(&taiListForInactiveItem->tAI)) return false;
if (ASN_SEQUENCE_ADD(
&coreNetworkAssistanceInformation->tAIListForInactive.list,
taiListForInactiveItem) != 0)
......@@ -129,7 +129,7 @@ bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
i < coreNetworkAssistanceInformation->tAIListForInactive.list.count;
i++) {
TAI tai_item = {};
if (!tai_item.decodefromTAI(
if (!tai_item.decode(
&coreNetworkAssistanceInformation->tAIListForInactive.list.array[i]
->tAI))
return false;
......
......@@ -21,51 +21,39 @@
#include "EUTRA-CGI.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
EUTRA_CGI::EUTRA_CGI() {
plmnId = NULL;
eUTRACellIdentity = NULL;
}
EUTRA_CGI::EUTRA_CGI() {}
//------------------------------------------------------------------------------
EUTRA_CGI::~EUTRA_CGI() {}
//------------------------------------------------------------------------------
void EUTRA_CGI::setEUTRA_CGI(
PlmnId* m_plmnId, EUTRACellIdentity* m_eUTRACellIdentity) {
plmnId = m_plmnId;
eUTRACellIdentity = m_eUTRACellIdentity;
void EUTRA_CGI::set(
const PlmnId& plmn_id, const EUTRACellIdentity& eUTRA_cell_identity) {
plmn_id_ = plmn_id;
eUTRA_cell_identity_ = eUTRA_cell_identity;
}
//------------------------------------------------------------------------------
bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t* eutra_cgi) {
if (!plmnId->encode(eutra_cgi->pLMNIdentity)) return false;
if (!eUTRACellIdentity->encode2bitstring(eutra_cgi->eUTRACellIdentity))
return false;
bool EUTRA_CGI::encode(Ngap_EUTRA_CGI_t& eutra_cgi) {
if (!plmn_id_.encode(eutra_cgi.pLMNIdentity)) return false;
if (!eUTRA_cell_identity_.encode(eutra_cgi.eUTRACellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t* eutra_cgi) {
if (plmnId == nullptr) plmnId = new PlmnId();
if (eUTRACellIdentity == nullptr) eUTRACellIdentity = new EUTRACellIdentity();
if (!plmnId->decode(eutra_cgi->pLMNIdentity)) return false;
if (!eUTRACellIdentity->decodefrombitstring(eutra_cgi->eUTRACellIdentity))
return false;
bool EUTRA_CGI::decode(Ngap_EUTRA_CGI_t& eutra_cgi) {
if (!plmn_id_.decode(eutra_cgi.pLMNIdentity)) return false;
if (!eUTRA_cell_identity_.decode(eutra_cgi.eUTRACellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
void EUTRA_CGI::getEUTRA_CGI(
PlmnId*& m_plmnId, EUTRACellIdentity*& m_eUTRACellIdentity) {
m_plmnId = plmnId;
m_eUTRACellIdentity = eUTRACellIdentity;
void EUTRA_CGI::get(PlmnId& plmn_id, EUTRACellIdentity& eUTRA_cell_identity) {
plmn_id = plmn_id_;
eUTRA_cell_identity = eUTRA_cell_identity_;
}
} // namespace ngap
......@@ -36,14 +36,15 @@ class EUTRA_CGI {
EUTRA_CGI();
virtual ~EUTRA_CGI();
void setEUTRA_CGI(PlmnId*, EUTRACellIdentity*);
bool encode2EUTRA_CGI(Ngap_EUTRA_CGI_t*);
bool decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t*);
void getEUTRA_CGI(PlmnId*&, EUTRACellIdentity*&);
void set(const PlmnId&, const EUTRACellIdentity&);
void get(PlmnId&, EUTRACellIdentity&);
bool encode(Ngap_EUTRA_CGI_t&);
bool decode(Ngap_EUTRA_CGI_t&);
private:
PlmnId* plmnId;
EUTRACellIdentity* eUTRACellIdentity;
PlmnId plmn_id_; // Mandatory
EUTRACellIdentity eUTRA_cell_identity_; // Mandatory
};
} // namespace ngap
......
......@@ -28,47 +28,47 @@ namespace ngap {
//------------------------------------------------------------------------------
EUTRACellIdentity::EUTRACellIdentity() {
eutracellidentity = 0;
id_ = 0;
}
//------------------------------------------------------------------------------
EUTRACellIdentity::~EUTRACellIdentity() {}
//------------------------------------------------------------------------------
void EUTRACellIdentity::setEUTRACellIdentity(uint32_t m_eutracellidentity) {
eutracellidentity = m_eutracellidentity;
bool EUTRACellIdentity::set(const uint32_t& id) {
if (id > kEUTRACellIdentityMaxValue) return false;
id_ = id;
return true;
}
//------------------------------------------------------------------------------
bool EUTRACellIdentity::encode2bitstring(
Ngap_EUTRACellIdentity_t& eUTRACellIdentity) {
eUTRACellIdentity.bits_unused = 4;
eUTRACellIdentity.size = 4;
eUTRACellIdentity.buf = (uint8_t*) calloc(1, sizeof(uint32_t));
if (!eUTRACellIdentity.buf) return false;
eUTRACellIdentity.buf[3] = eutracellidentity & 0x000000ff;
eUTRACellIdentity.buf[2] = (eutracellidentity & 0x0000ff00) >> 8;
eUTRACellIdentity.buf[1] = (eutracellidentity & 0x00ff0000) >> 16;
eUTRACellIdentity.buf[0] = (eutracellidentity & 0xff000000) >> 24;
return true;
uint32_t EUTRACellIdentity::get() {
return id_;
}
//------------------------------------------------------------------------------
bool EUTRACellIdentity::decodefrombitstring(
Ngap_EUTRACellIdentity_t& eUTRACellIdentity) {
if (!eUTRACellIdentity.buf) return false;
eutracellidentity = eUTRACellIdentity.buf[0] << 24;
eutracellidentity |= eUTRACellIdentity.buf[1] << 16;
eutracellidentity |= eUTRACellIdentity.buf[2] << 8;
eutracellidentity |= eUTRACellIdentity.buf[3];
bool EUTRACellIdentity::encode(Ngap_EUTRACellIdentity_t& eUTRA_cell_identity) {
eUTRA_cell_identity.bits_unused = 4; // 28 = 4*8 - 4 bits
eUTRA_cell_identity.size = 4;
eUTRA_cell_identity.buf = (uint8_t*) calloc(1, sizeof(uint32_t));
if (!eUTRA_cell_identity.buf) return false;
eUTRA_cell_identity.buf[3] = id_ & 0x000000ff;
eUTRA_cell_identity.buf[2] = (id_ & 0x0000ff00) >> 8;
eUTRA_cell_identity.buf[1] = (id_ & 0x00ff0000) >> 16;
eUTRA_cell_identity.buf[0] = (id_ & 0xff000000) >> 24;
return true;
}
//------------------------------------------------------------------------------
uint32_t EUTRACellIdentity::getEUTRACellIdentity() {
return eutracellidentity;
bool EUTRACellIdentity::decode(Ngap_EUTRACellIdentity_t& eUTRA_cell_identity) {
if (!eUTRA_cell_identity.buf) return false;
id_ = eUTRA_cell_identity.buf[0] << 24;
id_ |= eUTRA_cell_identity.buf[1] << 16;
id_ |= eUTRA_cell_identity.buf[2] << 8;
id_ |= eUTRA_cell_identity.buf[3];
return true;
}
} // namespace ngap
......@@ -21,6 +21,9 @@
#ifndef _EUTRACellIdentity_H_
#define _EUTRACellIdentity_H_
#include <cstdint>
constexpr uint32_t kEUTRACellIdentityMaxValue = 268435455; // 2^28-1
extern "C" {
#include "Ngap_EUTRACellIdentity.h"
......@@ -33,13 +36,13 @@ class EUTRACellIdentity {
EUTRACellIdentity();
virtual ~EUTRACellIdentity();
bool encode2bitstring(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
bool decodefrombitstring(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
uint32_t getEUTRACellIdentity();
void setEUTRACellIdentity(uint32_t m_eutracellidentity);
bool encode(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
bool decode(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
uint32_t get();
bool set(const uint32_t& m_eutracellidentity);
private:
uint32_t eutracellidentity;
uint32_t id_;
};
} // namespace ngap
......
......@@ -64,7 +64,7 @@ void SupportedTaItem::getBroadcastPlmnList(
//------------------------------------------------------------------------------
bool SupportedTaItem::encode2SupportedTaItem(Ngap_SupportedTAItem_t* ta) {
if (!tac.encode2octetstring(ta->tAC)) return false;
if (!tac.encode(ta->tAC)) return false;
for (std::vector<BroadcastPLMNItem>::iterator it =
std::begin(broadcastPLMNList);
......@@ -80,7 +80,7 @@ bool SupportedTaItem::encode2SupportedTaItem(Ngap_SupportedTAItem_t* ta) {
//------------------------------------------------------------------------------
bool SupportedTaItem::decodefromSupportedTaItem(Ngap_SupportedTAItem_t* pdu) {
if (!tac.decodefromoctetstring(pdu->tAC)) return false;
if (!tac.decode(pdu->tAC)) return false;
for (int i = 0; i < pdu->broadcastPLMNList.list.count; i++) {
BroadcastPLMNItem item = {};
if (!item.decodefromBroadcastPLMNItem(pdu->broadcastPLMNList.list.array[i]))
......
......@@ -30,56 +30,56 @@ TAI::TAI() {}
TAI::~TAI() {}
//------------------------------------------------------------------------------
void TAI::setTAI(const PlmnId& m_plmnId, const TAC& m_tac) {
plmnId = m_plmnId;
tac = m_tac;
void TAI::setTAI(const PlmnId& plmn_id, const TAC& tac) {
plmn_id_ = plmn_id;
tac_ = tac;
}
//------------------------------------------------------------------------------
void TAI::setTAI(
const std::string& mcc, const std::string& mnc, const uint32_t& m_tac) {
plmnId.set(mcc, mnc);
tac.setTac(m_tac);
const std::string& mcc, const std::string& mnc, const uint32_t& tac) {
plmn_id_.set(mcc, mnc);
tac_.set(tac);
}
//------------------------------------------------------------------------------
void TAI::getTAI(std::string& mcc, std::string& mnc, uint32_t& m_tac) {
plmnId.getMcc(mcc);
plmnId.getMnc(mnc);
m_tac = tac.getTac();
void TAI::getTAI(std::string& mcc, std::string& mnc, uint32_t& tac) {
plmn_id_.getMcc(mcc);
plmn_id_.getMnc(mnc);
tac = tac_.get();
}
//------------------------------------------------------------------------------
void TAI::setTAI(const Tai_t& tai) {
plmnId.set(tai.mcc, tai.mnc);
tac.setTac(tai.tac);
plmn_id_.set(tai.mcc, tai.mnc);
tac_.set(tai.tac);
}
//------------------------------------------------------------------------------
bool TAI::encode2TAI(Ngap_TAI_t* tai) {
if (!plmnId.encode(tai->pLMNIdentity)) return false;
if (!tac.encode2octetstring(tai->tAC)) return false;
bool TAI::encode(Ngap_TAI_t* tai) {
if (!plmn_id_.encode(tai->pLMNIdentity)) return false;
if (!tac_.encode(tai->tAC)) return false;
return true;
}
//------------------------------------------------------------------------------
bool TAI::decodefromTAI(Ngap_TAI_t* tai) {
if (!plmnId.decode(tai->pLMNIdentity)) return false;
if (!tac.decodefromoctetstring(tai->tAC)) return false;
bool TAI::decode(Ngap_TAI_t* tai) {
if (!plmn_id_.decode(tai->pLMNIdentity)) return false;
if (!tac_.decode(tai->tAC)) return false;
return true;
}
//------------------------------------------------------------------------------
void TAI::getTAI(PlmnId& m_plmnId, TAC& m_tac) {
m_plmnId = plmnId;
m_tac = tac;
void TAI::getTAI(PlmnId& plmn_id, TAC& tac) {
plmn_id = plmn_id_;
tac = tac_;
}
//------------------------------------------------------------------------------
void TAI::getTAI(Tai_t& tai) {
plmnId.getMcc(tai.mcc);
plmnId.getMnc(tai.mnc);
tai.tac = tac.getTac();
plmn_id_.getMcc(tai.mcc);
plmn_id_.getMnc(tai.mnc);
tai.tac = tac_.get();
}
} // namespace ngap
......@@ -38,6 +38,8 @@ class TAI {
virtual ~TAI();
void setTAI(const PlmnId&, const TAC&);
void getTAI(PlmnId&, TAC&);
void setTAI(
const std::string& mcc, const std::string& mnc, const uint32_t& tac);
void getTAI(std::string& mcc, std::string& mnc, uint32_t& tac);
......@@ -45,13 +47,12 @@ class TAI {
void setTAI(const Tai_t& tai);
void getTAI(Tai_t& tai);
bool encode2TAI(Ngap_TAI_t*);
bool decodefromTAI(Ngap_TAI_t*);
void getTAI(PlmnId&, TAC&);
bool encode(Ngap_TAI_t*);
bool decode(Ngap_TAI_t*);
private:
PlmnId plmnId; // Mandatory
TAC tac; // Mandatory
PlmnId plmn_id_; // Mandatory
TAC tac_; // Mandatory
};
} // namespace ngap
......
......@@ -47,7 +47,7 @@ bool TAIListForPaging::encode2TAIListForPaging(Ngap_TAIListForPaging_t* pdu) {
for (auto& tai : taiList) {
Ngap_TAIListForPagingItem_t* ta = (Ngap_TAIListForPagingItem_t*) calloc(
1, sizeof(Ngap_TAIListForPagingItem_t));
if (!tai.encode2TAI(&ta->tAI)) return false;
if (!tai.encode(&ta->tAI)) return false;
if (ASN_SEQUENCE_ADD(&pdu->list, ta) != 0) return false;
}
return true;
......@@ -59,7 +59,7 @@ bool TAIListForPaging::decodefromTAIListForPaging(
if (pdu->list.count < 0) return false;
for (int i = 0; i < pdu->list.count; i++) {
TAI tai = {};
if (!tai.decodefromTAI(&pdu->list.array[i]->tAI)) return false;
if (!tai.decode(&pdu->list.array[i]->tAI)) return false;
taiList.push_back(tai);
}
......
......@@ -20,48 +20,48 @@
*/
#include "Tac.hpp"
#include "logger.hpp"
#include <iostream>
namespace ngap {
//------------------------------------------------------------------------------
TAC::TAC() {
tac = 0;
tac_ = 0;
}
//------------------------------------------------------------------------------
TAC::~TAC() {}
//------------------------------------------------------------------------------
void TAC::setTac(uint32_t m_tac) {
tac = m_tac;
void TAC::set(const uint32_t& tac) {
tac_ = tac;
}
//------------------------------------------------------------------------------
bool TAC::encode2octetstring(Ngap_TAC_t& m_tac) {
m_tac.size = 3; // OCTET_STRING(SIZE(3))
m_tac.buf = (uint8_t*) calloc(1, sizeof(uint8_t) + sizeof(uint16_t));
m_tac.buf[2] = tac & 0x0000ff;
m_tac.buf[1] = (tac & 0x00ff00) >> 8;
m_tac.buf[0] = (tac & 0xff0000) >> 16;
return true;
uint32_t TAC::get() const {
return tac_;
}
//------------------------------------------------------------------------------
bool TAC::decodefromoctetstring(Ngap_TAC_t& m_tac) {
if (!m_tac.buf) return false;
tac = 0;
for (int i = 0; i < m_tac.size; i++) {
tac |= m_tac.buf[i] << ((m_tac.size - 1 - i) * 8);
}
std::cout << "Received TAC: " << tac << std::endl;
bool TAC::encode(Ngap_TAC_t& tac) {
tac.size = 3; // OCTET_STRING(SIZE(3))
tac.buf = (uint8_t*) calloc(3, sizeof(uint8_t));
tac.buf[2] = tac_ & 0x0000ff;
tac.buf[1] = (tac_ & 0x00ff00) >> 8;
tac.buf[0] = (tac_ & 0xff0000) >> 16;
return true;
}
//------------------------------------------------------------------------------
uint32_t TAC::getTac() {
return tac;
bool TAC::decode(Ngap_TAC_t& tac) {
if (!tac.buf) return false;
tac_ = 0;
for (int i = 0; i < tac.size; i++) {
tac_ |= tac.buf[i] << ((tac.size - 1 - i) * 8);
}
Logger::ngap().debug("Received TAC 0x%x", tac_);
return true;
}
} // namespace ngap
......@@ -33,14 +33,14 @@ class TAC {
TAC();
virtual ~TAC();
uint32_t getTac();
void setTac(uint32_t m_tac);
uint32_t get() const;
void set(const uint32_t& tac);
bool encode2octetstring(Ngap_TAC_t&);
bool decodefromoctetstring(Ngap_TAC_t& m_tac);
bool encode(Ngap_TAC_t&);
bool decode(Ngap_TAC_t& m_tac);
private:
uint32_t tac : 24;
uint32_t tac_ : 24;
};
} // namespace ngap
......
......@@ -20,49 +20,32 @@
*/
#include "UserLocationInformationEUTRA.hpp"
#include <iostream>
using namespace std;
#include "logger.hpp"
namespace ngap {
//------------------------------------------------------------------------------
UserLocationInformationEUTRA::UserLocationInformationEUTRA() {
eUTRA_CGI = NULL;
tAI = NULL;
/*istimeStampSet = false;
timeStamp = NULL;*/
}
UserLocationInformationEUTRA::UserLocationInformationEUTRA() {}
//------------------------------------------------------------------------------
UserLocationInformationEUTRA::~UserLocationInformationEUTRA() {}
//------------------------------------------------------------------------------
void UserLocationInformationEUTRA::setInformationEUTRA(
EUTRA_CGI* m_eUTRA_CGI, TAI* m_tAI) {
const EUTRA_CGI& m_eUTRA_CGI, const TAI& m_tAI) {
eUTRA_CGI = m_eUTRA_CGI;
tAI = m_tAI;
}
//------------------------------------------------------------------------------
/*void UserLocationInformationEUTRA::setInformationEUTRA(EUTRA_CGI*
m_eUTRA_CGI,TAI* m_tAI,TimeStamp* m_timeStamp)
{
eUTRA_CGI = m_eUTRA_CGI;
tAI = m_tAI;
istimeStampSet = true;
timeStamp = m_timeStamp;
}*/
//------------------------------------------------------------------------------
bool UserLocationInformationEUTRA::encode2UserLocationInformationEUTRA(
Ngap_UserLocationInformationEUTRA_t* userLocationInformationEUTRA) {
if (!eUTRA_CGI->encode2EUTRA_CGI(&userLocationInformationEUTRA->eUTRA_CGI)) {
cout << "[Warning] eUTRA_CGI->encode2EUTRA_CGI() error!" << endl;
if (!eUTRA_CGI.encode(userLocationInformationEUTRA->eUTRA_CGI)) {
Logger::ngap().warn("Encode eUTRA_CGI IE error");
return false;
}
if (!tAI->encode2TAI(&userLocationInformationEUTRA->tAI)) {
cout << "[Warning] tAI->encode2TAI() error!" << endl;
if (!tAI.encode(&userLocationInformationEUTRA->tAI)) {
Logger::ngap().warn("Encode TAI IE error");
return false;
}
#if 0
......@@ -84,15 +67,13 @@ bool UserLocationInformationEUTRA::encode2UserLocationInformationEUTRA(
//------------------------------------------------------------------------------
bool UserLocationInformationEUTRA::decodefromUserLocationInformationEUTRA(
Ngap_UserLocationInformationEUTRA_t* userLocationInformationEUTRA) {
if (eUTRA_CGI == nullptr) eUTRA_CGI = new EUTRA_CGI();
if (!eUTRA_CGI->decodefromEUTRA_CGI(
&userLocationInformationEUTRA->eUTRA_CGI)) {
cout << "[Warning] eUTRA_CGI->decodefromEUTRA_CGI() error!" << endl;
if (!eUTRA_CGI.decode(userLocationInformationEUTRA->eUTRA_CGI)) {
Logger::ngap().warn("Decode eUTRA_CGI IE error");
return false;
}
tAI = new TAI();
if (!tAI->decodefromTAI(&userLocationInformationEUTRA->tAI)) {
cout << "[Warning] tAI->decodefromTAI() error!" << endl;
if (!tAI.decode(&userLocationInformationEUTRA->tAI)) {
Logger::ngap().warn("Decode TAI IE error");
return false;
}
#if 0
......@@ -110,22 +91,9 @@ bool UserLocationInformationEUTRA::decodefromUserLocationInformationEUTRA(
return true;
}
//------------------------------------------------------------------------------
/*bool UserLocationInformationEUTRA::getTimeStampPresence()
{
return istimeStampSet;
}*/
/*void UserLocationInformationEUTRA::getInformationEUTRA(EUTRA_CGI*
&m_eUTRA_CGI,TAI* &m_tAI,TimeStamp* &m_timeStamp)
{
m_eUTRA_CGI = eUTRA_CGI;
m_tAI = tAI;
m_timeStamp = timeStamp;
}*/
//------------------------------------------------------------------------------
void UserLocationInformationEUTRA::getInformationEUTRA(
EUTRA_CGI*& m_eUTRA_CGI, TAI*& m_tAI) {
EUTRA_CGI& m_eUTRA_CGI, TAI& m_tAI) {
m_eUTRA_CGI = eUTRA_CGI;
m_tAI = tAI;
}
......
......@@ -36,23 +36,21 @@ class UserLocationInformationEUTRA {
UserLocationInformationEUTRA();
virtual ~UserLocationInformationEUTRA();
void setInformationEUTRA(EUTRA_CGI* m_eUTRA_CGI, TAI* m_tAI);
// void setInformationEUTRA(EUTRA_CGI* m_eUTRA_CGI,TAI* m_tAI,TimeStamp*
// m_timeStamp);
void setInformationEUTRA(const EUTRA_CGI& m_eUTRA_CGI, const TAI& m_tAI);
void getInformationEUTRA(EUTRA_CGI& m_eUTRA_CGI, TAI& m_tAI);
// bool getTimeStampPresence();
bool encode2UserLocationInformationEUTRA(
Ngap_UserLocationInformationEUTRA_t* userLocationInformation);
bool decodefromUserLocationInformationEUTRA(
Ngap_UserLocationInformationEUTRA_t* userLocationInformation);
// void getInformationEUTRA(EUTRA_CGI* &m_eUTRA_CGI,TAI* &m_tAI,TimeStamp*
// &m_timeStamp);
void getInformationEUTRA(EUTRA_CGI*& m_eUTRA_CGI, TAI*& m_tAI);
// bool getTimeStampPresence();
private:
EUTRA_CGI* eUTRA_CGI;
TAI* tAI;
// bool istimeStampSet;
// TimeStamp *timeStamp;
EUTRA_CGI eUTRA_CGI; // Mandatory
TAI tAI; // Mandatory
// TODO: TimeStamp *timeStamp; //Age of Location (Optional)
// TODO: NG-RAN CGI (PSCell Information) (Optional)
};
} // namespace ngap
......
......@@ -42,7 +42,7 @@ bool UserLocationInformationNR::encode2UserLocationInformationNR(
if (!nR_CGI.encode2NR_CGI(&userLocationInformationNR->nR_CGI)) {
return false;
}
if (!tAI.encode2TAI(&userLocationInformationNR->tAI)) {
if (!tAI.encode(&userLocationInformationNR->tAI)) {
return false;
}
#if 0
......@@ -67,7 +67,7 @@ bool UserLocationInformationNR::decodefromUserLocationInformationNR(
return false;
}
if (!tAI.decodefromTAI(&userLocationInformationNR->tAI)) {
if (!tAI.decode(&userLocationInformationNR->tAI)) {
return false;
}
#if 0
......
......@@ -109,7 +109,7 @@ bool HandoverRequiredMsg::getTargetID(GlobalgNBId& gnbId, TAI& tai) {
Ngap_GlobalRANNodeID_PR_globalGNB_ID) {
gnbId.decode(
targetID.choice.targetRANNodeID->globalRANNodeID.choice.globalGNB_ID);
tai.decodefromTAI(&targetID.choice.targetRANNodeID->selectedTAI);
tai.decode(&targetID.choice.targetRANNodeID->selectedTAI);
return true;
}
}
......
......@@ -118,7 +118,7 @@ void NGSetupRequestMsg::setSupportedTAList(
for (int i = 0; i < list.size(); i++) {
SupportedTaItem item = {};
TAC tac = {};
tac.setTac(list[i].tac);
tac.set(list[i].tac);
item.setTac(tac);
std::vector<BroadcastPLMNItem> broadcastPlmnItems;
......@@ -329,7 +329,7 @@ bool NGSetupRequestMsg::getSupportedTAList(
it->getTac(tac);
SupportedItem_t supporteditem_data = {};
supporteditem_data.tac = tac.getTac();
supporteditem_data.tac = tac.get();
std::vector<BroadcastPLMNItem> broadcastPLMNItems;
it->getBroadcastPlmnList(broadcastPLMNItems);
......
......@@ -157,7 +157,7 @@ void PagingMsg::setTAIListForPaging(const std::vector<Tai_t>& list) {
for (int i = 0; i < list.size(); i++) {
TAI tai = {};
plmnid[i].set(list[i].mcc, list[i].mnc);
tac[i].setTac(list[i].tac);
tac[i].set(list[i].tac);
tai.setTAI(plmnid[i], tac[i]);
tailist.push_back(tai);
}
......
......@@ -146,7 +146,7 @@ void UEContextReleaseCompleteMsg::getUserLocationInfoNR(
plmnId.getMcc(tai.mcc);
plmnId.getMnc(tai.mnc);
tai.tac = tac.getTac() & 0x00ffffff;
tai.tac = tac.get() & 0x00ffffff;
}
}
......
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