Added option for simulated measurement

This commit is contained in:
David Rupprecht 2021-04-20 16:20:48 +02:00 committed by Andre Puschmann
parent 1a4de831e9
commit d2aa25d451
4 changed files with 38 additions and 35 deletions

View File

@ -40,6 +40,7 @@ struct core_less_args_t {
struct rrc_nr_args_t { struct rrc_nr_args_t {
core_less_args_t coreless; core_less_args_t coreless;
uint32_t sim_nr_meas_pci;
std::string supported_bands_nr_str; std::string supported_bands_nr_str;
std::vector<uint32_t> supported_bands_nr; std::vector<uint32_t> supported_bands_nr;
std::vector<uint32_t> supported_bands_eutra; std::vector<uint32_t> supported_bands_eutra;
@ -154,8 +155,8 @@ private:
usim_interface_rrc_nr* usim = nullptr; usim_interface_rrc_nr* usim = nullptr;
stack_interface_rrc* stack = nullptr; stack_interface_rrc* stack = nullptr;
uint32_t fake_measurement_carrier_freq_r15; uint32_t sim_measurement_carrier_freq_r15;
srsran::timer_handler::unique_timer fake_measurement_timer; srsran::timer_handler::unique_timer sim_measurement_timer;
/// RRC states (3GPP 38.331 v15.5.1 Sec 4.2.1) /// RRC states (3GPP 38.331 v15.5.1 Sec 4.2.1)
enum rrc_nr_state_t { enum rrc_nr_state_t {

View File

@ -121,14 +121,15 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
("rat.nr.nof_carriers", bpo::value<uint32_t>(&args->phy.nof_nr_carriers)->default_value(0), "Number of NR carriers") ("rat.nr.nof_carriers", bpo::value<uint32_t>(&args->phy.nof_nr_carriers)->default_value(0), "Number of NR carriers")
("rat.nr.nof_prb", bpo::value<uint32_t>(&args->phy.nr_nof_prb)->default_value(52), "NR carrier bandwidth") ("rat.nr.nof_prb", bpo::value<uint32_t>(&args->phy.nr_nof_prb)->default_value(52), "NR carrier bandwidth")
("rrc.feature_group", bpo::value<uint32_t>(&args->stack.rrc.feature_group)->default_value(0xe6041000), "Hex value of the featureGroupIndicators field in the" ("rrc.feature_group", bpo::value<uint32_t>(&args->stack.rrc.feature_group)->default_value(0xe6041000), "Hex value of the featureGroupIndicators field in the"
"UECapabilityInformation message. Default 0xe6041000") "UECapabilityInformation message. Default 0xe6041000")
("rrc.ue_category", bpo::value<string>(&args->stack.rrc.ue_category_str)->default_value(SRSRAN_UE_CATEGORY_DEFAULT), "UE Category (1 to 10)") ("rrc.ue_category", bpo::value<string>(&args->stack.rrc.ue_category_str)->default_value(SRSRAN_UE_CATEGORY_DEFAULT), "UE Category (1 to 10)")
("rrc.ue_category_dl", bpo::value<int>(&args->stack.rrc.ue_category_dl)->default_value(-1), "UE Category DL v12 (valid values: 0, 4, 6, 7, 9 to 16)") ("rrc.ue_category_dl", bpo::value<int>(&args->stack.rrc.ue_category_dl)->default_value(-1), "UE Category DL v12 (valid values: 0, 4, 6, 7, 9 to 16)")
("rrc.ue_category_ul", bpo::value<int>(&args->stack.rrc.ue_category_ul)->default_value(-1), "UE Category UL v12 (valid values: 0, 3, 5, 7, 8 and 13)") ("rrc.ue_category_ul", bpo::value<int>(&args->stack.rrc.ue_category_ul)->default_value(-1), "UE Category UL v12 (valid values: 0, 3, 5, 7, 8 and 13)")
("rrc.release", bpo::value<uint32_t>(&args->stack.rrc.release)->default_value(SRSRAN_RELEASE_DEFAULT), "UE Release (8 to 15)") ("rrc.release", bpo::value<uint32_t>(&args->stack.rrc.release)->default_value(SRSRAN_RELEASE_DEFAULT), "UE Release (8 to 15)")
("rrc.mbms_service_id", bpo::value<int32_t>(&args->stack.rrc.mbms_service_id)->default_value(-1), "MBMS service id for autostart (-1 means disabled)") ("rrc.mbms_service_id", bpo::value<int32_t>(&args->stack.rrc.mbms_service_id)->default_value(-1), "MBMS service id for autostart (-1 means disabled)")
("rrc.mbms_service_port", bpo::value<uint32_t>(&args->stack.rrc.mbms_service_port)->default_value(4321), "Port of the MBMS service") ("rrc.mbms_service_port", bpo::value<uint32_t>(&args->stack.rrc.mbms_service_port)->default_value(4321), "Port of the MBMS service")
("rrc.nr_measurement_pci", bpo::value<uint32_t>(&args->stack.rrc_nr.sim_nr_meas_pci)->default_value(500), "NR PCI for the simulated NR measurement")
("nas.apn", bpo::value<string>(&args->stack.nas.apn_name)->default_value(""), "Set Access Point Name (APN) for data services") ("nas.apn", bpo::value<string>(&args->stack.nas.apn_name)->default_value(""), "Set Access Point Name (APN) for data services")
("nas.apn_protocol", bpo::value<string>(&args->stack.nas.apn_protocol)->default_value(""), "Set Access Point Name (APN) protocol for data services") ("nas.apn_protocol", bpo::value<string>(&args->stack.nas.apn_protocol)->default_value(""), "Set Access Point Name (APN) protocol for data services")

View File

@ -58,7 +58,7 @@ void rrc_nr::init(phy_interface_rrc_nr* phy_,
args = args_; args = args_;
running = true; running = true;
fake_measurement_timer = task_sched.get_unique_timer(); sim_measurement_timer = task_sched.get_unique_timer();
} }
void rrc_nr::stop() void rrc_nr::stop()
@ -103,22 +103,22 @@ const char* rrc_nr::get_rb_name(uint32_t lcid)
void rrc_nr::timer_expired(uint32_t timeout_id) void rrc_nr::timer_expired(uint32_t timeout_id)
{ {
logger.debug("Handling Timer Expired"); logger.debug("Handling Timer Expired");
if (timeout_id == fake_measurement_timer.id()) { if (timeout_id == sim_measurement_timer.id()) {
logger.debug("Triggered Fake Measurement"); logger.debug("Triggered simulated measurement");
phy_meas_nr_t fake_meas = {}; phy_meas_nr_t sim_meas = {};
std::vector<phy_meas_nr_t> phy_meas_nr; std::vector<phy_meas_nr_t> phy_meas_nr;
fake_meas.rsrp = -60.0; sim_meas.rsrp = -60.0;
fake_meas.rsrq = -60.0; sim_meas.rsrq = -60.0;
fake_meas.cfo_hz = 1.0; sim_meas.cfo_hz = 1.0;
fake_meas.arfcn_nr = fake_measurement_carrier_freq_r15; sim_meas.arfcn_nr = sim_measurement_carrier_freq_r15;
fake_meas.pci_nr = 500; sim_meas.pci_nr = args.sim_nr_meas_pci;
phy_meas_nr.push_back(fake_meas); phy_meas_nr.push_back(sim_meas);
rrc_eutra->new_cell_meas_nr(phy_meas_nr); rrc_eutra->new_cell_meas_nr(phy_meas_nr);
auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); }; auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); };
fake_measurement_timer.set(10, timer_expire_func); sim_measurement_timer.set(10, timer_expire_func);
fake_measurement_timer.run(); sim_measurement_timer.run();
} }
} }
@ -405,10 +405,10 @@ void rrc_nr::get_nr_capabilities(srsran::byte_buffer_t* nr_caps_pdu)
void rrc_nr::phy_meas_stop() void rrc_nr::phy_meas_stop()
{ {
// possbile race condition for fake_measurement timer, which might be set at the same moment as stopped => fix with // possbile race condition for sim_measurement timer, which might be set at the same moment as stopped => fix with
// phy integration // phy integration
logger.debug("Stopping fake measurements"); logger.debug("Stopping simulated measurements");
fake_measurement_timer.stop(); sim_measurement_timer.stop();
} }
void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15) void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15)
@ -416,9 +416,9 @@ void rrc_nr::phy_set_cells_to_meas(uint32_t carrier_freq_r15)
logger.debug("Measuring phy cell %d ", carrier_freq_r15); logger.debug("Measuring phy cell %d ", carrier_freq_r15);
// Start timer for fake measurements // Start timer for fake measurements
auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); }; auto timer_expire_func = [this](uint32_t tid) { timer_expired(tid); };
fake_measurement_carrier_freq_r15 = carrier_freq_r15; sim_measurement_carrier_freq_r15 = carrier_freq_r15;
fake_measurement_timer.set(10, timer_expire_func); sim_measurement_timer.set(10, timer_expire_func);
fake_measurement_timer.run(); sim_measurement_timer.run();
} }
bool rrc_nr::configure_sk_counter(uint16_t sk_counter) bool rrc_nr::configure_sk_counter(uint16_t sk_counter)

View File

@ -147,13 +147,14 @@ imei = 353490069873319
##################################################################### #####################################################################
# RRC configuration # RRC configuration
# #
# ue_category: Sets UE category (range 1-5). Default: 4 # ue_category: Sets UE category (range 1-5). Default: 4
# release: UE Release (8 to 15) # release: UE Release (8 to 15)
# feature_group: Hex value of the featureGroupIndicators field in the # feature_group: Hex value of the featureGroupIndicators field in the
# UECapabilityInformation message. Default 0xe6041000 # UECapabilityInformation message. Default 0xe6041000
# mbms_service_id: MBMS service id for autostarting MBMS reception # mbms_service_id: MBMS service id for autostarting MBMS reception
# (default -1 means disabled) # (default -1 means disabled)
# mbms_service_port: Port of the MBMS service # mbms_service_port: Port of the MBMS service
# nr_measurement_pci: NR PCI for the simulated NR measurement. Default: 500
##################################################################### #####################################################################
[rrc] [rrc]
#ue_category = 4 #ue_category = 4