diff --git a/srsgnb/hdr/stack/ric/e2sm.h b/srsgnb/hdr/stack/ric/e2sm.h index 6a9826a5c..19179610a 100644 --- a/srsgnb/hdr/stack/ric/e2sm.h +++ b/srsgnb/hdr/stack/ric/e2sm.h @@ -10,6 +10,8 @@ * * */ + +#include "srsran/asn1/e2ap.h" #include "srsran/common/byte_buffer.h" #include "srsran/srsran.h" @@ -20,6 +22,12 @@ enum e2sm_type_t { E2SM_KPM, UNKNOWN }; struct RANfunction_description; +struct RIC_event_trigger_definition { + enum e2sm_event_trigger_type_t { E2SM_REPORT, E2SM_INSERT, E2SM_POLICY, UNKNOWN_TRIGGER }; + e2sm_event_trigger_type_t type; + uint64_t report_period; +}; + class e2sm { public: @@ -34,6 +42,8 @@ public: uint32_t get_revision() { return _revision; }; virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf) = 0; + virtual bool process_ric_event_trigger_definition(asn1::e2ap::ricsubscription_request_s subscription_request, + RIC_event_trigger_definition& event_def) = 0; private: const std::string _short_name; diff --git a/srsgnb/hdr/stack/ric/e2sm_kpm.h b/srsgnb/hdr/stack/ric/e2sm_kpm.h index fa0652d6e..fcacc8fa4 100644 --- a/srsgnb/hdr/stack/ric/e2sm_kpm.h +++ b/srsgnb/hdr/stack/ric/e2sm_kpm.h @@ -19,10 +19,6 @@ #ifndef RIC_E2SM_KPM_H #define RIC_E2SM_KPM_H -struct E2SM_KPM_RIC_event_definition { - uint64_t report_period; -}; - struct E2SM_KPM_RIC_ind_header { uint32_t collet_start_time; std::string file_formatversion; @@ -50,8 +46,8 @@ public: ~e2sm_kpm() = default; virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf); - bool process_subscription_request(asn1::e2ap::ricsubscription_request_s subscription_request, - E2SM_KPM_RIC_event_definition& event_def); + virtual bool process_ric_event_trigger_definition(asn1::e2ap::ricsubscription_request_s subscription_request, + RIC_event_trigger_definition& event_def); bool process_ric_action_definition(asn1::e2ap::ri_caction_to_be_setup_item_s ric_action); bool generate_indication_header(E2SM_KPM_RIC_ind_header hdr, srsran::unique_byte_buffer_t& buf); bool generate_indication_message(E2SM_KPM_RIC_ind_message msg, srsran::unique_byte_buffer_t& buf); diff --git a/srsgnb/src/stack/ric/e2sm_kpm.cc b/srsgnb/src/stack/ric/e2sm_kpm.cc index 2ca91ee96..96a47da0c 100644 --- a/srsgnb/src/stack/ric/e2sm_kpm.cc +++ b/srsgnb/src/stack/ric/e2sm_kpm.cc @@ -86,8 +86,8 @@ bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc, return true; } -bool e2sm_kpm::process_subscription_request(asn1::e2ap::ricsubscription_request_s subscription_request, - E2SM_KPM_RIC_event_definition& event_def) +bool e2sm_kpm::process_ric_event_trigger_definition(asn1::e2ap::ricsubscription_request_s subscription_request, + RIC_event_trigger_definition& event_def) { using namespace asn1::e2sm_kpm; e2_sm_kpm_event_trigger_definition_s trigger_def; @@ -98,6 +98,7 @@ bool e2sm_kpm::process_subscription_request(asn1::e2ap::ricsubscription_request_ return false; } + event_def.type = RIC_event_trigger_definition::e2sm_event_trigger_type_t::E2SM_REPORT; event_def.report_period = trigger_def.event_definition_formats.event_definition_format1().report_period; return true; } diff --git a/srsgnb/src/stack/ric/ric_subscription.cc b/srsgnb/src/stack/ric/ric_subscription.cc index d3692f862..309a31f5c 100644 --- a/srsgnb/src/stack/ric/ric_subscription.cc +++ b/srsgnb/src/stack/ric/ric_subscription.cc @@ -22,7 +22,7 @@ ric_client::ric_subscription::ric_subscription(ric_client* ric_cli ric_instance_id(ric_subscription_request->ri_crequest_id->ric_instance_id), ra_nfunction_id(ric_subscription_request->ra_nfunction_id->value) { - reporting_timer = parent->task_sched.get_unique_timer(); + reporting_timer = parent->task_sched.get_unique_timer(); parent->e2ap_.process_subscription_request(ric_subscription_request); @@ -31,13 +31,15 @@ ric_client::ric_subscription::ric_subscription(ric_client* ric_cli return; } - E2SM_KPM_RIC_event_definition event_def; - e2sm_kpm* sm_kpm_ptr = dynamic_cast(ran_func_desc.sm_ptr); - if (sm_kpm_ptr->process_subscription_request(ric_subscription_request, event_def)) { - reporting_period = event_def.report_period; - reporting_period = 1000; // TODO: to remove, keep it 1s for testing + RIC_event_trigger_definition event_trigger; + if (ran_func_desc.sm_ptr->process_ric_event_trigger_definition(ric_subscription_request, event_trigger)) { + if (event_trigger.type == RIC_event_trigger_definition::e2sm_event_trigger_type_t::E2SM_REPORT) { + reporting_period = event_trigger.report_period; + reporting_period = 1000; // TODO: to remove, keep it 1s for testing + } } + e2sm_kpm* sm_kpm_ptr = dynamic_cast(ran_func_desc.sm_ptr); ri_cactions_to_be_setup_list_l& action_list = ric_subscription_request->ricsubscription_details->ric_action_to_be_setup_list;