srsue: add DL NR-ARFCN param

* add PHY param to set DL NR-ARFCN
* use new band_helper class to convert ARFCNs to supported bands
* signal supported NR bands in UE capabilities
master
Andre Puschmann 4 years ago
parent 617e0ddb67
commit 4709bacefd

@ -517,6 +517,10 @@ typedef struct {
std::vector<uint32_t> dl_earfcn_list = {3400}; // vectorized version of dl_earfcn that gets populated during init
std::map<uint32_t, uint32_t> ul_earfcn_map; // Map linking DL EARFCN and UL EARFCN
std::string dl_nr_arfcn = "632628"; // comma-separated list of DL NR ARFCNs
std::vector<uint32_t> dl_nr_arfcn_list = {
632628}; // vectorized version of dl_nr_arfcn that gets populated during init
float dl_freq = -1.0f;
float ul_freq = -1.0f;

@ -33,6 +33,7 @@ struct core_less_args_t {
struct rrc_nr_args_t {
core_less_args_t coreless;
std::vector<uint32_t> supported_bands;
std::string log_level;
uint32_t log_hex_limit;
};

@ -69,6 +69,7 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
("rf.dl_earfcn", bpo::value<string>(&args->phy.dl_earfcn)->default_value("3400"), "Downlink EARFCN list")
("rf.ul_earfcn", bpo::value<string>(&args->phy.ul_earfcn), "Uplink EARFCN list. Optional.")
("rf.dl_nr_arfcn", bpo::value<string>(&args->phy.dl_nr_arfcn)->default_value("632628"), "Downlink NR-ARFCN list")
("rf.srate", bpo::value<double>(&args->rf.srate_hz)->default_value(0.0), "Force Tx and Rx sampling rate in Hz")
("rf.freq_offset", bpo::value<float>(&args->rf.freq_offset)->default_value(0), "(optional) Frequency offset")
("rf.dl_freq", bpo::value<float>(&args->phy.dl_freq)->default_value(-1), "Downlink Frequency (if positive overrides EARFCN)")

@ -199,19 +199,21 @@ void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps_pdu)
band_param_eutra.set_eutra();
band_param_eutra.eutra().ca_bw_class_dl_eutra_present = true;
band_param_eutra.eutra().ca_bw_class_ul_eutra_present = true;
band_param_eutra.eutra().band_eutra = 1;
band_param_eutra.eutra().band_eutra = 1; // TODO: this also needs to be set here?
band_param_eutra.eutra().ca_bw_class_dl_eutra = asn1::rrc_nr::ca_bw_class_eutra_opts::options::a;
band_param_eutra.eutra().ca_bw_class_ul_eutra = asn1::rrc_nr::ca_bw_class_eutra_opts::options::a;
band_combination.band_list.push_back(band_param_eutra);
for (const auto& band : args.supported_bands) {
struct band_params_c band_param_nr;
band_param_nr.set_nr();
band_param_nr.nr().ca_bw_class_dl_nr_present = true;
band_param_nr.nr().ca_bw_class_ul_nr_present = true;
band_param_nr.nr().band_nr = 78;
band_param_nr.nr().band_nr = band;
band_param_nr.nr().ca_bw_class_dl_nr = asn1::rrc_nr::ca_bw_class_nr_opts::options::a;
band_param_nr.nr().ca_bw_class_ul_nr = asn1::rrc_nr::ca_bw_class_nr_opts::options::a;
band_combination.band_list.push_back(band_param_nr);
}
mrdc_cap.rf_params_mrdc.supported_band_combination_list.push_back(band_combination);
mrdc_cap.rf_params_mrdc.supported_band_combination_list_present = true;
@ -226,10 +228,12 @@ void rrc_nr::get_eutra_nr_capabilities(srslte::byte_buffer_t* eutra_nr_caps_pdu)
band_info_eutra.band_info_eutra().band_eutra = 1;
mrdc_cap.rf_params_mrdc.applied_freq_band_list_filt.push_back(band_info_eutra);
for (const auto& band : args.supported_bands) {
freq_band_info_c band_info_nr;
band_info_nr.set_band_info_nr();
band_info_nr.band_info_nr().band_nr = 78;
band_info_nr.band_info_nr().band_nr = band;
mrdc_cap.rf_params_mrdc.applied_freq_band_list_filt.push_back(band_info_nr);
}
mrdc_cap.rf_params_mrdc.applied_freq_band_list_filt_present = true;
@ -387,18 +391,19 @@ bool rrc_nr::rrc_reconfiguration(bool endc_release_and_add_r15,
void rrc_nr::get_nr_capabilities(srslte::byte_buffer_t* nr_caps_pdu)
{
struct ue_nr_cap_s nr_cap;
nr_cap.access_stratum_release = access_stratum_release_opts::rel15;
// PDCP
nr_cap.pdcp_params.max_num_rohc_context_sessions = pdcp_params_s::max_num_rohc_context_sessions_opts::cs2;
for (const auto& band : args.supported_bands) {
band_nr_s band_nr;
band_nr.band_nr = 78;
band_nr.band_nr = band;
band_nr.ue_pwr_class_present = true;
band_nr.ue_pwr_class = band_nr_s::ue_pwr_class_opts::pc3;
nr_cap.rf_params.supported_band_list_nr.push_back(band_nr);
}
nr_cap.rlc_params_present = true;
nr_cap.rlc_params.um_with_short_sn_present = true;

@ -12,6 +12,7 @@
#include "srsue/hdr/ue.h"
#include "srslte/build_info.h"
#include "srslte/common/band_helper.h"
#include "srslte/common/string_helpers.h"
#include "srslte/radio/radio.h"
#include "srslte/radio/radio_null.h"
@ -245,6 +246,32 @@ int ue::parse_args(const all_args_t& args_)
}
}
srslte_band_helper bands_helper;
// populate NR DL ARFCNs
if (args.phy.nof_nr_carriers > 0) {
if (not args.phy.dl_nr_arfcn.empty()) {
// Parse list
srslte::string_parse_list(args.phy.dl_nr_arfcn, ',', args.phy.dl_nr_arfcn_list);
// Populates supported bands
for (uint32_t& arfcn : args.phy.dl_nr_arfcn_list) {
std::vector<uint32_t> bands = bands_helper.get_bands_nr(arfcn);
for (const auto& band : bands) {
// make sure we don't add duplicates
if (std::find(args.stack.rrc_nr.supported_bands.begin(), args.stack.rrc_nr.supported_bands.end(), band) ==
args.stack.rrc_nr.supported_bands.end()) {
args.stack.rrc_nr.supported_bands.push_back(band);
}
}
}
} else {
log.error("Error: dl_nr_arfcn list is empty\n");
srslte::console("Error: dl_nr_arfcn list is empty\n");
return SRSLTE_ERROR;
}
}
// Set UE category
args.stack.rrc.ue_category = (uint32_t)strtoul(args.stack.rrc.ue_category_str.c_str(), nullptr, 10);

@ -11,6 +11,7 @@
# rx_gain: Optional receive gain (dB). If disabled, AGC if enabled
#
# Optional parameters:
# dl_nr_arfcn: Downlink NR ARFCN for EN-DC
# dl_freq: Override DL frequency corresponding to dl_earfcn
# ul_freq: Override UL frequency corresponding to dl_earfcn
# nof_carriers: Number of carriers
@ -29,6 +30,7 @@
#####################################################################
[rf]
dl_earfcn = 3350
#dl_nr_arfcn = 632628
freq_offset = 0
tx_gain = 80
#rx_gain = 40

Loading…
Cancel
Save