From b792a3158cce0bcef9a736efeb65992bb6351d96 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Thu, 5 Dec 2019 16:57:38 +0000 Subject: [PATCH] removed magic numbers for s1ap timers, and handled the error in the s1 ho cmd --- srsenb/hdr/stack/upper/s1ap.h | 3 +++ srsenb/src/stack/upper/s1ap.cc | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/srsenb/hdr/stack/upper/s1ap.h b/srsenb/hdr/stack/upper/s1ap.h index c44b76871..f7e07c49b 100644 --- a/srsenb/hdr/stack/upper/s1ap.h +++ b/srsenb/hdr/stack/upper/s1ap.h @@ -50,6 +50,9 @@ typedef struct { class s1ap : public s1ap_interface_rrc { public: + static const uint32_t ts1_reloc_prep_timeout_ms = 10000; + static const uint32_t ts1_reloc_overall_timeout_ms = 10000; + s1ap(); bool init(s1ap_args_t args_, rrc_interface_s1ap* rrc_, diff --git a/srsenb/src/stack/upper/s1ap.cc b/srsenb/src/stack/upper/s1ap.cc index e79c6b5ac..91d7f7373 100644 --- a/srsenb/src/stack/upper/s1ap.cc +++ b/srsenb/src/stack/upper/s1ap.cc @@ -837,6 +837,7 @@ bool s1ap::handle_s1hocommand(LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT& msg) auto user_it = users.find(enbid_to_rnti_map[msg.eNB_UE_S1AP_ID.ENB_UE_S1AP_ID]); if (user_it == users.end()) { s1ap_log->error("user rnti=0x%x no longer exists\n", user_it->first); + return false; } user_it->second->get_ho_prep_proc().trigger(msg); return true; @@ -1354,9 +1355,10 @@ s1ap::ue::ue(uint16_t rnti_, s1ap* s1ap_ptr_) : s1ap_ptr(s1ap_ptr_), s1ap_log(s1 // initialize timers ts1_reloc_prep = s1ap_ptr->timers->get_unique_timer(); - ts1_reloc_prep.set(10000, [this](uint32_t tid) { ho_prep_proc.trigger(ho_prep_proc_t::ts1_reloc_prep_expired{}); }); + ts1_reloc_prep.set(ts1_reloc_prep_timeout_ms, + [this](uint32_t tid) { ho_prep_proc.trigger(ho_prep_proc_t::ts1_reloc_prep_expired{}); }); ts1_reloc_overall = s1ap_ptr->timers->get_unique_timer(); - ts1_reloc_overall.set(10000, [this](uint32_t tid) {}); + ts1_reloc_overall.set(ts1_reloc_overall_timeout_ms, [](uint32_t tid) { /* TODO */ }); } bool s1ap::ue::send_ho_required(uint32_t target_eci,