Send radio connection with UE lost if max retx are reached

master
Pedro Alvarez 4 years ago
parent d571d26b0a
commit 37699f2215

@ -41,7 +41,7 @@ public:
std::string to_string(const activity_timeout_type_t& type);
void set_activity_timeout(const activity_timeout_type_t type);
void set_activity();
void activity_timer_expired();
void activity_timer_expired(const activity_timeout_type_t type);
void max_retx_reached();
rrc_state_t get_state();
@ -68,7 +68,7 @@ public:
enum class conn_request_result_t { success, error_mme_not_connected, error_unknown_rnti };
/// Possible causes for the RRC to transition to the idle state.
enum class rrc_idle_transition_cause { release, timeout };
enum class rrc_idle_transition_cause { release, timeout, radio_conn_with_ue_lost };
void handle_rrc_con_req(asn1::rrc::rrc_conn_request_s* msg);
void handle_rrc_con_setup_complete(asn1::rrc::rrc_conn_setup_complete_s* msg, srsran::unique_byte_buffer_t pdu);

@ -109,16 +109,30 @@ void rrc::ue::set_activity()
}
}
void rrc::ue::activity_timer_expired()
void rrc::ue::activity_timer_expired(activity_timeout_type_t type)
{
if (parent) {
parent->logger.info("Activity timer for rnti=0x%x expired after %d ms", rnti, activity_timer.time_elapsed());
if (parent->s1ap->user_exists(rnti)) {
parent->s1ap->user_release(rnti, asn1::s1ap::cause_radio_network_opts::user_inactivity);
event_logger::get().log_rrc_disconnect(ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
static_cast<unsigned>(rrc_idle_transition_cause::timeout),
rnti);
if (type == UE_INACTIVITY_TIMEOUT) {
parent->s1ap->user_release(rnti, asn1::s1ap::cause_radio_network_opts::user_inactivity);
event_logger::get().log_rrc_disconnect(ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
static_cast<unsigned>(rrc_idle_transition_cause::timeout),
rnti);
} else if (type == UE_REESTABLISH_TIMEOUT) {
parent->s1ap->user_release(rnti, asn1::s1ap::cause_radio_network_opts::radio_conn_with_ue_lost);
event_logger::get().log_rrc_disconnect(
ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
static_cast<unsigned>(rrc_idle_transition_cause::radio_conn_with_ue_lost),
rnti);
} else {
parent->s1ap->user_release(rnti, asn1::s1ap::cause_radio_network_opts::unspecified);
event_logger::get().log_rrc_disconnect(
ue_cell_list.get_ue_cc_idx(UE_PCELL_CC_IDX)->cell_common->enb_cc_idx,
static_cast<unsigned>(rrc_idle_transition_cause::radio_conn_with_ue_lost),
rnti);
}
} else {
if (rnti != SRSRAN_MRNTI) {
parent->rem_user_thread(rnti);
@ -168,7 +182,7 @@ void rrc::ue::set_activity_timeout(const activity_timeout_type_t type)
}
uint32_t deadline = deadline_s * 1e3 + deadline_ms;
activity_timer.set(deadline, [this](uint32_t tid) { activity_timer_expired(); });
activity_timer.set(deadline, [this, type](uint32_t tid) { activity_timer_expired(type); });
parent->logger.debug("Setting timer for %s for rnti=0x%x to %dms", to_string(type).c_str(), rnti, deadline);
set_activity();

Loading…
Cancel
Save