Skip to content

Commit c96d192

Browse files
FabianEckermanncodebot
authored andcommitted
cu_cp,rrc: store timers in rrc
1 parent 92ee1e8 commit c96d192

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

include/srsran/rrc/rrc_cell_context.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,29 @@ namespace srsran {
2121

2222
namespace srs_cu_cp {
2323

24+
/// \brief RRC timers, see TS 38.331 section 7.1.1.
25+
struct rrc_timers_t {
26+
/// T300: RRC Connection Establishment timer in ms. The timer starts upon transmission of RRCSetupRequest.
27+
std::chrono::milliseconds t300;
28+
/// T301: RRC Connection Re-establishment timer in ms. The timer starts upon transmission of
29+
/// RRCReestablishmentRequest.
30+
std::chrono::milliseconds t301;
31+
/// T310: Out-of-sync timer in ms. The timer starts upon detecting physical layer problems for the SpCell i.e. upon
32+
/// receiving N310 consecutive out-of-sync indications from lower layers.
33+
std::chrono::milliseconds t310;
34+
/// T311: RRC Connection Re-establishment procedure timer in ms. The timer starts upon initiating the RRC connection
35+
/// re-establishment procedure.
36+
std::chrono::milliseconds t311;
37+
};
38+
2439
// Cell-related configuration used by the RRC.
2540
struct rrc_cell_context {
2641
nr_cell_global_id_t cgi;
2742
tac_t tac;
2843
pci_t pci;
2944
unsigned ssb_arfcn; ///< Absolute SSB position.
3045
std::vector<nr_band> bands; ///< Required for capability band filter.
46+
rrc_timers_t timers;
3147
};
3248

3349
} // namespace srs_cu_cp

include/srsran/rrc/rrc_du.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
#include "srsran/rrc/rrc_cell_context.h"
1616
#include "srsran/rrc/rrc_metrics.h"
1717
#include "srsran/rrc/rrc_ue.h"
18+
#include <chrono>
1819

1920
namespace srsran {
2021
namespace srs_cu_cp {
2122

2223
struct rrc_cell_info {
2324
nr_band band;
2425
std::vector<rrc_meas_timing> meas_timings;
26+
rrc_timers_t timers;
2527
};
2628

2729
class rrc_du_cell_manager

lib/rrc/rrc_du_impl.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ rrc_du_impl::rrc_du_impl(const rrc_cfg_t& cfg_, rrc_du_measurement_config_notifi
3030
bool rrc_du_impl::handle_served_cell_list(const std::vector<cu_cp_du_served_cells_item>& served_cell_list)
3131
{
3232
for (const auto& served_cell : served_cell_list) {
33+
if (!served_cell.gnb_du_sys_info.has_value()) {
34+
logger.error("Missing gnb_du_sys_info for served cell");
35+
return false;
36+
}
37+
3338
rrc_cell_info cell_info;
3439

3540
// TODO: which freq band to use here?
@@ -46,21 +51,32 @@ bool rrc_du_impl::handle_served_cell_list(const std::vector<cu_cp_du_served_cell
4651
asn1::cbit_ref bref_meas{served_cell.served_cell_info.meas_timing_cfg};
4752
asn1::rrc_nr::meas_timing_cfg_s asn1_meas_timing_cfg;
4853
if (asn1_meas_timing_cfg.unpack(bref_meas) != asn1::SRSASN_SUCCESS) {
49-
logger.error("Failed to unpack Measurement Timing Config container.");
54+
logger.error("Failed to unpack Measurement Timing Config container");
5055
return false;
5156
}
5257
if (asn1_meas_timing_cfg.crit_exts.type() != meas_timing_cfg_s::crit_exts_c_::types_opts::c1 ||
5358
asn1_meas_timing_cfg.crit_exts.c1().type() !=
5459
meas_timing_cfg_s::crit_exts_c_::c1_c_::types_opts::meas_timing_conf ||
5560
asn1_meas_timing_cfg.crit_exts.c1().meas_timing_conf().meas_timing.size() == 0) {
56-
logger.error("Invalid Measurement Timing Config container.");
61+
logger.error("Invalid Measurement Timing Config container");
5762
return false;
5863
}
5964

6065
for (const auto& asn1_meas_timing : asn1_meas_timing_cfg.crit_exts.c1().meas_timing_conf().meas_timing) {
6166
cell_info.meas_timings.push_back(asn1_to_meas_timing(asn1_meas_timing));
6267
}
6368

69+
// Unpack SIB1 to store timers.
70+
asn1::rrc_nr::sib1_s sib1_msg;
71+
asn1::cbit_ref bref2(served_cell.gnb_du_sys_info.value().sib1_msg);
72+
if (sib1_msg.unpack(bref2) != asn1::SRSASN_SUCCESS) {
73+
report_fatal_error("Failed to unpack SIB1");
74+
}
75+
cell_info.timers.t300 = std::chrono::milliseconds{sib1_msg.ue_timers_and_consts.t300.to_number()};
76+
cell_info.timers.t301 = std::chrono::milliseconds{sib1_msg.ue_timers_and_consts.t301.to_number()};
77+
cell_info.timers.t310 = std::chrono::milliseconds{sib1_msg.ue_timers_and_consts.t310.to_number()};
78+
cell_info.timers.t311 = std::chrono::milliseconds{sib1_msg.ue_timers_and_consts.t311.to_number()};
79+
6480
cell_info_db.emplace(served_cell.served_cell_info.nr_cgi.nci, cell_info);
6581

6682
// Fill cell meas config.

0 commit comments

Comments
 (0)