|
|
@ -73,13 +73,16 @@ int e2sm_kpm::process_ric_action_definition()
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool e2sm_kpm::generate_indication_header(srsran::unique_byte_buffer_t& buf)
|
|
|
|
bool e2sm_kpm::generate_indication_header(RIC_indication_header hdr, srsran::unique_byte_buffer_t& buf)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using namespace asn1::e2sm_kpm;
|
|
|
|
using namespace asn1::e2sm_kpm;
|
|
|
|
e2_sm_kpm_ind_hdr_s e2_sm_kpm_ind_hdr;
|
|
|
|
e2_sm_kpm_ind_hdr_s e2_sm_kpm_ind_hdr;
|
|
|
|
e2_sm_kpm_ind_hdr.ind_hdr_formats.ind_hdr_format1().collet_start_time.from_string("43f51164");
|
|
|
|
e2_sm_kpm_ind_hdr.ind_hdr_formats.ind_hdr_format1().collet_start_time.from_number(hdr.collet_start_time);
|
|
|
|
|
|
|
|
e2_sm_kpm_ind_hdr.ind_hdr_formats.ind_hdr_format1().file_formatversion.from_string(hdr.file_formatversion);
|
|
|
|
|
|
|
|
e2_sm_kpm_ind_hdr.ind_hdr_formats.ind_hdr_format1().sender_name.from_string(hdr.sender_name);
|
|
|
|
|
|
|
|
e2_sm_kpm_ind_hdr.ind_hdr_formats.ind_hdr_format1().sender_type.from_string(hdr.sender_type);
|
|
|
|
|
|
|
|
e2_sm_kpm_ind_hdr.ind_hdr_formats.ind_hdr_format1().vendor_name.from_string(hdr.vendor_name);
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("Generating E2-SM-KPM Indication Header");
|
|
|
|
|
|
|
|
asn1::bit_ref bref(buf->msg, buf->get_tailroom());
|
|
|
|
asn1::bit_ref bref(buf->msg, buf->get_tailroom());
|
|
|
|
if (e2_sm_kpm_ind_hdr.pack(bref) != asn1::SRSASN_SUCCESS) {
|
|
|
|
if (e2_sm_kpm_ind_hdr.pack(bref) != asn1::SRSASN_SUCCESS) {
|
|
|
|
printf("IND HEADER: Failed to pack TX E2 PDU\n");
|
|
|
|
printf("IND HEADER: Failed to pack TX E2 PDU\n");
|
|
|
@ -90,31 +93,31 @@ bool e2sm_kpm::generate_indication_header(srsran::unique_byte_buffer_t& buf)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool e2sm_kpm::generate_indication_message(srsran::unique_byte_buffer_t& buf)
|
|
|
|
bool e2sm_kpm::generate_indication_message(RIC_indication_message msg, srsran::unique_byte_buffer_t& buf)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using namespace asn1::e2sm_kpm;
|
|
|
|
using namespace asn1::e2sm_kpm;
|
|
|
|
e2_sm_kpm_ind_msg_s e2_sm_kpm_ind_msg;
|
|
|
|
e2_sm_kpm_ind_msg_s e2_sm_kpm_ind_msg;
|
|
|
|
e2_sm_kpm_ind_msg.ind_msg_formats.set_ind_msg_format1();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto& meas_data_list = e2_sm_kpm_ind_msg.ind_msg_formats.ind_msg_format1().meas_data;
|
|
|
|
switch (msg.ind_msg_format) {
|
|
|
|
meas_data_list.resize(1);
|
|
|
|
case asn1::e2sm_kpm::e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types::ind_msg_format1:
|
|
|
|
meas_data_list[0].meas_record.resize(11);
|
|
|
|
e2_sm_kpm_ind_msg.ind_msg_formats.set_ind_msg_format1();
|
|
|
|
for (uint32_t i = 0; i < meas_data_list[0].meas_record.size(); i++) {
|
|
|
|
e2_sm_kpm_ind_msg.ind_msg_formats.ind_msg_format1().meas_data = msg.meas_data;
|
|
|
|
meas_data_list[0].meas_record[i].set_integer() = i * 1000;
|
|
|
|
e2_sm_kpm_ind_msg.ind_msg_formats.ind_msg_format1().meas_info_list = msg.meas_info_list;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case asn1::e2sm_kpm::e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types::ind_msg_format2:
|
|
|
|
|
|
|
|
e2_sm_kpm_ind_msg.ind_msg_formats.set_ind_msg_format2();
|
|
|
|
|
|
|
|
// TODO: support format2
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case asn1::e2sm_kpm::e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types::ind_msg_format3:
|
|
|
|
|
|
|
|
e2_sm_kpm_ind_msg.ind_msg_formats.set_ind_msg_format3();
|
|
|
|
|
|
|
|
// TODO: support format3
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case asn1::e2sm_kpm::e2_sm_kpm_ind_msg_s::ind_msg_formats_c_::types::nulltype:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
log_invalid_choice_id(msg.ind_msg_format, "e2_sm_kpm_ind_msg_s::ind_msg_formats_c_");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto& meas_info_list = e2_sm_kpm_ind_msg.ind_msg_formats.ind_msg_format1().meas_info_list;
|
|
|
|
|
|
|
|
meas_info_list.resize(2);
|
|
|
|
|
|
|
|
meas_info_list[0].meas_type.set_meas_name().from_string("PrbDlUsage");
|
|
|
|
|
|
|
|
meas_info_list[0].label_info_list.resize(1);
|
|
|
|
|
|
|
|
meas_info_list[0].label_info_list[0].meas_label.no_label_present = true;
|
|
|
|
|
|
|
|
meas_info_list[0].label_info_list[0].meas_label.no_label = asn1::e2sm_kpm::meas_label_s::no_label_opts::true_value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
meas_info_list[1].meas_type.set_meas_id() = 1;
|
|
|
|
|
|
|
|
meas_info_list[1].label_info_list.resize(1);
|
|
|
|
|
|
|
|
meas_info_list[1].label_info_list[0].meas_label.no_label_present = true;
|
|
|
|
|
|
|
|
meas_info_list[1].label_info_list[0].meas_label.no_label = asn1::e2sm_kpm::meas_label_s::no_label_opts::true_value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("Generating E2-SM-KPM Indication Message");
|
|
|
|
logger.info("Generating E2-SM-KPM Indication Message");
|
|
|
|
asn1::bit_ref bref(buf->msg, buf->get_tailroom());
|
|
|
|
asn1::bit_ref bref(buf->msg, buf->get_tailroom());
|
|
|
|
if (e2_sm_kpm_ind_msg.pack(bref) != asn1::SRSASN_SUCCESS) {
|
|
|
|
if (e2_sm_kpm_ind_msg.pack(bref) != asn1::SRSASN_SUCCESS) {
|
|
|
|