SRSUE: Fixed CLang Tidy in ue.cc

master
Xavier Arteaga 6 years ago committed by Andre Puschmann
parent 1f52c32b84
commit 2c78111666

@ -352,7 +352,7 @@ SRSLTE_API char *srslte_mod_string(srslte_mod_t mod);
SRSLTE_API uint32_t srslte_mod_bits_x_symbol(srslte_mod_t mod); SRSLTE_API uint32_t srslte_mod_bits_x_symbol(srslte_mod_t mod);
SRSLTE_API int srslte_band_get_band(uint32_t dl_earfcn); SRSLTE_API uint8_t srslte_band_get_band(uint32_t dl_earfcn);
SRSLTE_API bool srslte_band_is_tdd(uint32_t band); SRSLTE_API bool srslte_band_is_tdd(uint32_t band);

@ -462,7 +462,7 @@ uint32_t srslte_re_x_prb(uint32_t ns, uint32_t symbol, uint32_t nof_ports, uint3
struct lte_band { struct lte_band {
uint32_t band; uint8_t band;
float fd_low_mhz; float fd_low_mhz;
uint32_t dl_earfcn_offset; uint32_t dl_earfcn_offset;
uint32_t ul_earfcn_offset; uint32_t ul_earfcn_offset;
@ -596,7 +596,7 @@ bool srslte_band_is_tdd(uint32_t band)
return lte_bands[i].ul_earfcn_offset == 0; return lte_bands[i].ul_earfcn_offset == 0;
} }
int srslte_band_get_band(uint32_t dl_earfcn) uint8_t srslte_band_get_band(uint32_t dl_earfcn)
{ {
uint32_t i = SRSLTE_NOF_LTE_BANDS - 1; uint32_t i = SRSLTE_NOF_LTE_BANDS - 1;
if (dl_earfcn > lte_bands[i].dl_earfcn_offset) { if (dl_earfcn > lte_bands[i].dl_earfcn_offset) {

@ -36,7 +36,7 @@ using namespace srslte;
namespace srsue { namespace srsue {
ue::ue() : logger(NULL) ue::ue() : logger(nullptr)
{ {
// print build info // print build info
std::cout << std::endl << get_build_string() << std::endl; std::cout << std::endl << get_build_string() << std::endl;
@ -174,11 +174,11 @@ int ue::parse_args(const all_args_t& args_)
// populate EARFCN list // populate EARFCN list
if (!args.phy.dl_earfcn.empty()) { if (!args.phy.dl_earfcn.empty()) {
std::stringstream ss(args.phy.dl_earfcn); std::stringstream ss(args.phy.dl_earfcn);
int idx = 0; uint32_t idx = 0;
while (ss.good()) { while (ss.good()) {
std::string substr; std::string substr;
getline(ss, substr, ','); getline(ss, substr, ',');
const int earfcn = atoi(substr.c_str()); auto earfcn = (uint32_t)strtoul(substr.c_str(), nullptr, 10);
args.stack.rrc.supported_bands[idx] = srslte_band_get_band(earfcn); args.stack.rrc.supported_bands[idx] = srslte_band_get_band(earfcn);
args.stack.rrc.nof_supported_bands = ++idx; args.stack.rrc.nof_supported_bands = ++idx;
args.phy.earfcn_list.push_back(earfcn); args.phy.earfcn_list.push_back(earfcn);
@ -190,7 +190,7 @@ int ue::parse_args(const all_args_t& args_)
} }
// Set UE category // Set UE category
args.stack.rrc.ue_category = atoi(args.stack.rrc.ue_category_str.c_str()); args.stack.rrc.ue_category = (uint32_t)strtoul(args.stack.rrc.ue_category_str.c_str(), nullptr, 10);
// Consider Carrier Aggregation support if more than one // Consider Carrier Aggregation support if more than one
args.stack.rrc.support_ca = (args.rf.nof_rf_channels * args.rf.nof_radios) > 1; args.stack.rrc.support_ca = (args.rf.nof_rf_channels * args.rf.nof_radios) > 1;

Loading…
Cancel
Save