e2ap: change func signature and move logic to the function

master
Piotr Gawlowicz 2 years ago committed by Justin Tallon
parent 4b18a55c2c
commit e51871a626

@ -57,7 +57,7 @@ public:
std::string get_func_description() { return _func_description; };
uint32_t get_revision() { return _revision; };
virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf) = 0;
virtual bool generate_ran_function_description(RANfunction_description& desc, ra_nfunction_item_s& ran_func) = 0;
virtual bool process_ric_event_trigger_definition(ricsubscription_request_s subscription_request,
RIC_event_trigger_definition_t& event_def) = 0;
virtual bool process_ric_action_definition(ri_caction_to_be_setup_item_s ric_action,

@ -48,7 +48,7 @@ public:
e2sm_kpm(srslog::basic_logger& logger_);
~e2sm_kpm() = default;
virtual bool generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf);
virtual bool generate_ran_function_description(RANfunction_description& desc, ra_nfunction_item_s& ran_func);
virtual bool process_ric_event_trigger_definition(ricsubscription_request_s subscription_request,
RIC_event_trigger_definition_t& event_def);
virtual bool process_ric_action_definition(ri_caction_to_be_setup_item_s ric_action, E2AP_RIC_action_t& action_entry);

@ -52,13 +52,7 @@ e2_ap_pdu_c e2ap::generate_setup_request()
ran_func.ran_function_id = local_ran_function_id;
ran_func.ran_function_revision = sm_ptr->get_revision();
ran_func.ran_function_oid.from_string(sm_ptr->get_oid().c_str());
auto& ran_func_def = ran_func.ran_function_definition;
srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer();
sm_ptr->generate_ran_function_description(x.second, buf);
ran_func_def.resize(buf->N_bytes);
buf->msg[1] = 0x30; // TODO: needed to keep wireshak happy, need better fix
std::copy(buf->msg, buf->msg + buf->N_bytes, ran_func_def.data());
sm_ptr->generate_ran_function_description(x.second, ran_func);
idx++;
}

@ -14,7 +14,7 @@ e2sm_kpm::e2sm_kpm(srslog::basic_logger& logger_) : e2sm(short_name, oid, func_d
supported_meas_types.push_back("test");
}
bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc, srsran::unique_byte_buffer_t& buf)
bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc, ra_nfunction_item_s& ran_func)
{
desc.function_shortname = short_name;
desc.function_e2_sm_oid = oid;
@ -78,12 +78,18 @@ bool e2sm_kpm::generate_ran_function_description(RANfunction_description& desc,
report_style_list[4].ric_ind_msg_format_type = 3;
*/
logger.info("Generating RAN function description");
srsran::unique_byte_buffer_t buf = srsran::make_byte_buffer();
asn1::bit_ref bref(buf->msg, buf->get_tailroom());
if (e2sm_kpm_ra_nfunction_description.pack(bref) != asn1::SRSASN_SUCCESS) {
printf("Failed to pack TX E2 PDU\n");
return false;
}
buf->N_bytes = bref.distance_bytes();
ran_func.ran_function_definition.resize(buf->N_bytes);
buf->msg[1] = 0x30; // TODO: needed to keep wireshak happy, need better fix
std::copy(buf->msg, buf->msg + buf->N_bytes, ran_func.ran_function_definition.data());
return true;
}

Loading…
Cancel
Save