From 42449b079a291b25c2c80d5c7c9f54476e3d2239 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 14 Feb 2020 10:58:38 +0000 Subject: [PATCH] now the scell_activation CE is only for 1 octet. The 4 octet one is not yet supported. --- lib/include/srslte/common/pdu.h | 4 ++-- lib/src/common/pdu.cc | 11 ++++------- srsenb/src/stack/mac/ue.cc | 18 +++++++++++------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/include/srslte/common/pdu.h b/lib/include/srslte/common/pdu.h index 8bdfc8f6c..166e26bde 100644 --- a/lib/include/srslte/common/pdu.h +++ b/lib/include/srslte/common/pdu.h @@ -22,9 +22,9 @@ #ifndef SRSLTE_PDU_H #define SRSLTE_PDU_H -#include "srslte/common/bounded_bitset.h" #include "srslte/common/interfaces_common.h" #include "srslte/common/log.h" +#include #include #include #include @@ -271,7 +271,7 @@ public: bool set_bsr(uint32_t buff_size[4], sch_subh::cetype format); bool set_con_res_id(uint64_t con_res_id); bool set_ta_cmd(uint8_t ta_cmd); - bool set_scell_activation_cmd(srslte::bounded_bitset<32> active_cc_idxs); + bool set_scell_activation_cmd(std::bitset<8> active_cc_idxs); bool set_phr(float phr); void set_padding(); void set_padding(uint32_t padding_len); diff --git a/lib/src/common/pdu.cc b/lib/src/common/pdu.cc index 4eace9361..ae041bc2d 100644 --- a/lib/src/common/pdu.cc +++ b/lib/src/common/pdu.cc @@ -628,19 +628,16 @@ bool sch_subh::set_ta_cmd(uint8_t ta_cmd) } } -bool sch_subh::set_scell_activation_cmd(srslte::bounded_bitset<32> active_cc_idxs) +bool sch_subh::set_scell_activation_cmd(std::bitset<8> active_cc_idxs) { - const uint32_t nof_octets = active_cc_idxs.size() <= 8 ? 1 : 4; + const uint32_t nof_octets = 1; if (not((sch_pdu*)parent)->has_space_ce(nof_octets)) { return false; } // first bit is reserved active_cc_idxs.set(0, false); - uint32_t toencode = (uint32_t)active_cc_idxs.to_uint64(); - for (uint32_t i = 0; i < nof_octets; ++i) { - w_payload_ce[i] = (uint8_t)((toencode >> (8u * i)) & 0xffu); - } - lcid = SCELL_ACTIVATION; + w_payload_ce[0] = (uint8_t)(active_cc_idxs.to_ulong() & 0xffu); + lcid = SCELL_ACTIVATION; ((sch_pdu*)parent)->update_space_ce(nof_octets); nof_bytes = nof_octets; return true; diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index f26c5d112..af1bc9808 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -19,12 +19,12 @@ * */ +#include #include #include #include #include "srsenb/hdr/stack/mac/ue.h" -#include "srslte/common/bounded_bitset.h" #include "srslte/interfaces/enb_interfaces.h" #define Error(fmt, ...) log_h->error(fmt, ##__VA_ARGS__) @@ -428,12 +428,16 @@ void ue::allocate_ce(srslte::sch_pdu* pdu, uint32_t lcid) case srslte::sch_subh::SCELL_ACTIVATION: if (pdu->new_subh()) { const sched_interface::ue_cfg_t* sched_cfg = sched->get_ue_cfg(rnti); - srslte::bounded_bitset<32> active_cc_list(sched_cfg->supported_cc_list.size()); - for (uint32_t i = 0; i < sched_cfg->supported_cc_list.size(); ++i) { - active_cc_list.set(i, sched_cfg->supported_cc_list[i].active); - } - if (pdu->get()->set_scell_activation_cmd(active_cc_list)) { - Info("CE: Added SCell Activation CE.\n"); + if (sched_cfg->supported_cc_list.size() <= 8) { + std::bitset<8> active_cc_list; + for (uint32_t i = 0; i < sched_cfg->supported_cc_list.size(); ++i) { + active_cc_list.set(i, sched_cfg->supported_cc_list[i].active); + } + if (pdu->get()->set_scell_activation_cmd(active_cc_list)) { + Info("CE: Added SCell Activation CE.\n"); + } else { + Error("CE: Setting SCell Activation CE\n"); + } } else { Error("CE: Setting SCell Activation CE\n"); }