From 90bba3b85e1f45c55d8e970c7106f02f02bd0f2d Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 30 Mar 2021 18:36:45 +0100 Subject: [PATCH] s1ap - set s1 handover cause as s1 intra system handover triggered --- srsenb/src/stack/upper/s1ap.cc | 5 +-- srsenb/test/upper/s1ap_test.cc | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 srsenb/test/upper/s1ap_test.cc diff --git a/srsenb/src/stack/upper/s1ap.cc b/srsenb/src/stack/upper/s1ap.cc index 953361f35..59a657a16 100644 --- a/srsenb/src/stack/upper/s1ap.cc +++ b/srsenb/src/stack/upper/s1ap.cc @@ -23,11 +23,9 @@ #include #include #include -#include #include #include #include -#include //for close(), sleep() using srsran::s1ap_mccmnc_to_plmn; using srsran::uint32_to_uint8; @@ -1705,8 +1703,7 @@ bool s1ap::ue::send_ho_required(uint32_t target_eci, container.mme_ue_s1ap_id.value = ctxt.mme_ue_s1ap_id; container.direct_forwarding_path_availability_present = false; // NOTE: X2 for fwd path not supported container.handov_type.value.value = handov_type_opts::intralte; // NOTE: only intra-LTE HO supported - container.cause.value.set_radio_network().value = cause_radio_network_opts::unspecified; - // LIBLTE_S1AP_CAUSERADIONETWORK_S1_INTRA_SYSTEM_HANDOVER_TRIGGERED; + container.cause.value.set_radio_network().value = cause_radio_network_opts::s1_intra_sys_ho_triggered; /*** set the target eNB ***/ container.csg_id_present = false; // NOTE: CSG/hybrid target cell not supported diff --git a/srsenb/test/upper/s1ap_test.cc b/srsenb/test/upper/s1ap_test.cc new file mode 100644 index 000000000..611adfb53 --- /dev/null +++ b/srsenb/test/upper/s1ap_test.cc @@ -0,0 +1,58 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2021 Software Radio Systems Limited + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the distribution. + * + */ + +#include "srsenb/hdr/stack/upper/s1ap.h" +#include "srsenb/test/common/dummy_classes.h" +#include "srsran/common/test_common.h" + +using namespace srsenb; + +class stack_dummy : public srsenb::stack_interface_s1ap_lte +{ +public: + void add_mme_socket(int fd) {} + void remove_mme_socket(int fd) {} +}; + +void test_s1ap_erab_setup() +{ + srsran::task_scheduler task_sched; + srslog::basic_logger& logger = srslog::fetch_basic_logger("S1AP"); + s1ap s1ap_obj(&task_sched, logger); + rrc_dummy rrc; + stack_dummy stack; + + s1ap_args_t args = {}; + args.cell_id = 0x01; + args.enb_id = 0x19B; + args.mcc = 907; + args.mnc = 70; + args.s1c_bind_addr = "127.0.0.100"; + args.tac = 7; + args.gtp_bind_addr = "127.0.0.100"; + args.mme_addr = "127.0.0.1"; + + TESTASSERT(s1ap_obj.init(args, &rrc, &stack) == SRSRAN_SUCCESS); +} + +int main(int argc, char** argv) +{ + // Setup logging. + auto& logger = srslog::fetch_basic_logger("S1AP"); + logger.set_level(srslog::basic_levels::debug); + logger.set_hex_dump_max_size(-1); + + // Start the log backend. + srsran::test_init(argc, argv); + + test_s1ap_erab_setup(); +} \ No newline at end of file