diff --git a/lib/include/srsran/interfaces/ue_nr_interfaces.h b/lib/include/srsran/interfaces/ue_nr_interfaces.h index c8bc7eafb..9ec21f069 100644 --- a/lib/include/srsran/interfaces/ue_nr_interfaces.h +++ b/lib/include/srsran/interfaces/ue_nr_interfaces.h @@ -38,10 +38,9 @@ public: * @brief Describes a cell search result */ struct cell_search_result_t { - uint32_t pci = 0; ///< Physical Cell Identifier - bool barred = false; ///< Set to true if the cell is barred - bool intra_freq_meas = false; ///< Set to true if intra frequency measurement is enabled - srsran_csi_trs_measurements_t measurements = {}; ///< Measurements from SSB block + uint32_t pci = 0; ///< Physical Cell Identifier + srsran_pbch_msg_nr_t pbch_msg; ///< Packed PBCH message for the upper layers + srsran_csi_trs_measurements_t measurements = {}; ///< Measurements from SSB block }; /** diff --git a/srsue/src/phy/nr/cell_search.cc b/srsue/src/phy/nr/cell_search.cc index d242b5f84..46aa99a33 100644 --- a/srsue/src/phy/nr/cell_search.cc +++ b/srsue/src/phy/nr/cell_search.cc @@ -19,9 +19,7 @@ namespace srsue { namespace nr { cell_search::cell_search(stack_interface_phy_sa_nr& stack_, srsran::radio_interface_phy& radio_) : - logger(srslog::fetch_basic_logger("PHY")), - stack(stack_), - radio(radio_) + logger(srslog::fetch_basic_logger("PHY")), stack(stack_), radio(radio_) {} cell_search::~cell_search() @@ -110,8 +108,7 @@ bool cell_search::run() if (res.pbch_msg.crc) { rrc_interface_phy_sa_nr::cell_search_result_t cs_res = {}; cs_res.pci = res.N_id; - cs_res.barred = false; - cs_res.intra_freq_meas = false; + cs_res.pbch_msg = res.pbch_msg; cs_res.measurements = res.measurements; stack.cell_search_found_cell(cs_res); } diff --git a/srsue/src/phy/test/CMakeLists.txt b/srsue/src/phy/test/CMakeLists.txt index b26ce8bec..ebc8e8cf3 100644 --- a/srsue/src/phy/test/CMakeLists.txt +++ b/srsue/src/phy/test/CMakeLists.txt @@ -78,5 +78,6 @@ target_link_libraries(nr_sa_cell_search_test srsran_common srsran_phy srsran_radio + rrc_nr_asn1 ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) \ No newline at end of file diff --git a/srsue/src/phy/test/nr_sa_cell_search_test.cc b/srsue/src/phy/test/nr_sa_cell_search_test.cc index 02f10cb18..419a7aba7 100644 --- a/srsue/src/phy/test/nr_sa_cell_search_test.cc +++ b/srsue/src/phy/test/nr_sa_cell_search_test.cc @@ -10,6 +10,7 @@ * */ +#include "srsran/asn1/rrc_nr.h" #include "srsran/common/band_helper.h" #include "srsue/hdr/phy/phy_nr_sa.h" @@ -179,15 +180,20 @@ public: } void cell_search_found_cell(const cell_search_result_t& result) override { - std::array csi_info = {}; + // Unpack MIB with ASN1 + asn1::rrc_nr::mib_s mib; + asn1::cbit_ref cbit(result.pbch_msg.payload, SRSRAN_PBCH_MSG_NR_SZ); + mib.unpack(cbit); + + // Convert MIB to JSON + asn1::json_writer json; + mib.to_json(json); - srsran_csi_meas_info(&result.measurements, csi_info.data(), (uint32_t)csi_info.size()); + // Convert CSI to string + std::array csi_info = {}; + srsran_csi_meas_info_short(&result.measurements, csi_info.data(), (uint32_t)csi_info.size()); - logger.info("Cell found pci=%d barred=%c intra_freq=%c %s", - result.pci, - result.barred ? 'y' : 'n', - result.intra_freq_meas ? 'y' : 'n', - csi_info.data()); + logger.info("Cell found pci=%d %s MIB: %s", result.pci, csi_info.data(), json.to_string().c_str()); } int sf_indication(const uint32_t tti) override {