e2ap: store sm_ptr in ric_subscription

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent d1ba988e27
commit 9ea0f2684a

@ -44,11 +44,12 @@ private:
uint16_t ra_nfunction_id; uint16_t ra_nfunction_id;
uint16_t ri_caction_id; uint16_t ri_caction_id;
e2sm* sm_ptr = nullptr;
uint32_t reporting_period = 0; // ms uint32_t reporting_period = 0; // ms
srsran::unique_timer reporting_timer; // for RIC indication reporting srsran::unique_timer reporting_timer; // for RIC indication reporting
std::vector<E2AP_RIC_action> admitted_actions; std::vector<E2AP_RIC_action> admitted_actions;
std::vector<uint32_t> not_admitted_actions; std::vector<uint32_t> not_admitted_actions;
}; };
} // namespace srsenb } // namespace srsenb

@ -32,8 +32,14 @@ ric_client::ric_subscription::ric_subscription(ric_client* ric_cli
return; return;
} }
sm_ptr = ran_func_desc.sm_ptr;
if (sm_ptr == nullptr) {
parent->logger.debug("No valid pointer to SM with RAN function id: %i\n", ra_nfunction_id);
return;
}
RIC_event_trigger_definition event_trigger; RIC_event_trigger_definition event_trigger;
if (ran_func_desc.sm_ptr->process_ric_event_trigger_definition(ric_subscription_request, event_trigger)) { if (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) { if (event_trigger.type == RIC_event_trigger_definition::e2sm_event_trigger_type_t::E2SM_REPORT) {
reporting_period = event_trigger.report_period; reporting_period = event_trigger.report_period;
reporting_period = 1000; // TODO: to remove, keep it 1s for testing reporting_period = 1000; // TODO: to remove, keep it 1s for testing
@ -50,7 +56,7 @@ ric_client::ric_subscription::ric_subscription(ric_client* ric_cli
admitted_action.ric_action_id = action_item.ric_action_id; admitted_action.ric_action_id = action_item.ric_action_id;
admitted_action.ric_action_type = action_item.ric_action_type; admitted_action.ric_action_type = action_item.ric_action_type;
if (ran_func_desc.sm_ptr->process_ric_action_definition(action_item, admitted_action)) { if (sm_ptr->process_ric_action_definition(action_item, admitted_action)) {
parent->logger.debug("Admitted action %i (type: %i), mapped to SM local action ID: %i", parent->logger.debug("Admitted action %i (type: %i), mapped to SM local action ID: %i",
admitted_action.ric_action_id, admitted_action.ric_action_id,
admitted_action.ric_action_type, admitted_action.ric_action_type,
@ -112,13 +118,10 @@ void ric_client::ric_subscription::delete_subscription()
} }
// remove registered actions from SM // remove registered actions from SM
RANfunction_description ran_func_desc; if (sm_ptr) {
if (!parent->e2ap_.get_func_desc(ra_nfunction_id, ran_func_desc)) { for (auto& action : admitted_actions) {
parent->logger.debug("Cannot find RAN function with ID: %i\n", ra_nfunction_id); sm_ptr->remove_ric_action_definition(action);
return; }
}
for (auto& action : admitted_actions) {
ran_func_desc.sm_ptr->remove_ric_action_definition(action);
} }
parent->logger.debug("Send RIC Subscription Delete Response to RIC Requestor ID: %i\n", ric_requestor_id); parent->logger.debug("Send RIC Subscription Delete Response to RIC Requestor ID: %i\n", ric_requestor_id);
@ -137,13 +140,7 @@ void ric_client::ric_subscription::send_ric_indication()
ric_indication.ri_caction_id = ri_caction_id; ric_indication.ri_caction_id = ri_caction_id;
ric_indication.indication_type = ri_cind_type_opts::report; ric_indication.indication_type = ri_cind_type_opts::report;
RANfunction_description ran_func_desc; e2sm_kpm* sm_kpm_ptr = dynamic_cast<e2sm_kpm*>(sm_ptr);
e2sm* sm_ptr = nullptr;
if (!parent->e2ap_.get_func_desc(ra_nfunction_id, ran_func_desc)) {
return;
}
e2sm_kpm* sm_kpm_ptr = dynamic_cast<e2sm_kpm*>(ran_func_desc.sm_ptr);
E2SM_KPM_RIC_ind_header ric_ind_header; E2SM_KPM_RIC_ind_header ric_ind_header;
ric_ind_header.collet_start_time = 0x12345; ric_ind_header.collet_start_time = 0x12345;

Loading…
Cancel
Save