move DL EARFCN list handling before RF init and fix formating

master
Andre Puschmann 6 years ago
parent af6de04806
commit d14c65b7c2

@ -149,6 +149,24 @@ bool ue::init(all_args_t *args_) {
radio.start_trace();
}
// populate EARFCN list
std::vector<uint32_t> earfcn_list;
if (!args->rf.dl_earfcn.empty()) {
std::stringstream ss(args->rf.dl_earfcn);
int idx = 0;
while (ss.good()) {
std::string substr;
getline(ss, substr, ',');
const int earfcn = atoi(substr.c_str());
args->rrc.supported_bands[idx] = srslte_band_get_band(earfcn);
args->rrc.nof_supported_bands = ++idx;
earfcn_list.push_back(earfcn);
}
} else {
printf("Error: dl_earfcn list is empty\n");
return false;
}
// Init layers
// Init USIM first to allow early exit in case reader couldn't be found
@ -228,26 +246,6 @@ bool ue::init(all_args_t *args_) {
gw.set_netmask(args->expert.ip_netmask);
gw.set_tundevname(args->expert.ip_devname);
std::vector<uint32_t> earfcn_list;
if(! args->rf.dl_earfcn.empty()) {
std::stringstream ss(args->rf.dl_earfcn);
int idx = 0;
while(ss.good()) {
std::string substr;
getline(ss, substr, ',');
const int earfcn = atoi(substr.c_str());
args->rrc.supported_bands[idx] = srslte_band_get_band(earfcn);
args->rrc.nof_supported_bands = ++idx;
earfcn_list.push_back(earfcn);
printf("adding %d to earfcn_list\n", earfcn);
}
} else {
printf("error: dl_earfcn list is empty\n");
return false;
}
args->rrc.ue_category = atoi(args->ue_category_str.c_str());
// set args and initialize RRC

Loading…
Cancel
Save