UE NR SA interface expects PBCH message instead of spare fields

master
Xavier Arteaga 3 years ago committed by Ismael Gomez
parent fb17e3326f
commit f5446422bc

@ -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
};
/**

@ -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);
}

@ -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})

@ -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<char, 512> 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<char, 512> 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
{

Loading…
Cancel
Save