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
#define SRSLTE_PDU_H
#include "srslte/common/bounded_bitset.h"
#include "srslte/common/interfaces_common.h"
#include "srslte/common/log.h"
#include <bitset>
#include <stdint.h>
#include <stdio.h>
#include <vector>
@ -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);

@ -628,18 +628,15 @@ 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);
}
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;

@ -19,12 +19,12 @@
*
*/
#include <bitset>
#include <inttypes.h>
#include <iostream>
#include <string.h>
#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,7 +428,8 @@ 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());
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);
}
@ -437,6 +438,9 @@ void ue::allocate_ce(srslte::sch_pdu* pdu, uint32_t lcid)
} else {
Error("CE: Setting SCell Activation CE\n");
}
} else {
Error("CE: Setting SCell Activation CE\n");
}
} else {
Error("CE: Setting SCell Activation CE. No space for a subheader\n");
}

Loading…
Cancel
Save