diff --git a/srsgnb/hdr/stack/ric/e2ap.h b/srsgnb/hdr/stack/ric/e2ap.h index d38b0474d..701000de0 100644 --- a/srsgnb/hdr/stack/ric/e2ap.h +++ b/srsgnb/hdr/stack/ric/e2ap.h @@ -13,6 +13,8 @@ #include "e2sm_kpm.h" #include "srsran/asn1/e2ap.h" +#include "srsran/common/task_scheduler.h" +#include "srsran/common/timers.h" #include "srsran/interfaces/e2_metrics_interface.h" #include "srsran/interfaces/enb_metrics_interface.h" #include "srsran/srsran.h" @@ -46,7 +48,9 @@ typedef struct { class e2ap { public: - e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metrics); + e2ap(srslog::basic_logger& logger, + srsenb::e2_interface_metrics* _gnb_metrics, + srsran::task_scheduler* _task_sched_ptr); e2_ap_pdu_c generate_setup_request(); int process_setup_response(e2setup_resp_s setup_response); int process_setup_failure(); @@ -76,6 +80,7 @@ private: std::map ran_functions; srsenb::e2_interface_metrics* gnb_metrics = nullptr; bool reset_response_received = false; + srsran::task_scheduler* task_sched_ptr = nullptr; int reset_transaction_id = 1; cause_c reset_cause = cause_c(); int reset_id = 1; diff --git a/srsgnb/src/stack/ric/e2ap.cc b/srsgnb/src/stack/ric/e2ap.cc index 178789904..71dd809e8 100644 --- a/srsgnb/src/stack/ric/e2ap.cc +++ b/srsgnb/src/stack/ric/e2ap.cc @@ -2,10 +2,12 @@ #include "srsgnb/hdr/stack/ric/e2ap.h" #include "stdint.h" -e2ap::e2ap(srslog::basic_logger& logger, srsenb::e2_interface_metrics* _gnb_metrics) : logger(logger), e2sm_(logger) +e2ap::e2ap(srslog::basic_logger& logger, + srsenb::e2_interface_metrics* _gnb_metrics, + srsran::task_scheduler* _task_sched_ptr) : + logger(logger), e2sm_(logger), task_sched_ptr(_task_sched_ptr) { gnb_metrics = _gnb_metrics; - // add SMs to map uint32_t local_ran_function_id = 147; RANfunction_description add_func; diff --git a/srsgnb/src/stack/ric/ric_client.cc b/srsgnb/src/stack/ric/ric_client.cc index b0a5de1db..67b523093 100644 --- a/srsgnb/src/stack/ric/ric_client.cc +++ b/srsgnb/src/stack/ric/ric_client.cc @@ -17,7 +17,7 @@ using namespace srsenb; ric_client::ric_client(srslog::basic_logger& logger, e2_interface_metrics* _gnb_metrics) : - task_sched(), logger(logger), rx_sockets(), thread("RIC_CLIENT_THREAD"), e2ap_(logger, _gnb_metrics) + task_sched(), logger(logger), rx_sockets(), thread("RIC_CLIENT_THREAD"), e2ap_(logger, _gnb_metrics, &task_sched) { gnb_metrics = _gnb_metrics; } diff --git a/srsgnb/src/stack/ric/test/e2ap_test.cc b/srsgnb/src/stack/ric/test/e2ap_test.cc index 08561cd52..c589be1ad 100644 --- a/srsgnb/src/stack/ric/test/e2ap_test.cc +++ b/srsgnb/src/stack/ric/test/e2ap_test.cc @@ -103,7 +103,7 @@ void test_native_e2ap_setup_request() e2_ap_pdu_c pdu, pdu2; srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); dummy_metrics_interface dummy_metrics; - e2ap e2ap_(logger, &dummy_metrics); + e2ap e2ap_(logger, &dummy_metrics, NULL); pdu = e2ap_.generate_setup_request(); asn1::bit_ref bref(buf->msg, buf->get_tailroom()); @@ -139,7 +139,7 @@ void test_native_e2ap_subscription_response() e2_ap_pdu_c pdu, pdu2; srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); dummy_metrics_interface dummy_metrics; - e2ap e2ap_(logger, &dummy_metrics); + e2ap e2ap_(logger, &dummy_metrics, NULL); ric_subscription_reponse_t ric_subscription_reponse; ric_subscription_reponse.ric_requestor_id = 1021; @@ -167,7 +167,7 @@ void test_native_e2ap_reset_request() e2_ap_pdu_c pdu, pdu2; srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); dummy_metrics_interface dummy_metrics; - e2ap e2ap_(logger, &dummy_metrics); + e2ap e2ap_(logger, &dummy_metrics, NULL); pdu = e2ap_.generate_reset_request(); asn1::bit_ref bref(buf->msg, buf->get_tailroom()); @@ -188,7 +188,7 @@ void test_native_e2ap_reset_response() e2_ap_pdu_c pdu, pdu2; srslog::basic_logger& logger = srslog::fetch_basic_logger("E2AP"); dummy_metrics_interface dummy_metrics; - e2ap e2ap_(logger, &dummy_metrics); + e2ap e2ap_(logger, &dummy_metrics, NULL); pdu = e2ap_.generate_reset_response(); asn1::bit_ref bref(buf->msg, buf->get_tailroom());