Move rrc_common from srsue to lib

master
Ismael Gomez 3 years ago committed by Andre Puschmann
parent 8830c2796f
commit c09f09b7be

@ -13,23 +13,15 @@
#ifndef SRSUE_RRC_COMMON_H
#define SRSUE_RRC_COMMON_H
namespace srsue {
namespace srsran {
#include <stdint.h>
// RRC states (3GPP 36.331 v10.0.0)
typedef enum {
RRC_STATE_IDLE = 0,
RRC_STATE_CONNECTED,
RRC_STATE_N_ITEMS,
} rrc_state_t;
static const char rrc_state_text[RRC_STATE_N_ITEMS][100] = {"IDLE", "CONNECTED"};
enum quant_s { quant_rsrp, quant_rsrq };
uint8_t rrc_value_to_range(quant_s quant, const float value);
float rrc_range_to_value(quant_s quant, const uint8_t range);
} // namespace srsue
} // namespace srsran
#endif // SRSUE_RRC_COMMON_H

@ -24,6 +24,7 @@ set(SOURCES arch_select.cc
pcap.c
phy_cfg_nr.cc
phy_cfg_nr_default.cc
rrc_common.cc
rlc_pcap.cc
s1ap_pcap.cc
security.cc

@ -10,9 +10,9 @@
*
*/
#include "srsue/hdr/stack/rrc/rrc_common.h"
#include "srsran/rrc/rrc_common.h"
namespace srsue {
namespace srsran {
uint8_t rrc_value_to_range(quant_s quant, const float value)
{
@ -48,4 +48,4 @@ float rrc_range_to_value(quant_s quant, const uint8_t range)
return val;
}
} // namespace srsue
} // namespace srsran

@ -14,7 +14,6 @@
#define SRSUE_RRC_H
#include "rrc_cell.h"
#include "rrc_common.h"
#include "rrc_metrics.h"
#include "rrc_rlf_report.h"
#include "srsran/asn1/rrc_utils.h"
@ -26,6 +25,7 @@
#include "srsran/common/security.h"
#include "srsran/common/stack_procedure.h"
#include "srsran/interfaces/ue_interfaces.h"
#include "srsran/rrc/rrc_common.h"
#include "srsran/srslog/srslog.h"
#include <map>

@ -13,11 +13,18 @@
#ifndef SRSUE_RRC_METRICS_H
#define SRSUE_RRC_METRICS_H
#include "rrc_common.h"
#include "srsran/interfaces/phy_interface_types.h"
namespace srsue {
// RRC states (3GPP 36.331 v10.0.0)
typedef enum {
RRC_STATE_IDLE = 0,
RRC_STATE_CONNECTED,
RRC_STATE_N_ITEMS,
} rrc_state_t;
static const char rrc_state_text[RRC_STATE_N_ITEMS][100] = {"IDLE", "CONNECTED"};
struct rrc_metrics_t {
rrc_state_t state;
std::vector<phy_meas_t> neighbour_cells;

@ -8,7 +8,7 @@
add_subdirectory(test)
set(SOURCES rrc.cc rrc_procedures.cc rrc_meas.cc rrc_cell.cc rrc_common.cc rrc_rlf_report.cc phy_controller.cc)
set(SOURCES rrc.cc rrc_procedures.cc rrc_meas.cc rrc_cell.cc rrc_rlf_report.cc phy_controller.cc)
add_library(srsue_rrc STATIC ${SOURCES})
set(SOURCES rrc_nr.cc)

@ -11,7 +11,7 @@
*/
#include "srsue/hdr/stack/rrc/rrc_rlf_report.h"
#include "srsue/hdr/stack/rrc/rrc_common.h"
#include "srsran/rrc/rrc_common.h"
namespace srsue {
@ -39,9 +39,9 @@ void rrc_rlf_report::set_failure(meas_cell_list<meas_cell_eutra>& meas_cells, fa
// set the measResultLastServCell to include the RSRP and RSRQ, if available, of the PCell based on
// measurements collected up to the moment the UE detected radio link failure
rlf_report.meas_result_last_serv_cell_r9.rsrp_result_r9 =
rrc_value_to_range(quant_rsrp, meas_cells.serving_cell().get_rsrp());
rrc_value_to_range(srsran::quant_rsrp, meas_cells.serving_cell().get_rsrp());
rlf_report.meas_result_last_serv_cell_r9.rsrq_result_r9 =
rrc_value_to_range(quant_rsrq, meas_cells.serving_cell().get_rsrq());
rrc_value_to_range(srsran::quant_rsrq, meas_cells.serving_cell().get_rsrq());
rlf_report.meas_result_last_serv_cell_r9.rsrq_result_r9_present = true;
// set the measResultNeighCells to include the best measured cells, other than the PCell, ordered such that
@ -61,8 +61,8 @@ void rrc_rlf_report::set_failure(meas_cell_list<meas_cell_eutra>& meas_cells, fa
meas.pci = f->get_pci();
meas.meas_result.rsrp_result_present = true;
meas.meas_result.rsrq_result_present = true;
meas.meas_result.rsrp_result = rrc_value_to_range(quant_rsrp, f->get_rsrp());
meas.meas_result.rsrq_result = rrc_value_to_range(quant_rsrq, f->get_rsrq());
meas.meas_result.rsrp_result = rrc_value_to_range(srsran::quant_rsrp, f->get_rsrp());
meas.meas_result.rsrq_result = rrc_value_to_range(srsran::quant_rsrq, f->get_rsrq());
meas2.meas_result_list_r9.push_back(meas);
rlf_report.meas_result_neigh_cells_r9.meas_result_list_eutra_r9.push_back(meas2);
}

Loading…
Cancel
Save