added quant cfg parsing and addition to measCfg

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent b6b1dd1814
commit 35c9f02579

@ -57,6 +57,7 @@ struct report_cfg_eutra_s;
struct meas_obj_to_add_mod_s; struct meas_obj_to_add_mod_s;
struct report_cfg_to_add_mod_s; struct report_cfg_to_add_mod_s;
struct meas_id_to_add_mod_s; struct meas_id_to_add_mod_s;
struct quant_cfg_s;
} // namespace rrc } // namespace rrc
} // namespace asn1 } // namespace asn1
@ -123,6 +124,7 @@ bool operator==(const asn1::rrc::meas_obj_to_add_mod_s& lhs, const asn1::rrc::me
bool operator==(const asn1::rrc::report_cfg_eutra_s& lhs, const asn1::rrc::report_cfg_eutra_s& rhs); bool operator==(const asn1::rrc::report_cfg_eutra_s& lhs, const asn1::rrc::report_cfg_eutra_s& rhs);
bool operator==(const asn1::rrc::report_cfg_to_add_mod_s& lhs, const asn1::rrc::report_cfg_to_add_mod_s& rhs); bool operator==(const asn1::rrc::report_cfg_to_add_mod_s& lhs, const asn1::rrc::report_cfg_to_add_mod_s& rhs);
bool operator==(const asn1::rrc::meas_id_to_add_mod_s& lhs, const asn1::rrc::meas_id_to_add_mod_s& rhs); bool operator==(const asn1::rrc::meas_id_to_add_mod_s& lhs, const asn1::rrc::meas_id_to_add_mod_s& rhs);
bool operator==(const asn1::rrc::quant_cfg_s& lhs, const asn1::rrc::quant_cfg_s& rhs);
} // namespace rrc } // namespace rrc
} // namespace asn1 } // namespace asn1

@ -180,7 +180,6 @@ void to_asn1(asn1::rrc::rlc_cfg_c* asn1_type, const srslte::rlc_config_t& cfg)
// stays TM // stays TM
break; break;
} }
} }
/*************************** /***************************
@ -874,5 +873,19 @@ bool operator==(const meas_id_to_add_mod_s& lhs, const meas_id_to_add_mod_s& rhs
return lhs.meas_id == rhs.meas_id and lhs.meas_obj_id == rhs.meas_obj_id and lhs.report_cfg_id == rhs.report_cfg_id; return lhs.meas_id == rhs.meas_id and lhs.meas_obj_id == rhs.meas_obj_id and lhs.report_cfg_id == rhs.report_cfg_id;
} }
bool operator==(const asn1::rrc::quant_cfg_s& lhs, const asn1::rrc::quant_cfg_s& rhs)
{
if (lhs.ext or lhs.quant_cfg_geran_present or lhs.quant_cfg_utra_present or lhs.quant_cfg_cdma2000_present or
rhs.ext or rhs.quant_cfg_geran_present or rhs.quant_cfg_utra_present or rhs.quant_cfg_cdma2000_present) {
printf("[%d] quantCfg properties not supported\n", __LINE__);
return false;
}
return lhs.quant_cfg_eutra_present == rhs.quant_cfg_eutra_present and
lhs.quant_cfg_eutra.filt_coef_rsrp_present == rhs.quant_cfg_eutra.filt_coef_rsrp_present and
lhs.quant_cfg_eutra.filt_coef_rsrp == rhs.quant_cfg_eutra.filt_coef_rsrp and
lhs.quant_cfg_eutra.filt_coef_rsrq_present == rhs.quant_cfg_eutra.filt_coef_rsrq_present and
lhs.quant_cfg_eutra.filt_coef_rsrq == rhs.quant_cfg_eutra.filt_coef_rsrq;
}
} // namespace rrc } // namespace rrc
} // namespace asn1 } // namespace asn1

@ -43,6 +43,7 @@ public:
std::tuple<bool, meas_obj_t*, meas_cell_t*> add_cell_cfg(const meas_cell_cfg_t& cellcfg); std::tuple<bool, meas_obj_t*, meas_cell_t*> add_cell_cfg(const meas_cell_cfg_t& cellcfg);
report_cfg_t* add_report_cfg(const asn1::rrc::report_cfg_eutra_s& reportcfg); report_cfg_t* add_report_cfg(const asn1::rrc::report_cfg_eutra_s& reportcfg);
meas_id_t* add_measid_cfg(uint8_t measobjid, uint8_t repid); meas_id_t* add_measid_cfg(uint8_t measobjid, uint8_t repid);
asn1::rrc::quant_cfg_s* add_quant_cfg(const asn1::rrc::quant_cfg_eutra_s& quantcfg);
bool compute_diff_meas_cfg(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const; bool compute_diff_meas_cfg(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const;
void compute_diff_meas_objs(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const; void compute_diff_meas_objs(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const;
@ -51,6 +52,7 @@ public:
asn1::rrc::meas_obj_to_add_mod_s* added_obj) const; asn1::rrc::meas_obj_to_add_mod_s* added_obj) const;
void compute_diff_report_cfgs(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const; void compute_diff_report_cfgs(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const;
void compute_diff_meas_ids(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const; void compute_diff_meas_ids(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const;
void compute_diff_quant_cfg(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg_msg) const;
// getters // getters
const asn1::rrc::meas_obj_to_add_mod_list_l& meas_objs() const { return var_meas.meas_obj_list; } const asn1::rrc::meas_obj_to_add_mod_list_l& meas_objs() const { return var_meas.meas_obj_list; }

@ -26,10 +26,12 @@
#include "srslte/srslte.h" #include "srslte/srslte.h"
#define HANDLEPARSERCODE(cond) \ #define HANDLEPARSERCODE(cond) \
do { \
if ((cond) != 0) { \ if ((cond) != 0) { \
printf("[%d][%s()] Parser Error detected\n", __LINE__, __FUNCTION__); \ printf("[%d][%s()] Parser Error detected\n", __LINE__, __FUNCTION__); \
return -1; \ return -1; \
} } \
} while (0)
using namespace asn1::rrc; using namespace asn1::rrc;
@ -157,8 +159,8 @@ int field_carrier_freqs_info_list::parse(libconfig::Setting& root)
data->carrier_freqs_info_list[i].common_info.p_max_geran = p_max_geran; data->carrier_freqs_info_list[i].common_info.p_max_geran = p_max_geran;
} }
field_asn1_bitstring_number<asn1::fixed_bitstring<8>, uint8_t> ncc_permitted("ncc_permitted", field_asn1_bitstring_number<asn1::fixed_bitstring<8>, uint8_t> ncc_permitted(
&data->carrier_freqs_info_list[i].common_info.ncc_permitted); "ncc_permitted", &data->carrier_freqs_info_list[i].common_info.ncc_permitted);
if (ncc_permitted.parse(root[i])) { if (ncc_permitted.parse(root[i])) {
ERROR("Error parsing `ncc_permitted` in carrier_freqs_info_lsit=%d\n", i); ERROR("Error parsing `ncc_permitted` in carrier_freqs_info_lsit=%d\n", i);
return -1; return -1;
@ -220,12 +222,10 @@ int field_carrier_freqs_info_list::parse(libconfig::Setting& root)
} else { } else {
exp_l.resize(0); exp_l.resize(0);
} }
} }
return 0; return 0;
} }
int enb::parse_sib1(std::string filename, sib_type1_s* data) int enb::parse_sib1(std::string filename, sib_type1_s* data)
{ {
parser::section sib1("sib1"); parser::section sib1("sib1");
@ -288,8 +288,8 @@ int mbsfn_sf_cfg_list_parser::parse(Setting& root)
*enabled = true; *enabled = true;
mbsfn_list->resize(len); mbsfn_list->resize(len);
field_asn1_choice_number<mbsfn_sf_cfg_s::sf_alloc_c_> c("subframeAllocation", "subframeAllocationNumFrames", field_asn1_choice_number<mbsfn_sf_cfg_s::sf_alloc_c_> c(
&extract_sf_alloc, &(*mbsfn_list)[0].sf_alloc); "subframeAllocation", "subframeAllocationNumFrames", &extract_sf_alloc, &(*mbsfn_list)[0].sf_alloc);
c.parse(root["mbsfnSubframeConfigList"]); c.parse(root["mbsfnSubframeConfigList"]);
parser::field<uint8_t> f("radioframeAllocationOffset", &(*mbsfn_list)[0].radioframe_alloc_offset); parser::field<uint8_t> f("radioframeAllocationOffset", &(*mbsfn_list)[0].radioframe_alloc_offset);
@ -521,8 +521,8 @@ int enb::parse_sib3(std::string filename, sib_type3_s* data)
sib3.add_subsection(&resel_serving); sib3.add_subsection(&resel_serving);
sib_type3_s::cell_resel_serving_freq_info_s_* freqinfo = &data->cell_resel_serving_freq_info; sib_type3_s::cell_resel_serving_freq_info_s_* freqinfo = &data->cell_resel_serving_freq_info;
resel_serving.add_field(new parser::field<uint8>("s_non_intra_search", &freqinfo->s_non_intra_search, resel_serving.add_field(new parser::field<uint8>(
&freqinfo->s_non_intra_search_present)); "s_non_intra_search", &freqinfo->s_non_intra_search, &freqinfo->s_non_intra_search_present));
resel_serving.add_field(new parser::field<uint8>("thresh_serving_low", &freqinfo->thresh_serving_low)); resel_serving.add_field(new parser::field<uint8>("thresh_serving_low", &freqinfo->thresh_serving_low));
resel_serving.add_field(new parser::field<uint8>("cell_resel_prio", &freqinfo->cell_resel_prio)); resel_serving.add_field(new parser::field<uint8>("cell_resel_prio", &freqinfo->cell_resel_prio));
@ -535,8 +535,8 @@ int enb::parse_sib3(std::string filename, sib_type3_s* data)
intra_freq.add_field(new parser::field<int8>("p_max", &intrafreq->p_max, &intrafreq->p_max_present)); intra_freq.add_field(new parser::field<int8>("p_max", &intrafreq->p_max, &intrafreq->p_max_present));
intra_freq.add_field( intra_freq.add_field(
new parser::field<uint8>("s_intra_search", &intrafreq->s_intra_search, &intrafreq->s_intra_search_present)); new parser::field<uint8>("s_intra_search", &intrafreq->s_intra_search, &intrafreq->s_intra_search_present));
intra_freq.add_field(make_asn1_enum_number_parser("allowed_meas_bw", &intrafreq->allowed_meas_bw, intra_freq.add_field(make_asn1_enum_number_parser(
&intrafreq->allowed_meas_bw_present)); "allowed_meas_bw", &intrafreq->allowed_meas_bw, &intrafreq->allowed_meas_bw_present));
intra_freq.add_field(new parser::field<bool>("presence_ant_port_1", &intrafreq->presence_ant_port1)); intra_freq.add_field(new parser::field<bool>("presence_ant_port_1", &intrafreq->presence_ant_port1));
intra_freq.add_field(make_asn1_bitstring_number_parser("neigh_cell_cnfg", &intrafreq->neigh_cell_cfg)); intra_freq.add_field(make_asn1_bitstring_number_parser("neigh_cell_cnfg", &intrafreq->neigh_cell_cfg));
intra_freq.add_field(new parser::field<uint8>("t_resel_eutra", &intrafreq->t_resel_eutra)); intra_freq.add_field(new parser::field<uint8>("t_resel_eutra", &intrafreq->t_resel_eutra));
@ -853,11 +853,13 @@ int enb::parse_rr(all_args_t* args, rrc_cfg_t* rrc_cfg)
return SRSLTE_ERROR; return SRSLTE_ERROR;
} else if (args->enb.transmission_mode == 1 && args->enb.nof_ports > 1) { } else if (args->enb.transmission_mode == 1 && args->enb.nof_ports > 1) {
ERROR("Invalid number of ports (%d) for transmission mode (%d). Only one antenna port is allowed.\n", ERROR("Invalid number of ports (%d) for transmission mode (%d). Only one antenna port is allowed.\n",
args->enb.nof_ports, args->enb.transmission_mode); args->enb.nof_ports,
args->enb.transmission_mode);
return SRSLTE_ERROR; return SRSLTE_ERROR;
} else if (args->enb.transmission_mode > 1 && args->enb.nof_ports != 2) { } else if (args->enb.transmission_mode > 1 && args->enb.nof_ports != 2) {
ERROR("The selected number of ports (%d) are insufficient for the selected transmission mode (%d).\n", ERROR("The selected number of ports (%d) are insufficient for the selected transmission mode (%d).\n",
args->enb.nof_ports, args->enb.transmission_mode); args->enb.nof_ports,
args->enb.transmission_mode);
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }
@ -908,8 +910,8 @@ int enb::parse_rr(all_args_t* args, rrc_cfg_t* rrc_cfg)
mac_cnfg.add_subsection(&ulsch_cnfg); mac_cnfg.add_subsection(&ulsch_cnfg);
rrc_cfg->mac_cnfg.ul_sch_cfg.tti_bundling = false; rrc_cfg->mac_cnfg.ul_sch_cfg.tti_bundling = false;
ulsch_cnfg.add_field(make_asn1_enum_number_parser("max_harq_tx", &rrc_cfg->mac_cnfg.ul_sch_cfg.max_harq_tx, ulsch_cnfg.add_field(make_asn1_enum_number_parser(
&rrc_cfg->mac_cnfg.ul_sch_cfg.max_harq_tx_present)); "max_harq_tx", &rrc_cfg->mac_cnfg.ul_sch_cfg.max_harq_tx, &rrc_cfg->mac_cnfg.ul_sch_cfg.max_harq_tx_present));
ulsch_cnfg.add_field(make_asn1_enum_number_parser("periodic_bsr_timer", ulsch_cnfg.add_field(make_asn1_enum_number_parser("periodic_bsr_timer",
&rrc_cfg->mac_cnfg.ul_sch_cfg.periodic_bsr_timer, &rrc_cfg->mac_cnfg.ul_sch_cfg.periodic_bsr_timer,
&rrc_cfg->mac_cnfg.ul_sch_cfg.periodic_bsr_timer_present)); &rrc_cfg->mac_cnfg.ul_sch_cfg.periodic_bsr_timer_present));

@ -341,6 +341,14 @@ meas_id_to_add_mod_s* var_meas_cfg_t::add_measid_cfg(uint8_t measobjid, uint8_t
return std::lower_bound(var_meas.meas_id_list.begin(), var_meas.meas_id_list.end(), new_measid.meas_id, cmp); return std::lower_bound(var_meas.meas_id_list.begin(), var_meas.meas_id_list.end(), new_measid.meas_id, cmp);
} }
asn1::rrc::quant_cfg_s* var_meas_cfg_t::add_quant_cfg(const asn1::rrc::quant_cfg_eutra_s& quantcfg)
{
var_meas.quant_cfg_present = true;
var_meas.quant_cfg.quant_cfg_eutra_present = true;
var_meas.quant_cfg.quant_cfg_eutra = quantcfg;
return &var_meas.quant_cfg;
}
bool var_meas_cfg_t::compute_diff_meas_cfg(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const bool var_meas_cfg_t::compute_diff_meas_cfg(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg) const
{ {
*meas_cfg = {}; *meas_cfg = {};
@ -349,7 +357,7 @@ bool var_meas_cfg_t::compute_diff_meas_cfg(const var_meas_cfg_t& target_cfg, asn
compute_diff_meas_objs(target_cfg, meas_cfg); compute_diff_meas_objs(target_cfg, meas_cfg);
compute_diff_report_cfgs(target_cfg, meas_cfg); compute_diff_report_cfgs(target_cfg, meas_cfg);
compute_diff_meas_ids(target_cfg, meas_cfg); compute_diff_meas_ids(target_cfg, meas_cfg);
// deltaconfig_meas_quantity_config(target_cfg, meas_cfg); compute_diff_quant_cfg(target_cfg, meas_cfg);
meas_cfg->meas_gap_cfg_present = false; // NOTE: we do not support inter-freq. HO meas_cfg->meas_gap_cfg_present = false; // NOTE: we do not support inter-freq. HO
meas_cfg->s_measure_present = false; // NOTE: We do not support SCells meas_cfg->s_measure_present = false; // NOTE: We do not support SCells
meas_cfg->pre_regist_info_hrpd_present = false; // NOTE: not supported meas_cfg->pre_regist_info_hrpd_present = false; // NOTE: not supported
@ -526,6 +534,15 @@ void var_meas_cfg_t::compute_diff_meas_ids(const var_meas_cfg_t& target_cfg, asn
} }
} }
void var_meas_cfg_t::compute_diff_quant_cfg(const var_meas_cfg_t& target_cfg, asn1::rrc::meas_cfg_s* meas_cfg_msg) const
{
if (target_cfg.var_meas.quant_cfg_present and
(not var_meas.quant_cfg_present or not(target_cfg.var_meas.quant_cfg == var_meas.quant_cfg))) {
meas_cfg_msg->quant_cfg_present = true;
meas_cfg_msg->quant_cfg = target_cfg.var_meas.quant_cfg;
}
}
/************************************************************************************************* /*************************************************************************************************
* mobility_cfg class * mobility_cfg class
************************************************************************************************/ ************************************************************************************************/
@ -552,6 +569,9 @@ rrc::mobility_cfg::mobility_cfg(const rrc_cfg_t* cfg_, srslte::log* log_) : cfg(
var_meas.add_measid_cfg(measobj.meas_obj_id, var_meas.rep_cfgs().begin()->report_cfg_id); var_meas.add_measid_cfg(measobj.meas_obj_id, var_meas.rep_cfgs().begin()->report_cfg_id);
} }
} }
// insert quantity config
var_meas.add_quant_cfg(cfg->meas_cfg.quant_cfg);
} }
current_meas_cfg = std::make_shared<var_meas_cfg_t>(var_meas); current_meas_cfg = std::make_shared<var_meas_cfg_t>(var_meas);

@ -303,7 +303,7 @@ int test_mobility_class()
srsenb::rrc rrc; srsenb::rrc rrc;
mac_dummy mac; mac_dummy mac;
rrc.init(&cfg, nullptr, &mac, nullptr, nullptr, nullptr, nullptr, &log_h); // rrc.init(&cfg, nullptr, &mac, nullptr, nullptr, nullptr, nullptr, &log_h);
return SRSLTE_SUCCESS; return SRSLTE_SUCCESS;
} }

Loading…
Cancel
Save