From 30ae2226c1b1ba2fe721e10f6914ddff7ce59830 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Mon, 30 Mar 2020 18:53:05 +0100 Subject: [PATCH] common interface for stack multiqueue tasks, background tasks and timers --- lib/include/srslte/common/interfaces_common.h | 12 +++++++ .../srslte/interfaces/enb_interfaces.h | 9 +---- lib/include/srslte/interfaces/ue_interfaces.h | 27 ++------------- .../include/srslte/test/ue_test_interfaces.h | 2 +- lib/include/srslte/upper/pdcp.h | 8 ++--- lib/include/srslte/upper/pdcp_entity_base.h | 6 ++-- lib/include/srslte/upper/pdcp_entity_lte.h | 10 +++--- lib/include/srslte/upper/pdcp_entity_nr.h | 10 +++--- lib/src/upper/pdcp.cc | 12 +++++-- lib/src/upper/pdcp_entity_base.cc | 6 +++- lib/src/upper/pdcp_entity_lte.cc | 12 +++---- lib/src/upper/pdcp_entity_nr.cc | 16 ++++----- lib/test/upper/pdcp_lte_test.h | 6 ++-- lib/test/upper/pdcp_lte_test_rx.cc | 2 +- lib/test/upper/pdcp_nr_test.h | 14 ++++---- lib/test/upper/pdcp_nr_test_discard_sdu.cc | 2 +- lib/test/upper/pdcp_nr_test_rx.cc | 2 +- srsenb/hdr/stack/enb_stack_lte.h | 5 ++- srsenb/hdr/stack/upper/pdcp.h | 14 ++++---- srsenb/src/stack/enb_stack_lte.cc | 19 +++++++++-- srsenb/src/stack/mac/mac.cc | 2 +- srsenb/src/stack/upper/pdcp.cc | 6 ++-- srsue/hdr/stack/mac/mac.h | 7 ++-- srsue/hdr/stack/mac/proc_bsr.h | 10 +++--- srsue/hdr/stack/mac/proc_phr.h | 16 ++++----- srsue/hdr/stack/mac/proc_ra.h | 14 ++++---- srsue/hdr/stack/ue_stack_lte.h | 2 -- srsue/hdr/stack/upper/nas.h | 12 +++---- srsue/src/stack/mac/mac.cc | 5 ++- srsue/src/stack/mac/proc_bsr.cc | 2 +- srsue/src/stack/mac/proc_phr.cc | 6 ++-- srsue/src/stack/mac/proc_ra.cc | 2 +- srsue/src/stack/ue_stack_lte.cc | 2 +- srsue/src/stack/upper/nas.cc | 12 +++---- srsue/test/mac_test.cc | 4 +-- srsue/test/ttcn3/hdr/ttcn3_syssim.h | 33 +++++++++---------- srsue/test/upper/nas_test.cc | 10 +++--- srsue/test/upper/rrc_meas_test.cc | 28 ++++++++-------- 38 files changed, 191 insertions(+), 176 deletions(-) rename srsue/test/common/dummy_classes.h => lib/include/srslte/test/ue_test_interfaces.h (95%) diff --git a/lib/include/srslte/common/interfaces_common.h b/lib/include/srslte/common/interfaces_common.h index b9ea023bf..de49a659c 100644 --- a/lib/include/srslte/common/interfaces_common.h +++ b/lib/include/srslte/common/interfaces_common.h @@ -22,6 +22,7 @@ #ifndef SRSLTE_INTERFACES_COMMON_H #define SRSLTE_INTERFACES_COMMON_H +#include "srslte/common/multiqueue.h" #include "srslte/common/security.h" #include "srslte/common/timers.h" #include @@ -77,6 +78,17 @@ public: virtual int read_pdu(uint32_t lcid, uint8_t* payload, uint32_t requested_bytes) = 0; }; +// Generic Task Management + Timer interface for upper stack +class task_handler_interface +{ +public: + virtual srslte::timer_handler::unique_timer get_unique_timer() = 0; + virtual srslte::task_multiqueue::queue_handler make_task_queue() = 0; + virtual void defer_callback(uint32_t duration_ms, std::function func) = 0; + virtual void enqueue_background_task(std::function task) = 0; + virtual void notify_background_task_result(srslte::move_task_t task) = 0; +}; + } // namespace srslte #endif // SRSLTE_INTERFACES_COMMON_H diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index 54d48d8dc..48524892f 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -508,13 +508,6 @@ typedef struct { int link_failure_nof_err; } mac_args_t; -class enb_task_interface_lte -{ -public: - virtual srslte::timer_handler::unique_timer get_unique_timer() = 0; - virtual srslte::task_multiqueue::queue_handler get_task_queue() = 0; -}; - class stack_interface_s1ap_lte { public: @@ -530,7 +523,7 @@ public: }; // STACK interface for MAC -class stack_interface_mac_lte : public enb_task_interface_lte +class stack_interface_mac_lte : public srslte::task_handler_interface { }; diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index c35b7f301..efa453ccf 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -207,8 +207,8 @@ public: class nas_interface_ue { public: - virtual void start_attach_proc(srslte::proc_state_t* proc_result, srslte::establishment_cause_t cause_) = 0; - virtual bool detach_request(const bool switch_off) = 0; + virtual void start_attach_proc(srslte::proc_state_t* proc_result, srslte::establishment_cause_t cause_) = 0; + virtual bool detach_request(const bool switch_off) = 0; }; // PDCP interface for RRC @@ -598,29 +598,8 @@ class gw_interface_stack : public gw_interface_nas, public gw_interface_rrc, pub { }; -// Generic Task Management + Timer interface for upper stack -class task_handler_interface_lte -{ -public: - virtual srslte::timer_handler::unique_timer get_unique_timer() = 0; - virtual srslte::task_multiqueue::queue_handler make_task_queue() = 0; - virtual void enqueue_background_task(std::function task) = 0; - virtual void notify_background_task_result(srslte::move_task_t task) = 0; - virtual void defer_callback(uint32_t duration_ms, std::function func) = 0; -}; - -// STACK interface for MAC -class stack_interface_mac : public task_handler_interface_lte -{ -}; - -// STACK interface for MAC -class stack_interface_nas : public task_handler_interface_lte -{ -}; - // STACK interface for RRC -class stack_interface_rrc : public task_handler_interface_lte +class stack_interface_rrc : public srslte::task_handler_interface { public: virtual void start_cell_search() = 0; diff --git a/srsue/test/common/dummy_classes.h b/lib/include/srslte/test/ue_test_interfaces.h similarity index 95% rename from srsue/test/common/dummy_classes.h rename to lib/include/srslte/test/ue_test_interfaces.h index 8bd1d3ed0..6f52898fc 100644 --- a/srsue/test/common/dummy_classes.h +++ b/lib/include/srslte/test/ue_test_interfaces.h @@ -26,7 +26,7 @@ namespace srsue { -class stack_dummy_interface : public stack_interface_rrc, public stack_interface_mac, public stack_interface_nas +class stack_test_dummy : public stack_interface_rrc { public: srslte::timer_handler::unique_timer get_unique_timer() override { return timers.get_unique_timer(); } diff --git a/lib/include/srslte/upper/pdcp.h b/lib/include/srslte/upper/pdcp.h index 148d4668e..f771bb03c 100644 --- a/lib/include/srslte/upper/pdcp.h +++ b/lib/include/srslte/upper/pdcp.h @@ -32,7 +32,7 @@ namespace srslte { class pdcp : public srsue::pdcp_interface_rlc, public srsue::pdcp_interface_rrc { public: - pdcp(srslte::timer_handler* timers_, const char* logname); + pdcp(srslte::task_handler_interface* task_executor_, const char* logname); virtual ~pdcp(); void init(srsue::rlc_interface_pdcp* rlc_, srsue::rrc_interface_pdcp* rrc_, srsue::gw_interface_pdcp* gw_); void stop(); @@ -71,9 +71,9 @@ private: typedef std::map pdcp_map_t; typedef std::pair pdcp_map_pair_t; - srslte::timer_handler* timers = nullptr; - srslte::log_ref pdcp_log; - pdcp_map_t pdcp_array, pdcp_array_mrb; + srslte::task_handler_interface* task_executor = nullptr; + srslte::log_ref pdcp_log; + pdcp_map_t pdcp_array, pdcp_array_mrb; // cache valid lcids to be checked from separate thread std::mutex cache_mutex; diff --git a/lib/include/srslte/upper/pdcp_entity_base.h b/lib/include/srslte/upper/pdcp_entity_base.h index 9d9a7b92c..135d244ac 100644 --- a/lib/include/srslte/upper/pdcp_entity_base.h +++ b/lib/include/srslte/upper/pdcp_entity_base.h @@ -63,7 +63,7 @@ static const char srslte_direction_text[DIRECTION_N_ITEMS][6] = {"none", "tx", " class pdcp_entity_base { public: - pdcp_entity_base(srslte::timer_handler* timers_, srslte::log_ref log_); + pdcp_entity_base(srslte::task_handler_interface* task_executor_, srslte::log_ref log_); virtual ~pdcp_entity_base(); virtual void reset() = 0; virtual void reestablish() = 0; @@ -111,8 +111,8 @@ public: uint32_t COUNT(uint32_t hfn, uint32_t sn); protected: - srslte::log_ref log; - srslte::timer_handler* timers = nullptr; + srslte::log_ref log; + srslte::task_handler_interface* task_executor = nullptr; bool active = false; uint32_t lcid = 0; diff --git a/lib/include/srslte/upper/pdcp_entity_lte.h b/lib/include/srslte/upper/pdcp_entity_lte.h index 6ffeb47e0..d8f299bbd 100644 --- a/lib/include/srslte/upper/pdcp_entity_lte.h +++ b/lib/include/srslte/upper/pdcp_entity_lte.h @@ -46,11 +46,11 @@ namespace srslte { class pdcp_entity_lte final : public pdcp_entity_base { public: - pdcp_entity_lte(srsue::rlc_interface_pdcp* rlc_, - srsue::rrc_interface_pdcp* rrc_, - srsue::gw_interface_pdcp* gw_, - srslte::timer_handler* timers_, - srslte::log_ref log_); + pdcp_entity_lte(srsue::rlc_interface_pdcp* rlc_, + srsue::rrc_interface_pdcp* rrc_, + srsue::gw_interface_pdcp* gw_, + srslte::task_handler_interface* task_executor_, + srslte::log_ref log_); ~pdcp_entity_lte(); void init(uint32_t lcid_, pdcp_config_t cfg_); void reset(); diff --git a/lib/include/srslte/upper/pdcp_entity_nr.h b/lib/include/srslte/upper/pdcp_entity_nr.h index 244ff96a7..e4e3f5282 100644 --- a/lib/include/srslte/upper/pdcp_entity_nr.h +++ b/lib/include/srslte/upper/pdcp_entity_nr.h @@ -41,11 +41,11 @@ namespace srslte { class pdcp_entity_nr : public pdcp_entity_base { public: - pdcp_entity_nr(srsue::rlc_interface_pdcp* rlc_, - srsue::rrc_interface_pdcp* rrc_, - srsue::gw_interface_pdcp* gw_, - srslte::timer_handler* timers_, - srslte::log_ref log_); + pdcp_entity_nr(srsue::rlc_interface_pdcp* rlc_, + srsue::rrc_interface_pdcp* rrc_, + srsue::gw_interface_pdcp* gw_, + srslte::task_handler_interface* task_executor_, + srslte::log_ref log_); ~pdcp_entity_nr(); void init(uint32_t lcid_, pdcp_config_t cfg_); void reset(); diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 7f9916ac2..bbc6c2dd1 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -23,7 +23,11 @@ namespace srslte { -pdcp::pdcp(srslte::timer_handler* timers_, const char* logname) : timers(timers_), pdcp_log(logname) {} +pdcp::pdcp(srslte::task_handler_interface* task_executor_, const char* logname) : + task_executor(task_executor_), + pdcp_log(logname) +{ +} pdcp::~pdcp() { @@ -110,7 +114,8 @@ void pdcp::write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu) void pdcp::add_bearer(uint32_t lcid, pdcp_config_t cfg) { if (not valid_lcid(lcid)) { - if (not pdcp_array.insert(pdcp_map_pair_t(lcid, new pdcp_entity_lte(rlc, rrc, gw, timers, pdcp_log))).second) { + if (not pdcp_array.insert(pdcp_map_pair_t(lcid, new pdcp_entity_lte(rlc, rrc, gw, task_executor, pdcp_log))) + .second) { pdcp_log->error("Error inserting PDCP entity in to array\n."); return; } @@ -132,7 +137,8 @@ void pdcp::add_bearer(uint32_t lcid, pdcp_config_t cfg) void pdcp::add_bearer_mrb(uint32_t lcid, pdcp_config_t cfg) { if (not valid_mch_lcid(lcid)) { - if (not pdcp_array_mrb.insert(pdcp_map_pair_t(lcid, new pdcp_entity_lte(rlc, rrc, gw, timers, pdcp_log))).second) { + if (not pdcp_array_mrb.insert(pdcp_map_pair_t(lcid, new pdcp_entity_lte(rlc, rrc, gw, task_executor, pdcp_log))) + .second) { pdcp_log->error("Error inserting PDCP entity in to array\n."); return; } diff --git a/lib/src/upper/pdcp_entity_base.cc b/lib/src/upper/pdcp_entity_base.cc index 538eaf3a8..749b83080 100644 --- a/lib/src/upper/pdcp_entity_base.cc +++ b/lib/src/upper/pdcp_entity_base.cc @@ -26,7 +26,11 @@ namespace srslte { -pdcp_entity_base::pdcp_entity_base(srslte::timer_handler* timers_, srslte::log_ref log_) : log(log_), timers(timers_) {} +pdcp_entity_base::pdcp_entity_base(srslte::task_handler_interface* task_executor_, srslte::log_ref log_) : + log(log_), + task_executor(task_executor_) +{ +} pdcp_entity_base::~pdcp_entity_base() {} diff --git a/lib/src/upper/pdcp_entity_lte.cc b/lib/src/upper/pdcp_entity_lte.cc index cb43a653a..fa481fd37 100644 --- a/lib/src/upper/pdcp_entity_lte.cc +++ b/lib/src/upper/pdcp_entity_lte.cc @@ -24,12 +24,12 @@ namespace srslte { -pdcp_entity_lte::pdcp_entity_lte(srsue::rlc_interface_pdcp* rlc_, - srsue::rrc_interface_pdcp* rrc_, - srsue::gw_interface_pdcp* gw_, - srslte::timer_handler* timers_, - srslte::log_ref log_) : - pdcp_entity_base(timers_, log_), +pdcp_entity_lte::pdcp_entity_lte(srsue::rlc_interface_pdcp* rlc_, + srsue::rrc_interface_pdcp* rrc_, + srsue::gw_interface_pdcp* gw_, + srslte::task_handler_interface* task_executor_, + srslte::log_ref log_) : + pdcp_entity_base(task_executor_, log_), rlc(rlc_), rrc(rrc_), gw(gw_) diff --git a/lib/src/upper/pdcp_entity_nr.cc b/lib/src/upper/pdcp_entity_nr.cc index acff0ee0b..76a109aa9 100644 --- a/lib/src/upper/pdcp_entity_nr.cc +++ b/lib/src/upper/pdcp_entity_nr.cc @@ -24,12 +24,12 @@ namespace srslte { -pdcp_entity_nr::pdcp_entity_nr(srsue::rlc_interface_pdcp* rlc_, - srsue::rrc_interface_pdcp* rrc_, - srsue::gw_interface_pdcp* gw_, - srslte::timer_handler* timers_, - srslte::log_ref log_) : - pdcp_entity_base(timers_, log_), +pdcp_entity_nr::pdcp_entity_nr(srsue::rlc_interface_pdcp* rlc_, + srsue::rrc_interface_pdcp* rrc_, + srsue::gw_interface_pdcp* gw_, + srslte::task_handler_interface* task_executor_, + srslte::log_ref log_) : + pdcp_entity_base(task_executor_, log_), rlc(rlc_), rrc(rrc_), gw(gw_), @@ -50,7 +50,7 @@ void pdcp_entity_nr::init(uint32_t lcid_, pdcp_config_t cfg_) window_size = 1 << (cfg.sn_len - 1); // Timers - reordering_timer = timers->get_unique_timer(); + reordering_timer = task_executor->get_unique_timer(); // configure timer if (static_cast(cfg.t_reordering) > 0) { @@ -102,7 +102,7 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, bool blocking) // Start discard timer if (cfg.discard_timer != pdcp_discard_timer_t::infinity) { - timer_handler::unique_timer discard_timer = timers->get_unique_timer(); + timer_handler::unique_timer discard_timer = task_executor->get_unique_timer(); discard_callback discard_fnc(this, tx_next); discard_timer.set(static_cast(cfg.discard_timer), discard_fnc); discard_timer.run(); diff --git a/lib/test/upper/pdcp_lte_test.h b/lib/test/upper/pdcp_lte_test.h index 4067f6c77..281862c4f 100644 --- a/lib/test/upper/pdcp_lte_test.h +++ b/lib/test/upper/pdcp_lte_test.h @@ -23,6 +23,7 @@ #define SRSLTE_PDCP_LTE_TEST_H #include "pdcp_base_test.h" +#include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp_entity_lte.h" struct pdcp_lte_initial_state { @@ -78,8 +79,7 @@ public: rlc(log), rrc(log), gw(log), - timers(64), - pdcp(&rlc, &rrc, &gw, &timers, log) + pdcp(&rlc, &rrc, &gw, &stack, log) { pdcp.init(0, cfg); pdcp.config_security(sec_cfg); @@ -98,7 +98,7 @@ public: rlc_dummy rlc; rrc_dummy rrc; gw_dummy gw; - srslte::timer_handler timers; + srsue::stack_test_dummy stack; srslte::pdcp_entity_lte pdcp; }; diff --git a/lib/test/upper/pdcp_lte_test_rx.cc b/lib/test/upper/pdcp_lte_test_rx.cc index 74a61f6b1..9f667349a 100644 --- a/lib/test/upper/pdcp_lte_test_rx.cc +++ b/lib/test/upper/pdcp_lte_test_rx.cc @@ -46,7 +46,7 @@ int test_rx(std::vector events, srslte::pdcp_entity_lte* pdcp_rx = &pdcp_hlp_rx.pdcp; gw_dummy* gw_rx = &pdcp_hlp_rx.gw; rrc_dummy* rrc_rx = &pdcp_hlp_rx.rrc; - srslte::timer_handler* timers_rx = &pdcp_hlp_rx.timers; + srslte::timer_handler* timers_rx = &pdcp_hlp_rx.stack.timers; pdcp_hlp_rx.set_pdcp_initial_state(init_state); // Generate test message and encript/decript SDU. diff --git a/lib/test/upper/pdcp_nr_test.h b/lib/test/upper/pdcp_nr_test.h index 02a85b55f..d38450c30 100644 --- a/lib/test/upper/pdcp_nr_test.h +++ b/lib/test/upper/pdcp_nr_test.h @@ -23,6 +23,7 @@ #define SRSLTE_PDCP_NR_TEST_H #include "pdcp_base_test.h" +#include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp_entity_nr.h" struct pdcp_initial_state { @@ -99,8 +100,7 @@ public: rlc(log), rrc(log), gw(log), - timers(64), - pdcp(&rlc, &rrc, &gw, &timers, log) + pdcp(&rlc, &rrc, &gw, &stack, log) { pdcp.init(0, cfg); pdcp.config_security(sec_cfg); @@ -116,11 +116,11 @@ public: pdcp.set_rx_reord(init_state.rx_reord); } - rlc_dummy rlc; - rrc_dummy rrc; - gw_dummy gw; - srslte::timer_handler timers; - srslte::pdcp_entity_nr pdcp; + rlc_dummy rlc; + rrc_dummy rrc; + gw_dummy gw; + srsue::stack_test_dummy stack; + srslte::pdcp_entity_nr pdcp; }; // Helper function to generate PDUs diff --git a/lib/test/upper/pdcp_nr_test_discard_sdu.cc b/lib/test/upper/pdcp_nr_test_discard_sdu.cc index ebb85fe21..a304949ff 100644 --- a/lib/test/upper/pdcp_nr_test_discard_sdu.cc +++ b/lib/test/upper/pdcp_nr_test_discard_sdu.cc @@ -41,7 +41,7 @@ int test_tx_sdu_discard(const pdcp_initial_state& init_state, pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, log); srslte::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; rlc_dummy* rlc = &pdcp_hlp.rlc; - srslte::timer_handler* timers = &pdcp_hlp.timers; + srslte::timer_handler* timers = &pdcp_hlp.stack.timers; pdcp_hlp.set_pdcp_initial_state(init_state); diff --git a/lib/test/upper/pdcp_nr_test_rx.cc b/lib/test/upper/pdcp_nr_test_rx.cc index 29be3ce13..63db4f540 100644 --- a/lib/test/upper/pdcp_nr_test_rx.cc +++ b/lib/test/upper/pdcp_nr_test_rx.cc @@ -45,7 +45,7 @@ int test_rx(std::vector events, pdcp_nr_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, log); srslte::pdcp_entity_nr* pdcp_rx = &pdcp_hlp_rx.pdcp; gw_dummy* gw_rx = &pdcp_hlp_rx.gw; - srslte::timer_handler* timers_rx = &pdcp_hlp_rx.timers; + srslte::timer_handler* timers_rx = &pdcp_hlp_rx.stack.timers; pdcp_hlp_rx.set_pdcp_initial_state(init_state); // Generate test message and encript/decript SDU. diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index 8c9fe3a9c..2a2eb00f5 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -113,7 +113,10 @@ public: /* Stack-MAC interface */ srslte::timer_handler::unique_timer get_unique_timer() final; - srslte::task_multiqueue::queue_handler get_task_queue() final; + srslte::task_multiqueue::queue_handler make_task_queue() final; + void defer_callback(uint32_t duration_ms, std::function func) final; + void enqueue_background_task(std::function task) final; + void notify_background_task_result(srslte::move_task_t task) final; private: static const int STACK_MAIN_THREAD_PRIO = -1; // Use default high-priority below UHD diff --git a/srsenb/hdr/stack/upper/pdcp.h b/srsenb/hdr/stack/upper/pdcp.h index 61baddbc4..c55e7acbb 100644 --- a/srsenb/hdr/stack/upper/pdcp.h +++ b/srsenb/hdr/stack/upper/pdcp.h @@ -33,7 +33,7 @@ namespace srsenb { class pdcp : public pdcp_interface_rlc, public pdcp_interface_gtpu, public pdcp_interface_rrc { public: - pdcp(srslte::timer_handler* timers, const char* logname); + pdcp(srslte::task_handler_interface* task_executor_, const char* logname); virtual ~pdcp() {} void init(rlc_interface_pdcp* rlc_, rrc_interface_pdcp* rrc_, gtpu_interface_pdcp* gtpu_); void stop(); @@ -103,12 +103,12 @@ private: std::map users; - rlc_interface_pdcp* rlc; - rrc_interface_pdcp* rrc; - gtpu_interface_pdcp* gtpu; - srslte::timer_handler* timers; - srslte::log_ref log_h; - srslte::byte_buffer_pool* pool; + rlc_interface_pdcp* rlc; + rrc_interface_pdcp* rrc; + gtpu_interface_pdcp* gtpu; + srslte::task_handler_interface* task_executor; + srslte::log_ref log_h; + srslte::byte_buffer_pool* pool; }; } // namespace srsenb diff --git a/srsenb/src/stack/enb_stack_lte.cc b/srsenb/src/stack/enb_stack_lte.cc index 8a6428f9f..81f05d334 100644 --- a/srsenb/src/stack/enb_stack_lte.cc +++ b/srsenb/src/stack/enb_stack_lte.cc @@ -32,7 +32,7 @@ namespace srsenb { enb_stack_lte::enb_stack_lte(srslte::logger* logger_) : timers(128), logger(logger_), - pdcp(&timers, "PDCP"), + pdcp(this, "PDCP"), thread("STACK") { enb_queue_id = pending_tasks.add_queue(); @@ -250,9 +250,24 @@ srslte::timer_handler::unique_timer enb_stack_lte::get_unique_timer() return timers.get_unique_timer(); } -srslte::task_multiqueue::queue_handler enb_stack_lte::get_task_queue() +srslte::task_multiqueue::queue_handler enb_stack_lte::make_task_queue() { return pending_tasks.get_queue_handler(); } +void enb_stack_lte::defer_callback(uint32_t duration_ms, std::function func) +{ + timers.defer_callback(duration_ms, func); +} + +void enb_stack_lte::enqueue_background_task(std::function task) +{ + task(0); +} + +void enb_stack_lte::notify_background_task_result(srslte::move_task_t task) +{ + task(); +} + } // namespace srsenb diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index 640eaed6e..4ff1ce067 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -68,7 +68,7 @@ bool mac::init(const mac_args_t& args_, args = args_; cells = cells_; - stack_task_queue = stack->get_task_queue(); + stack_task_queue = stack->make_task_queue(); scheduler.init(rrc); diff --git a/srsenb/src/stack/upper/pdcp.cc b/srsenb/src/stack/upper/pdcp.cc index 597e5203f..bf9a942bb 100644 --- a/srsenb/src/stack/upper/pdcp.cc +++ b/srsenb/src/stack/upper/pdcp.cc @@ -24,8 +24,8 @@ namespace srsenb { -pdcp::pdcp(srslte::timer_handler* timers_, const char* logname) : - timers(timers_), +pdcp::pdcp(srslte::task_handler_interface* task_executor_, const char* logname) : + task_executor(task_executor_), log_h(logname), pool(srslte::byte_buffer_pool::get_instance()) { @@ -49,7 +49,7 @@ void pdcp::stop() void pdcp::add_user(uint16_t rnti) { if (users.count(rnti) == 0) { - srslte::pdcp* obj = new srslte::pdcp(timers, log_h->get_service_name().c_str()); + srslte::pdcp* obj = new srslte::pdcp(task_executor, log_h->get_service_name().c_str()); obj->init(&users[rnti].rlc_itf, &users[rnti].rrc_itf, &users[rnti].gtpu_itf); users[rnti].rlc_itf.rnti = rnti; users[rnti].gtpu_itf.rnti = rnti; diff --git a/srsue/hdr/stack/mac/mac.h b/srsue/hdr/stack/mac/mac.h index de87331aa..b12b929c0 100644 --- a/srsue/hdr/stack/mac/mac.h +++ b/srsue/hdr/stack/mac/mac.h @@ -50,7 +50,10 @@ class mac : public mac_interface_phy_lte, public: mac(const char* logname); ~mac(); - bool init(phy_interface_mac_lte* phy, rlc_interface_mac* rlc, rrc_interface_mac* rrc, stack_interface_mac* stack_); + bool init(phy_interface_mac_lte* phy, + rlc_interface_mac* rlc, + rrc_interface_mac* rrc, + srslte::task_handler_interface* stack_); void stop(); void get_metrics(mac_metrics_t m[SRSLTE_MAX_CARRIERS]); @@ -119,7 +122,7 @@ private: phy_interface_mac_lte* phy_h = nullptr; rlc_interface_mac* rlc_h = nullptr; rrc_interface_mac* rrc_h = nullptr; - stack_interface_mac* stack_h = nullptr; + srslte::task_handler_interface* stack_h = nullptr; srslte::log_ref log_h; mac_interface_phy_lte::mac_phy_cfg_mbsfn_t phy_mbsfn_cfg = {}; diff --git a/srsue/hdr/stack/mac/proc_bsr.h b/srsue/hdr/stack/mac/proc_bsr.h index dbefdb2a5..12724a474 100644 --- a/srsue/hdr/stack/mac/proc_bsr.h +++ b/srsue/hdr/stack/mac/proc_bsr.h @@ -55,7 +55,7 @@ class bsr_proc : public srslte::timer_callback, public bsr_interface_mux { public: bsr_proc(); - void init(rlc_interface_mac* rlc, srslte::log_ref log_h, srsue::task_handler_interface_lte* task_handler_); + void init(rlc_interface_mac* rlc, srslte::log_ref log_h, srslte::task_handler_interface* task_handler_); void step(uint32_t tti); void reset(); void set_config(srslte::bsr_cfg_t& bsr_cfg); @@ -73,10 +73,10 @@ private: pthread_mutex_t mutex; - bool reset_sr; - srsue::task_handler_interface_lte* task_handler; - srslte::log_ref log_h; - rlc_interface_mac* rlc; + bool reset_sr; + srslte::task_handler_interface* task_handler; + srslte::log_ref log_h; + rlc_interface_mac* rlc; srslte::bsr_cfg_t bsr_cfg; diff --git a/srsue/hdr/stack/mac/proc_phr.h b/srsue/hdr/stack/mac/proc_phr.h index 90d76b60f..8c7cde746 100644 --- a/srsue/hdr/stack/mac/proc_phr.h +++ b/srsue/hdr/stack/mac/proc_phr.h @@ -35,7 +35,7 @@ class phr_proc : public srslte::timer_callback { public: phr_proc(); - void init(phy_interface_mac_lte* phy_h, srslte::log_ref log_h_, srsue::task_handler_interface_lte* task_handler_); + void init(phy_interface_mac_lte* phy_h, srslte::log_ref log_h_, srslte::task_handler_interface* task_handler_); void set_config(srslte::phr_cfg_t& cfg); void step(); void reset(); @@ -49,13 +49,13 @@ public: private: bool pathloss_changed(); - srslte::log_ref log_h; - phy_interface_mac_lte* phy_h; - srsue::task_handler_interface_lte* task_handler; - srslte::phr_cfg_t phr_cfg; - bool initiated; - int last_pathloss_db; - bool phr_is_triggered; + srslte::log_ref log_h; + phy_interface_mac_lte* phy_h; + srslte::task_handler_interface* task_handler; + srslte::phr_cfg_t phr_cfg; + bool initiated; + int last_pathloss_db; + bool phr_is_triggered; srslte::timer_handler::unique_timer timer_periodic; srslte::timer_handler::unique_timer timer_prohibit; diff --git a/srsue/hdr/stack/mac/proc_ra.h b/srsue/hdr/stack/mac/proc_ra.h index 4bd3816f6..94df2bca3 100644 --- a/srsue/hdr/stack/mac/proc_ra.h +++ b/srsue/hdr/stack/mac/proc_ra.h @@ -72,7 +72,7 @@ public: mac_interface_rrc::ue_rnti_t* rntis, srslte::timer_handler::unique_timer* time_alignment_timer_, mux* mux_unit, - stack_interface_mac* stack_); + srslte::task_handler_interface* stack_); void reset(); @@ -164,12 +164,12 @@ private: void read_params(); - phy_interface_mac_lte* phy_h; - srslte::log_ref log_h; - mux* mux_unit; - srslte::mac_pcap* pcap; - rrc_interface_mac* rrc; - stack_interface_mac* stack = nullptr; + phy_interface_mac_lte* phy_h; + srslte::log_ref log_h; + mux* mux_unit; + srslte::mac_pcap* pcap; + rrc_interface_mac* rrc; + srslte::task_handler_interface* stack = nullptr; srslte::timer_handler::unique_timer* time_alignment_timer = nullptr; srslte::timer_handler::unique_timer contention_resolution_timer; diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index 4bd9393ff..f0e56dfe9 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -54,9 +54,7 @@ namespace srsue { class ue_stack_lte final : public ue_stack_base, public stack_interface_phy_lte, public stack_interface_gw, - public stack_interface_mac, public stack_interface_rrc, - public stack_interface_nas, public srslte::thread { public: diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index ca0b36a2a..f4f597308 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -40,7 +40,7 @@ namespace srsue { class nas : public nas_interface_rrc, public nas_interface_ue, public srslte::timer_callback { public: - explicit nas(srsue::stack_interface_nas* task_handler_); + explicit nas(srslte::task_handler_interface* task_handler_); void init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& args_); void stop(); void run_tti(); @@ -132,7 +132,7 @@ private: uint8_t transaction_id = 0; // timers - srsue::task_handler_interface_lte* task_handler = nullptr; + srslte::task_handler_interface* task_handler = nullptr; srslte::timer_handler::unique_timer t3402; // started when attach attempt counter reached 5 srslte::timer_handler::unique_timer t3410; // started when attach request is sent, on expiry, start t3411 srslte::timer_handler::unique_timer t3411; // started when attach failed @@ -141,10 +141,10 @@ private: // Values according to TS 24.301 Sec 10.2 const uint32_t t3402_duration_ms = 12 * 60 * 1000; // 12m - const uint32_t t3410_duration_ms = 15 * 1000; // 15s - const uint32_t t3411_duration_ms = 10 * 1000; // 10s - const uint32_t t3421_duration_ms = 15 * 1000; // 15s - const uint32_t reattach_timer_duration_ms = 2 * 1000; // 2s (arbitrarily chosen to delay re-attach) + const uint32_t t3410_duration_ms = 15 * 1000; // 15s + const uint32_t t3411_duration_ms = 10 * 1000; // 10s + const uint32_t t3421_duration_ms = 15 * 1000; // 15s + const uint32_t reattach_timer_duration_ms = 2 * 1000; // 2s (arbitrarily chosen to delay re-attach) // TS 23.003 Sec. 6.2.2 IMEISV's last two octets are Software Version Number (SVN) // which identifies the software version number of the mobile equipment diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index a5716fc4f..55ba40c2f 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -72,7 +72,10 @@ mac::~mac() srslte_softbuffer_rx_free(&mch_softbuffer); } -bool mac::init(phy_interface_mac_lte* phy, rlc_interface_mac* rlc, rrc_interface_mac* rrc, stack_interface_mac* stack_) +bool mac::init(phy_interface_mac_lte* phy, + rlc_interface_mac* rlc, + rrc_interface_mac* rrc, + task_handler_interface* stack_) { phy_h = phy; rlc_h = rlc; diff --git a/srsue/src/stack/mac/proc_bsr.cc b/srsue/src/stack/mac/proc_bsr.cc index 28bffc507..96d020a62 100644 --- a/srsue/src/stack/mac/proc_bsr.cc +++ b/srsue/src/stack/mac/proc_bsr.cc @@ -35,7 +35,7 @@ bsr_proc::bsr_proc() pthread_mutex_init(&mutex, NULL); } -void bsr_proc::init(rlc_interface_mac* rlc_, srslte::log_ref log_h_, srsue::task_handler_interface_lte* task_handler_) +void bsr_proc::init(rlc_interface_mac* rlc_, srslte::log_ref log_h_, srslte::task_handler_interface* task_handler_) { log_h = log_h_; rlc = rlc_; diff --git a/srsue/src/stack/mac/proc_phr.cc b/srsue/src/stack/mac/proc_phr.cc index e402e931a..7fbb18f6a 100644 --- a/srsue/src/stack/mac/proc_phr.cc +++ b/srsue/src/stack/mac/proc_phr.cc @@ -38,9 +38,9 @@ phr_proc::phr_proc() phr_cfg = {}; } -void phr_proc::init(phy_interface_mac_lte* phy_h_, - srslte::log_ref log_h_, - srsue::task_handler_interface_lte* task_handler_) +void phr_proc::init(phy_interface_mac_lte* phy_h_, + srslte::log_ref log_h_, + srslte::task_handler_interface* task_handler_) { phy_h = phy_h_; log_h = log_h_; diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index e83cd3757..3ce6839f5 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -56,7 +56,7 @@ void ra_proc::init(phy_interface_mac_lte* phy_h_, mac_interface_rrc::ue_rnti_t* rntis_, srslte::timer_handler::unique_timer* time_alignment_timer_, mux* mux_unit_, - stack_interface_mac* stack_) + srslte::task_handler_interface* stack_) { phy_h = phy_h_; log_h = log_h_; diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 7e2157e70..4cd8a3326 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -40,7 +40,7 @@ ue_stack_lte::ue_stack_lte() : rlc("RLC"), mac("MAC "), rrc(this), - pdcp(&timers, "PDCP"), + pdcp(this, "PDCP"), nas(this), thread("STACK"), pending_tasks(512), diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 430981ad1..a2f176c37 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -234,7 +234,7 @@ proc_outcome_t nas::rrc_connect_proc::react(nas::rrc_connect_proc::connection_re * NAS ********************************************************************/ -nas::nas(srsue::stack_interface_nas* task_handler_) : +nas::nas(srslte::task_handler_interface* task_handler_) : pool(byte_buffer_pool::get_instance()), plmn_searcher(this), rrc_connector(this), @@ -250,9 +250,9 @@ nas::nas(srsue::stack_interface_nas* task_handler_) : void nas::init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& cfg_) { - usim = usim_; - rrc = rrc_; - gw = gw_; + usim = usim_; + rrc = rrc_; + gw = gw_; enter_state(EMM_STATE_DEREGISTERED); if (!usim->get_home_plmn_id(&home_plmn)) { @@ -340,7 +340,7 @@ void nas::timer_expired(uint32_t timeout_id) // Section 5.5.1.2.6 case c) attach_attempt_counter++; - nas_log->console("Attach failed (attempt %d/%d)\n",attach_attempt_counter, max_attach_attempts); + nas_log->console("Attach failed (attempt %d/%d)\n", attach_attempt_counter, max_attach_attempts); if (attach_attempt_counter < max_attach_attempts) { nas_log->info("Timer T3410 expired after attach attempt %d/%d: starting T3411\n", attach_attempt_counter, @@ -953,7 +953,7 @@ void nas::reset_security_context() have_guti = false; have_ctxt = false; ctxt = {}; - ctxt.ksi = LIBLTE_MME_NAS_KEY_SET_IDENTIFIER_NO_KEY_AVAILABLE; + ctxt.ksi = LIBLTE_MME_NAS_KEY_SET_IDENTIFIER_NO_KEY_AVAILABLE; } /******************************************************************************* diff --git a/srsue/test/mac_test.cc b/srsue/test/mac_test.cc index b209cb685..237593915 100644 --- a/srsue/test/mac_test.cc +++ b/srsue/test/mac_test.cc @@ -24,9 +24,9 @@ #include "srslte/common/log_filter.h" #include "srslte/common/mac_pcap.h" #include "srslte/interfaces/ue_interfaces.h" +#include "srslte/test/ue_test_interfaces.h" #include "srsue/hdr/stack/mac/mac.h" #include "srsue/hdr/stack/mac/mux.h" -#include "srsue/test/common/dummy_classes.h" #include #include #include @@ -341,7 +341,7 @@ public: uint32_t rach_problem = 0; }; -class stack_dummy : public stack_dummy_interface +class stack_dummy : public stack_test_dummy { public: void init(mac* mac_, phy_interface_mac_lte* phy_) diff --git a/srsue/test/ttcn3/hdr/ttcn3_syssim.h b/srsue/test/ttcn3/hdr/ttcn3_syssim.h index 85c238a4a..e90f7a294 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_syssim.h +++ b/srsue/test/ttcn3/hdr/ttcn3_syssim.h @@ -24,6 +24,7 @@ #include "dut_utils.h" #include "srslte/common/pdu_queue.h" +#include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp.h" #include "srslte/upper/rlc.h" #include "ttcn3_common.h" @@ -34,7 +35,6 @@ #include "ttcn3_ue.h" #include "ttcn3_ut_interface.h" #include -#include #define TTCN3_CRNTI (0x1001) @@ -52,7 +52,6 @@ public: log{"SS "}, mac_msg_ul(20, ss_mac_log), mac_msg_dl(20, ss_mac_log), - timers(8), pdus(128), logger(logger_file_), logger_file(logger_file_), @@ -61,7 +60,7 @@ public: rlc(ss_rlc_log->get_service_name().c_str()), signal_handler(&running), timer_handler(create_tti_timer(), [&](uint64_t res) { new_tti_indication(res); }), - pdcp(&timers, ss_pdcp_log->get_service_name().c_str()) + pdcp(&stack, ss_pdcp_log->get_service_name().c_str()) { if (ue->init(all_args_t{}, logger, this, "INIT_TEST") != SRSLTE_SUCCESS) { ue->stop(); @@ -134,7 +133,7 @@ public: // Init SS layers pdus.init(this, log); - rlc.init(&pdcp, this, &timers, 0 /* RB_ID_SRB0 */); + rlc.init(&pdcp, this, &stack.timers, 0 /* RB_ID_SRB0 */); pdcp.init(&rlc, this, nullptr); return SRSLTE_SUCCESS; @@ -901,7 +900,7 @@ public: ue->new_tb(dl_grant, (const uint8_t*)pdu->msg); } - void step_timer() { timers.step_all(); } + void step_timer() { stack.timers.step_all(); } void add_srb(const ttcn3_helpers::timing_info_t timing, const uint32_t lcid, const pdcp_config_t pdcp_config) { @@ -1204,18 +1203,18 @@ private: uint32_t run_id = 0; - int32_t tti = 0; - int32_t prach_tti = -1; - int32_t rar_tti = -1; - int32_t msg3_tti = -1; - int32_t sr_tti = -1; - uint32_t prach_preamble_index = 0; - uint16_t dl_rnti = 0; - uint16_t crnti = TTCN3_CRNTI; - int force_lcid = -1; - srslte::timer_handler timers; - bool last_dl_ndi[SRSLTE_FDD_NOF_HARQ] = {}; - bool last_ul_ndi[SRSLTE_FDD_NOF_HARQ] = {}; + int32_t tti = 0; + int32_t prach_tti = -1; + int32_t rar_tti = -1; + int32_t msg3_tti = -1; + int32_t sr_tti = -1; + uint32_t prach_preamble_index = 0; + uint16_t dl_rnti = 0; + uint16_t crnti = TTCN3_CRNTI; + int force_lcid = -1; + srsue::stack_test_dummy stack; + bool last_dl_ndi[SRSLTE_FDD_NOF_HARQ] = {}; + bool last_ul_ndi[SRSLTE_FDD_NOF_HARQ] = {}; // For events/actions that need to be carried out in a specific TTI typedef std::vector task_list_t; diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index d6329ea2c..48b52f277 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -23,6 +23,7 @@ #include "srslte/common/log_filter.h" #include "srslte/common/logmap.h" #include "srslte/interfaces/ue_interfaces.h" +#include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp.h" #include "srslte/upper/pdcp_entity_lte.h" #include "srslte/upper/rlc.h" @@ -32,7 +33,6 @@ #include "srsue/hdr/stack/upper/nas.h" #include "srsue/hdr/stack/upper/usim.h" #include "srsue/hdr/stack/upper/usim_base.h" -#include "srsue/test/common/dummy_classes.h" #include #include @@ -141,7 +141,7 @@ private: bool is_connected_flag = false; }; -class test_stack_dummy : public srsue::stack_dummy_interface, public stack_interface_gw, public thread +class test_stack_dummy : public srsue::stack_test_dummy, public stack_interface_gw, public thread { public: test_stack_dummy(pdcp_interface_gw* pdcp_) : pdcp(pdcp_), thread("DUMMY STACK") {} @@ -210,7 +210,7 @@ int security_command_test() rrc_log.set_level(srslte::LOG_LEVEL_DEBUG); rrc_log.set_hex_limit(100000); - stack_dummy_interface stack; + stack_test_dummy stack; rrc_dummy rrc_dummy; gw_dummy gw; @@ -352,7 +352,7 @@ int esm_info_request_test() rrc_log.set_level(srslte::LOG_LEVEL_DEBUG); rrc_log.set_hex_limit(100000); - srsue::stack_dummy_interface stack{}; + srsue::stack_test_dummy stack{}; rrc_dummy rrc_dummy; gw_dummy gw; @@ -406,7 +406,7 @@ int dedicated_eps_bearer_test() rrc_log.set_level(srslte::LOG_LEVEL_DEBUG); rrc_log.set_hex_limit(100000); - srsue::stack_dummy_interface stack; + srsue::stack_test_dummy stack; rrc_dummy rrc_dummy; gw_dummy gw; diff --git a/srsue/test/upper/rrc_meas_test.cc b/srsue/test/upper/rrc_meas_test.cc index d92b75058..667a50da4 100644 --- a/srsue/test/upper/rrc_meas_test.cc +++ b/srsue/test/upper/rrc_meas_test.cc @@ -23,11 +23,11 @@ #include "srslte/common/buffer_pool.h" #include "srslte/common/log_filter.h" #include "srslte/common/test_common.h" +#include "srslte/test/ue_test_interfaces.h" #include "srslte/upper/pdcp.h" #include "srsue/hdr/stack/rrc/rrc.h" #include "srsue/hdr/stack/rrc/rrc_meas.h" #include "srsue/hdr/stack/upper/nas.h" -#include "srsue/test/common/dummy_classes.h" #include using namespace asn1::rrc; @@ -108,14 +108,14 @@ private: class nas_test : public srsue::nas { public: - nas_test(srsue::stack_interface_nas* t) : srsue::nas(t) {} + nas_test(srslte::task_handler_interface* t) : srsue::nas(t) {} bool is_attached() override { return false; } }; class pdcp_test : public srslte::pdcp { public: - pdcp_test(const char* logname, srslte::timer_handler* t) : srslte::pdcp(t, logname) {} + pdcp_test(const char* logname, srslte::task_handler_interface* t) : srslte::pdcp(t, logname) {} void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking = false) override { ul_dcch_msg_s ul_dcch_msg; @@ -167,14 +167,14 @@ private: class rrc_test : public rrc { - srsue::stack_dummy_interface* stack = nullptr; + srsue::stack_test_dummy* stack = nullptr; public: - rrc_test(srslte::log_ref log_, stack_dummy_interface* stack_) : rrc(stack_), stack(stack_) + rrc_test(srslte::log_ref log_, stack_test_dummy* stack_) : rrc(stack_), stack(stack_) { pool = srslte::byte_buffer_pool::get_instance(); nastest = std::unique_ptr(new nas_test(stack)); - pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), &stack->timers)); + pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), stack)); }; void init() { rrc::init(&phytest, nullptr, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, {}); } @@ -273,8 +273,8 @@ int cell_select_test() printf("====== Cell Select Testing ===============\n"); printf("==========================================================\n"); - stack_dummy_interface stack; - rrc_test rrctest(log1, &stack); + stack_test_dummy stack; + rrc_test rrctest(log1, &stack); rrctest.init(); rrctest.connect(); @@ -303,8 +303,8 @@ int meas_obj_test() printf("====== Object Configuration Testing ===============\n"); printf("==========================================================\n"); - stack_dummy_interface stack; - rrc_test rrctest(log1, &stack); + stack_test_dummy stack; + rrc_test rrctest(log1, &stack); rrctest.init(); rrctest.connect(); @@ -728,8 +728,8 @@ int a1event_report_test(uint32_t a1_rsrp_th, printf("============ Report Testing A1 ===============\n"); printf("==========================================================\n"); - stack_dummy_interface stack; - rrc_test rrctest(log1, &stack); + stack_test_dummy stack; + rrc_test rrctest(log1, &stack); rrctest.init(); rrctest.connect(); @@ -862,8 +862,8 @@ int a3event_report_test(uint32_t a3_offset, uint32_t hyst, bool report_on_leave) printf("============ Report Testing A3 ===============\n"); printf("==========================================================\n"); - stack_dummy_interface stack; - rrc_test rrctest(log1, &stack); + stack_test_dummy stack; + rrc_test rrctest(log1, &stack); rrctest.init(); rrctest.connect();