diff-based cell selection activation

master
Francisco Paisana 4 years ago
parent 836e7d7ede
commit e9b693942f

@ -179,6 +179,7 @@ uint8_t get_rrc_obj_id(const 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 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 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(drb_to_add_mod_s& drb, uint8_t id);
@ -186,6 +187,7 @@ void set_rrc_obj_id(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(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(scell_to_add_mod_r10_s& obj, uint8_t id);
} // namespace rrc
} // namespace asn1

@ -28,54 +28,76 @@
namespace srslte {
template <typename rrcObj>
using rrc_obj_id_t = decltype(asn1::rrc::get_rrc_obj_id(std::declval<rrcObj>()));
//! Functor to compare RRC config elements (e.g. SRB/measObj/Rep) based on ID
template <typename T>
struct rrc_obj_id_cmp {
bool operator()(const T& lhs, const T& rhs) const
template <typename T, typename U>
typename std::enable_if<not std::is_integral<T>::value and not std::is_integral<U>::value, bool>::type
operator()(const T& lhs, const U& rhs) const
{
return asn1::rrc::get_rrc_obj_id(lhs) < asn1::rrc::get_rrc_obj_id(rhs);
}
template <typename IdType>
bool operator()(const T& lhs, IdType id) const
template <typename T>
bool operator()(const T& lhs, rrc_obj_id_t<T> id) const
{
return asn1::rrc::get_rrc_obj_id(lhs) < id;
}
template <typename IdType>
bool operator()(IdType id, const T& rhs) const
template <typename T>
bool operator()(rrc_obj_id_t<T> id, const T& rhs) const
{
return id < asn1::rrc::get_rrc_obj_id(rhs);
}
};
template <typename Container>
using rrc_obj_id_list_cmp = rrc_obj_id_cmp<typename Container::value_type>;
struct unary_rrc_obj_id {
rrc_obj_id_t<typename Container::value_type> id;
template <typename T>
explicit unary_rrc_obj_id(T id_) : id(id_)
{}
bool operator()(const typename Container::value_type& e) const { return asn1::rrc::get_rrc_obj_id(e) == id; }
};
/// Find rrc object in list based on ID
template <typename Container, typename IdType>
typename Container::iterator find_rrc_obj_id(Container& c, IdType id)
{
return std::find_if(
c.begin(), c.end(), [id](const typename Container::value_type& e) { return asn1::rrc::get_rrc_obj_id(e) == id; });
return std::find_if(c.begin(), c.end(), unary_rrc_obj_id<Container>{id});
}
template <typename Container, typename IdType>
typename Container::const_iterator find_rrc_obj_id(const Container& c, IdType id)
{
return std::find_if(
c.begin(), c.end(), [id](const typename Container::value_type& e) { return asn1::rrc::get_rrc_obj_id(e) == id; });
return std::find_if(c.begin(), c.end(), unary_rrc_obj_id<Container>{id});
}
//! Search of rrc cfg element based on ID. Assumes sorted list.
/// Find rrc object in sorted list based on ID (binary search)
template <typename Container, typename IdType>
typename Container::iterator sorted_find_rrc_obj_id(Container& c, IdType id)
{
auto it = std::lower_bound(c.begin(), c.end(), id, rrc_obj_id_list_cmp<Container>{});
auto it = std::lower_bound(c.begin(), c.end(), id, rrc_obj_id_cmp{});
return (it == c.end() or asn1::rrc::get_rrc_obj_id(*it) != id) ? c.end() : it;
}
template <typename Container, typename IdType>
typename Container::const_iterator sorted_find_rrc_obj_id(const Container& c, IdType id)
{
auto it = std::lower_bound(c.begin(), c.end(), id, rrc_obj_id_list_cmp<Container>{});
auto it = std::lower_bound(c.begin(), c.end(), id, rrc_obj_id_cmp{});
return (it == c.end() or asn1::rrc::get_rrc_obj_id(*it) != id) ? c.end() : it;
}
template <typename Container, typename Container2>
bool equal_rrc_obj_ids(const Container& c, const Container2& c2)
{
return std::equal(c.begin(),
c.end(),
c2.begin(),
c2.end(),
[](const typename Container::value_type& e, const typename Container2::value_type& e2) {
return asn1::rrc::get_rrc_obj_id(e) == asn1::rrc::get_rrc_obj_id(e2);
});
}
//! Add Id to List in a sorted manner
template <typename Container, typename IdType>
typename Container::iterator add_rrc_obj_id(Container& c, IdType id)
@ -85,7 +107,7 @@ typename Container::iterator add_rrc_obj_id(Container& c, IdType id)
c.push_back({});
it = c.end() - 1;
asn1::rrc::set_rrc_obj_id(*it, id);
std::sort(c.begin(), c.end(), rrc_obj_id_list_cmp<Container>{});
std::sort(c.begin(), c.end(), rrc_obj_id_cmp{});
it = sorted_find_rrc_obj_id(c, id);
}
return it;
@ -97,7 +119,7 @@ typename Container::iterator add_rrc_obj(Container& c, const typename Container:
auto it = sorted_find_rrc_obj_id(c, asn1::rrc::get_rrc_obj_id(v));
if (it == c.end()) {
c.push_back(v);
std::sort(c.begin(), c.end(), rrc_obj_id_list_cmp<Container>{});
std::sort(c.begin(), c.end(), rrc_obj_id_cmp{});
it = sorted_find_rrc_obj_id(c, asn1::rrc::get_rrc_obj_id(v));
} else {
*it = v;
@ -124,7 +146,7 @@ bool rem_rrc_obj_id(Container& c, IdType id)
template <typename Container>
auto find_rrc_obj_id_gap(const Container& c) -> decltype(asn1::rrc::get_rrc_obj_id(c[0]))
{
auto id_cmp_op = rrc_obj_id_list_cmp<Container>{};
auto id_cmp_op = rrc_obj_id_cmp{};
assert(std::is_sorted(c.begin(), c.end(), id_cmp_op));
auto prev_it = c.begin();
@ -155,7 +177,7 @@ void apply_addmodlist_diff(const AddModList& src_list, const AddModList& add_dif
}
return;
}
auto id_cmp_op = rrc_obj_id_list_cmp<AddModList>{};
auto id_cmp_op = rrc_obj_id_cmp{};
assert(std::is_sorted(src_list.begin(), src_list.end(), id_cmp_op));
assert(std::is_sorted(add_diff_list.begin(), add_diff_list.end(), id_cmp_op));
@ -184,7 +206,7 @@ void apply_addmodremlist_diff(const AddModList& src_list,
}
return;
}
auto id_cmp_op = rrc_obj_id_list_cmp<AddModList>{};
auto id_cmp_op = rrc_obj_id_cmp{};
assert(std::is_sorted(src_list.begin(), src_list.end(), id_cmp_op));
assert(std::is_sorted(add_diff_list.begin(), add_diff_list.end(), id_cmp_op));
assert(std::is_sorted(rm_diff_list.begin(), rm_diff_list.end()));
@ -216,7 +238,7 @@ void compute_cfg_diff(const List& src_list,
AddFunctor add_func,
ModFunctor mod_func)
{
auto id_cmp_op = rrc_obj_id_list_cmp<List>{};
auto id_cmp_op = rrc_obj_id_cmp{};
assert(std::is_sorted(src_list.begin(), src_list.end(), id_cmp_op));
assert(std::is_sorted(target_list.begin(), target_list.end(), id_cmp_op));

@ -1215,6 +1215,10 @@ uint8_t get_rrc_obj_id(const meas_id_to_add_mod_s& obj)
{
return obj.meas_id;
}
uint8_t get_rrc_obj_id(const scell_to_add_mod_r10_s& obj)
{
return obj.scell_idx_r10;
}
void set_rrc_obj_id(srb_to_add_mod_s& srb, uint8_t id)
{
@ -1240,6 +1244,10 @@ void set_rrc_obj_id(meas_id_to_add_mod_s& obj, uint8_t id)
{
obj.meas_id = id;
}
void set_rrc_obj_id(scell_to_add_mod_r10_s& obj, uint8_t id)
{
obj.scell_idx_r10 = id;
}
} // namespace rrc
} // namespace asn1

@ -417,20 +417,14 @@ void fill_scells_reconf(asn1::rrc::rrc_conn_recfg_r8_ies_s& recfg_r8,
}
}
recfg_r8.non_crit_ext_present = true;
recfg_r8.non_crit_ext.non_crit_ext_present = true;
recfg_r8.non_crit_ext.non_crit_ext.non_crit_ext_present = true;
recfg_r8.non_crit_ext.non_crit_ext.non_crit_ext.scell_to_add_mod_list_r10_present = true;
auto& scells_to_add = recfg_r8.non_crit_ext.non_crit_ext.non_crit_ext.scell_to_add_mod_list_r10;
scells_to_add.resize(ue_cell_list.nof_cells() - 1);
scell_to_add_mod_list_r10_l target_scells(ue_cell_list.nof_cells() - 1);
for (size_t ue_cc_idx = 1; ue_cc_idx < ue_cell_list.nof_cells(); ++ue_cc_idx) {
const cell_ctxt_dedicated& scell = *ue_cell_list.get_ue_cc_idx(ue_cc_idx);
const cell_info_common& scell_cfg = *scell.cell_common;
const sib_type1_s& cell_sib1 = scell_cfg.sib1;
const sib_type2_s& cell_sib2 = scell_cfg.sib2;
scell_to_add_mod_r10_s& asn1cell = scells_to_add[ue_cc_idx - 1];
scell_to_add_mod_r10_s& asn1cell = target_scells[ue_cc_idx - 1];
asn1cell.scell_idx_r10 = ue_cc_idx;
asn1cell.cell_identif_r10_present = true;
asn1cell.cell_identif_r10.pci_r10 = scell_cfg.cell_cfg.pci;
@ -520,6 +514,15 @@ void fill_scells_reconf(asn1::rrc::rrc_conn_recfg_r8_ies_s& recfg_r8,
#endif // SRS_ENABLED
}
// Fill RRCConnectionReconf message
recfg_r8.non_crit_ext_present = true;
recfg_r8.non_crit_ext.non_crit_ext_present = true;
recfg_r8.non_crit_ext.non_crit_ext.non_crit_ext_present = true;
recfg_r8.non_crit_ext.non_crit_ext.non_crit_ext.scell_to_add_mod_list_r10_present = true;
auto& recfg_v1020 = recfg_r8.non_crit_ext.non_crit_ext.non_crit_ext;
srslte::compute_cfg_diff(
current_scells, target_scells, recfg_v1020.scell_to_add_mod_list_r10, recfg_v1020.scell_to_release_list_r10);
// Set DL HARQ Feedback mode
recfg_r8.rr_cfg_ded.phys_cfg_ded.pucch_cfg_ded_v1020.set_present(true);
recfg_r8.rr_cfg_ded.phys_cfg_ded.pucch_cfg_ded_v1020->pucch_format_r10_present = true;

Loading…
Cancel
Save