now the scell_activation CE is only for 1 octet. The 4 octet one is not yet supported.

master
Francisco Paisana 5 years ago
parent d831522692
commit 42449b079a

@ -22,9 +22,9 @@
#ifndef SRSLTE_PDU_H #ifndef SRSLTE_PDU_H
#define SRSLTE_PDU_H #define SRSLTE_PDU_H
#include "srslte/common/bounded_bitset.h"
#include "srslte/common/interfaces_common.h" #include "srslte/common/interfaces_common.h"
#include "srslte/common/log.h" #include "srslte/common/log.h"
#include <bitset>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <vector> #include <vector>
@ -271,7 +271,7 @@ public:
bool set_bsr(uint32_t buff_size[4], sch_subh::cetype format); bool set_bsr(uint32_t buff_size[4], sch_subh::cetype format);
bool set_con_res_id(uint64_t con_res_id); bool set_con_res_id(uint64_t con_res_id);
bool set_ta_cmd(uint8_t ta_cmd); 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); bool set_phr(float phr);
void set_padding(); void set_padding();
void set_padding(uint32_t padding_len); void set_padding(uint32_t padding_len);

@ -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)) { if (not((sch_pdu*)parent)->has_space_ce(nof_octets)) {
return false; return false;
} }
// first bit is reserved // first bit is reserved
active_cc_idxs.set(0, false); active_cc_idxs.set(0, false);
uint32_t toencode = (uint32_t)active_cc_idxs.to_uint64(); w_payload_ce[0] = (uint8_t)(active_cc_idxs.to_ulong() & 0xffu);
for (uint32_t i = 0; i < nof_octets; ++i) { lcid = SCELL_ACTIVATION;
w_payload_ce[i] = (uint8_t)((toencode >> (8u * i)) & 0xffu);
}
lcid = SCELL_ACTIVATION;
((sch_pdu*)parent)->update_space_ce(nof_octets); ((sch_pdu*)parent)->update_space_ce(nof_octets);
nof_bytes = nof_octets; nof_bytes = nof_octets;
return true; return true;

@ -19,12 +19,12 @@
* *
*/ */
#include <bitset>
#include <inttypes.h> #include <inttypes.h>
#include <iostream> #include <iostream>
#include <string.h> #include <string.h>
#include "srsenb/hdr/stack/mac/ue.h" #include "srsenb/hdr/stack/mac/ue.h"
#include "srslte/common/bounded_bitset.h"
#include "srslte/interfaces/enb_interfaces.h" #include "srslte/interfaces/enb_interfaces.h"
#define Error(fmt, ...) log_h->error(fmt, ##__VA_ARGS__) #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: case srslte::sch_subh::SCELL_ACTIVATION:
if (pdu->new_subh()) { if (pdu->new_subh()) {
const sched_interface::ue_cfg_t* sched_cfg = sched->get_ue_cfg(rnti); 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()); if (sched_cfg->supported_cc_list.size() <= 8) {
for (uint32_t i = 0; i < sched_cfg->supported_cc_list.size(); ++i) { std::bitset<8> active_cc_list;
active_cc_list.set(i, sched_cfg->supported_cc_list[i].active); 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 (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 { } else {
Error("CE: Setting SCell Activation CE\n"); Error("CE: Setting SCell Activation CE\n");
} }

Loading…
Cancel
Save