Added black cells with index function

Added new index functios
Use asn1 list functions for toAddMod and toRem lists
master
David Rupprecht 4 years ago committed by Andre Puschmann
parent f4b0042c10
commit 2e51cfc1a5

@ -57,6 +57,8 @@ struct mcch_msg_s;
struct sib_type13_r9_s; struct sib_type13_r9_s;
// MeasConfig // MeasConfig
struct cells_to_add_mod_s; struct cells_to_add_mod_s;
struct cells_to_add_mod_nr_r15_s;
struct black_cells_to_add_mod_s;
struct report_cfg_eutra_s; 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;
@ -147,6 +149,8 @@ namespace rrc {
uint8_t get_rrc_obj_id(const srb_to_add_mod_s& srb); uint8_t get_rrc_obj_id(const srb_to_add_mod_s& srb);
uint8_t get_rrc_obj_id(const drb_to_add_mod_s& drb); uint8_t get_rrc_obj_id(const drb_to_add_mod_s& drb);
uint8_t get_rrc_obj_id(const cells_to_add_mod_s& obj); uint8_t get_rrc_obj_id(const cells_to_add_mod_s& obj);
uint8_t get_rrc_obj_id(const cells_to_add_mod_nr_r15_s& obj);
uint8_t get_rrc_obj_id(const black_cells_to_add_mod_s& obj);
uint8_t get_rrc_obj_id(const meas_obj_to_add_mod_s& obj); uint8_t get_rrc_obj_id(const meas_obj_to_add_mod_s& obj);
uint8_t get_rrc_obj_id(const report_cfg_to_add_mod_s& obj); uint8_t get_rrc_obj_id(const report_cfg_to_add_mod_s& obj);
uint8_t get_rrc_obj_id(const meas_id_to_add_mod_s& obj); uint8_t get_rrc_obj_id(const meas_id_to_add_mod_s& obj);
@ -155,6 +159,8 @@ uint8_t get_rrc_obj_id(const scell_to_add_mod_r10_s& obj);
void set_rrc_obj_id(srb_to_add_mod_s& srb, uint8_t id); void set_rrc_obj_id(srb_to_add_mod_s& srb, uint8_t id);
void set_rrc_obj_id(drb_to_add_mod_s& drb, uint8_t id); void set_rrc_obj_id(drb_to_add_mod_s& drb, uint8_t id);
void set_rrc_obj_id(cells_to_add_mod_s& obj, uint8_t id); void set_rrc_obj_id(cells_to_add_mod_s& obj, uint8_t id);
void set_rrc_obj_id(cells_to_add_mod_nr_r15_s& obj, uint8_t id);
void set_rrc_obj_id(black_cells_to_add_mod_s& obj, uint8_t id);
void set_rrc_obj_id(meas_obj_to_add_mod_s& obj, uint8_t id); void set_rrc_obj_id(meas_obj_to_add_mod_s& obj, uint8_t id);
void set_rrc_obj_id(report_cfg_to_add_mod_s& obj, uint8_t id); void set_rrc_obj_id(report_cfg_to_add_mod_s& obj, uint8_t id);
void set_rrc_obj_id(meas_id_to_add_mod_s& obj, uint8_t id); void set_rrc_obj_id(meas_id_to_add_mod_s& obj, uint8_t id);

@ -1007,10 +1007,18 @@ uint8_t get_rrc_obj_id(const drb_to_add_mod_s& drb)
{ {
return drb.drb_id; return drb.drb_id;
} }
uint8_t get_rrc_obj_id(const black_cells_to_add_mod_s& obj)
{
return obj.cell_idx;
}
uint8_t get_rrc_obj_id(const cells_to_add_mod_s& obj) uint8_t get_rrc_obj_id(const cells_to_add_mod_s& obj)
{ {
return obj.cell_idx; return obj.cell_idx;
} }
uint8_t get_rrc_obj_id(const cells_to_add_mod_nr_r15_s& obj)
{
return obj.cell_idx_r15;
}
uint8_t get_rrc_obj_id(const meas_obj_to_add_mod_s& obj) uint8_t get_rrc_obj_id(const meas_obj_to_add_mod_s& obj)
{ {
return obj.meas_obj_id; return obj.meas_obj_id;
@ -1036,10 +1044,18 @@ void set_rrc_obj_id(drb_to_add_mod_s& drb, uint8_t id)
{ {
drb.drb_id = id; drb.drb_id = id;
} }
void set_rrc_obj_id(black_cells_to_add_mod_s& obj, uint8_t id)
{
obj.cell_idx = id;
}
void set_rrc_obj_id(cells_to_add_mod_s& obj, uint8_t id) void set_rrc_obj_id(cells_to_add_mod_s& obj, uint8_t id)
{ {
obj.cell_idx = id; obj.cell_idx = id;
} }
void set_rrc_obj_id(cells_to_add_mod_nr_r15_s& obj, uint8_t id)
{
obj.cell_idx_r15 = id;
}
void set_rrc_obj_id(meas_obj_to_add_mod_s& obj, uint8_t id) void set_rrc_obj_id(meas_obj_to_add_mod_s& obj, uint8_t id)
{ {
obj.meas_obj_id = id; obj.meas_obj_id = id;

@ -13,6 +13,7 @@
#include "srsue/hdr/stack/rrc/rrc_meas.h" #include "srsue/hdr/stack/rrc/rrc_meas.h"
#include "srslte/asn1/rrc/dl_dcch_msg.h" #include "srslte/asn1/rrc/dl_dcch_msg.h"
#include "srsue/hdr/stack/rrc/rrc.h" #include "srsue/hdr/stack/rrc/rrc.h"
#include "srslte/rrc/rrc_cfg_utils.h"
/************************************************************************ /************************************************************************
* *
@ -810,15 +811,8 @@ void rrc::rrc_meas::var_meas_cfg::measObject_addmod_eutra(uint8_t meas_obj_id, c
// Remove cells // Remove cells
if (cfg_obj.cells_to_rem_list_present) { if (cfg_obj.cells_to_rem_list_present) {
log_h->debug("MEAS: Removing %d cells\n", cfg_obj.cells_to_rem_list.size()); log_h->debug("MEAS: Removing %d cells\n", cfg_obj.cells_to_rem_list.size());
cells_to_add_mod_list_l new_list; apply_remlist_diff(local_obj.cells_to_add_mod_list, cfg_obj.cells_to_rem_list, local_obj.cells_to_add_mod_list);
for (auto& local_cell : local_obj.cells_to_add_mod_list) {
// If not in the list to remove, copy to new list
if (std::find(cfg_obj.cells_to_rem_list.begin(), cfg_obj.cells_to_rem_list.end(), local_cell.cell_idx) ==
cfg_obj.cells_to_rem_list.end()) {
new_list.push_back(local_cell);
}
}
local_obj.cells_to_add_mod_list = new_list;
if (log_h->get_level() == LOG_LEVEL_DEBUG) { if (log_h->get_level() == LOG_LEVEL_DEBUG) {
for (auto& c : local_obj.cells_to_add_mod_list) { for (auto& c : local_obj.cells_to_add_mod_list) {
log_h->debug("MEAS: cell idx=%d, pci=%d, q_offset=%d\n", log_h->debug("MEAS: cell idx=%d, pci=%d, q_offset=%d\n",
@ -829,50 +823,22 @@ void rrc::rrc_meas::var_meas_cfg::measObject_addmod_eutra(uint8_t meas_obj_id, c
} }
} }
if (cfg_obj.cells_to_add_mod_list_present) { if (cfg_obj.cells_to_add_mod_list_present) {
for (auto& new_cell : cfg_obj.cells_to_add_mod_list) { apply_addmodlist_diff(
// If an entry with the matching cellIndex exists in the local object cellsToAddModList: local_obj.cells_to_add_mod_list, cfg_obj.cells_to_add_mod_list, local_obj.cells_to_add_mod_list);
auto it = std::find_if(local_obj.cells_to_add_mod_list.begin(),
local_obj.cells_to_add_mod_list.end(),
[&new_cell](const cells_to_add_mod_s& c) { return c.cell_idx == new_cell.cell_idx; });
if (it != local_obj.cells_to_add_mod_list.end()) {
// If the new cell exists, copy it
*it = new_cell;
} else {
// otherwise add it
local_obj.cells_to_add_mod_list.push_back(new_cell);
}
}
} }
} }
// Do the same with black list // Do the same with black list
{ {
if (cfg_obj.black_cells_to_add_mod_list_present) { if (cfg_obj.black_cells_to_rem_list_present) {
black_cells_to_add_mod_list_l new_list; apply_remlist_diff(local_obj.black_cells_to_add_mod_list,
for (auto& local_cell : local_obj.black_cells_to_add_mod_list) { cfg_obj.black_cells_to_rem_list,
// If doesn't exists in cells to rem local_obj.black_cells_to_add_mod_list);
if (std::find(cfg_obj.black_cells_to_rem_list.begin(),
cfg_obj.black_cells_to_rem_list.end(),
local_cell.cell_idx) == cfg_obj.black_cells_to_rem_list.end()) {
new_list.push_back(local_cell);
}
}
local_obj.black_cells_to_add_mod_list = new_list;
} }
if (cfg_obj.black_cells_to_add_mod_list_present) { if (cfg_obj.black_cells_to_add_mod_list_present) {
for (auto& new_cell : cfg_obj.black_cells_to_add_mod_list) { apply_addmodlist_diff(local_obj.black_cells_to_add_mod_list,
// If an entry with the matching cellIndex exists in the local object blackCellsToAddModList: cfg_obj.black_cells_to_add_mod_list,
auto it = local_obj.black_cells_to_add_mod_list);
std::find_if(local_obj.black_cells_to_add_mod_list.begin(),
local_obj.black_cells_to_add_mod_list.end(),
[&new_cell](const black_cells_to_add_mod_s& c) { return c.cell_idx == new_cell.cell_idx; });
if (it != local_obj.black_cells_to_add_mod_list.end()) {
// copy the new entry
*it = new_cell;
} else {
local_obj.black_cells_to_add_mod_list.push_back(new_cell);
}
}
} }
} }
@ -918,32 +884,15 @@ void rrc::rrc_meas::var_meas_cfg::measObject_addmod_nr_r15(uint8_t meas_obj_id,
// Combine the new cells with the existing ones and remove the cells indicated in config // Combine the new cells with the existing ones and remove the cells indicated in config
// Do the same with black list // Do the same with black list
{ {
if (cfg_obj.black_cells_to_add_mod_list_r15_present) { if (cfg_obj.black_cells_to_rem_list_r15_present) {
cells_to_add_mod_list_nr_r15_l new_list; apply_remlist_diff(local_obj.black_cells_to_add_mod_list_r15,
for (auto& local_cell : local_obj.black_cells_to_add_mod_list_r15) { cfg_obj.black_cells_to_rem_list_r15,
// If doesn't exists in cells to rem local_obj.black_cells_to_add_mod_list_r15);
if (std::find(cfg_obj.black_cells_to_rem_list_r15.begin(),
cfg_obj.black_cells_to_rem_list_r15.end(),
local_cell.cell_idx_r15) == cfg_obj.black_cells_to_rem_list_r15.end()) {
new_list.push_back(local_cell);
}
}
local_obj.black_cells_to_add_mod_list_r15 = new_list;
} }
if (cfg_obj.black_cells_to_add_mod_list_r15_present) { if (cfg_obj.black_cells_to_add_mod_list_r15_present) {
for (auto& new_cell : cfg_obj.black_cells_to_add_mod_list_r15) { apply_addmodlist_diff(local_obj.black_cells_to_add_mod_list_r15,
// If an entry with the matching cellIndex exists in the local object blackCellsToAddModList: cfg_obj.black_cells_to_add_mod_list_r15,
auto it = std::find_if( local_obj.black_cells_to_add_mod_list_r15);
local_obj.black_cells_to_add_mod_list_r15.begin(),
local_obj.black_cells_to_add_mod_list_r15.end(),
[&new_cell](const cells_to_add_mod_nr_r15_s& c) { return c.cell_idx_r15 == new_cell.cell_idx_r15; });
if (it != local_obj.black_cells_to_add_mod_list_r15.end()) {
// copy the new entry
*it = new_cell;
} else {
local_obj.black_cells_to_add_mod_list_r15.push_back(new_cell);
}
}
} }
} }
// for each measId associated with this measObjectId in the measIdList within the VarMeasConfig // for each measId associated with this measObjectId in the measIdList within the VarMeasConfig

Loading…
Cancel
Save