diff --git a/lib/include/srsran/interfaces/ue_phy_interfaces.h b/lib/include/srsran/interfaces/ue_phy_interfaces.h index 245b671b5..e462f05bb 100644 --- a/lib/include/srsran/interfaces/ue_phy_interfaces.h +++ b/lib/include/srsran/interfaces/ue_phy_interfaces.h @@ -39,6 +39,8 @@ struct phy_args_t { std::vector dl_nr_arfcn_list = { 632628}; // vectorized version of dl_nr_arfcn that gets populated during init + int force_N_id_2 = -1; // Cell identity within the identity group (PSS) to filter. + float dl_freq = -1.0f; float ul_freq = -1.0f; diff --git a/srsue/hdr/phy/search.h b/srsue/hdr/phy/search.h index 57271a938..26087acf2 100644 --- a/srsue/hdr/phy/search.h +++ b/srsue/hdr/phy/search.h @@ -36,7 +36,7 @@ public: explicit search(srslog::basic_logger& logger) : logger(logger) {} ~search(); - void init(srsran::rf_buffer_t& buffer_, uint32_t nof_rx_channels, search_callback* parent); + void init(srsran::rf_buffer_t& buffer_, uint32_t nof_rx_channels, search_callback* parent, int force_N_id_2_); void reset(); float get_last_cfo(); void set_agc_enable(bool enable); diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 8ebe42b02..a03a048a7 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -396,6 +396,10 @@ static int parse_args(all_args_t* args, int argc, char* argv[]) bpo::value(&use_standard_lte_rates)->default_value(false), "Whether to use default LTE sample rates instead of shorter variants.") + ("phy.force_N_id_2", + bpo::value(&args->phy.force_N_id_2)->default_value(-1), + "Force using a specific PSS (set to -1 to allow all PSSs).") + // UE simulation args ("sim.airplane_t_on_ms", bpo::value(&args->stack.nas.sim.airplane_t_on_ms)->default_value(-1), diff --git a/srsue/src/phy/search.cc b/srsue/src/phy/search.cc index 749d0a0f3..6f36b49d2 100644 --- a/srsue/src/phy/search.cc +++ b/srsue/src/phy/search.cc @@ -46,7 +46,7 @@ search::~search() srsran_ue_cellsearch_free(&cs); } -void search::init(srsran::rf_buffer_t& buffer_, uint32_t nof_rx_channels, search_callback* parent) +void search::init(srsran::rf_buffer_t& buffer_, uint32_t nof_rx_channels, search_callback* parent, int force_N_id_2_) { p = parent; @@ -64,7 +64,7 @@ void search::init(srsran::rf_buffer_t& buffer_, uint32_t nof_rx_channels, search // Set options defined in expert section p->set_ue_sync_opts(&cs.ue_sync, 0); - force_N_id_2 = -1; + force_N_id_2 = force_N_id_2_; } void search::reset() diff --git a/srsue/src/phy/sync.cc b/srsue/src/phy/sync.cc index 2a21a40b3..0cb69bb02 100644 --- a/srsue/src/phy/sync.cc +++ b/srsue/src/phy/sync.cc @@ -81,7 +81,7 @@ void sync::init(srsran::radio_interface_phy* _radio, } // Initialize cell searcher - search_p.init(sf_buffer, nof_rf_channels, this); + search_p.init(sf_buffer, nof_rf_channels, this, worker_com->args->force_N_id_2); // Initialize SFN synchronizer, it uses only pcell buffer sfn_p.init(&ue_sync, worker_com->args, sf_buffer, sf_buffer.size());