From 076aa6b1f8af6ff2e0877218cfc421a91a355b0d Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Wed, 1 Apr 2020 17:55:37 +0100 Subject: [PATCH] fix mobility test for when the eutra_capability is received --- srsenb/src/stack/rrc/rrc.cc | 2 +- srsenb/src/stack/rrc/rrc_mobility.cc | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index 59b809bd8..583cf4045 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -1318,7 +1318,7 @@ bool rrc::ue::handle_ue_cap_info(ue_cap_info_s* msg) parent->rrc_log->error("Failed to unpack EUTRA capabilities message\n"); return false; } - eutra_capabilities_unpacked = false; // TODO: Shall be set to true + eutra_capabilities_unpacked = true; parent->rrc_log->info("UE rnti: 0x%x category: %d\n", rnti, eutra_capabilities.ue_category); } } diff --git a/srsenb/src/stack/rrc/rrc_mobility.cc b/srsenb/src/stack/rrc/rrc_mobility.cc index e708328f6..e065839f0 100644 --- a/srsenb/src/stack/rrc/rrc_mobility.cc +++ b/srsenb/src/stack/rrc/rrc_mobility.cc @@ -792,13 +792,16 @@ bool rrc::ue::rrc_mobility::start_ho_preparation(uint32_t target_eci, Debug("UE RA Category: %d\n", capitem.ue_category); } else { hoprep_r8.ue_radio_access_cap_info.resize(1); - for (ue_cap_rat_container_s& ratcntr : hoprep_r8.ue_radio_access_cap_info) { - ratcntr.rat_type = asn1::rrc::rat_type_e::eutra; - asn1::bit_ref bref(&ratcntr.ue_cap_rat_container[0], ratcntr.ue_cap_rat_container.size()); - if (rrc_ue->eutra_capabilities.pack(bref) == asn1::SRSASN_ERROR_ENCODE_FAIL) { - rrc_log->error("Failed to pack UE EUTRA Capability\n"); - } + hoprep_r8.ue_radio_access_cap_info[0].rat_type = asn1::rrc::rat_type_e::eutra; + + srslte::unique_byte_buffer_t buffer = srslte::allocate_unique_buffer(*pool); + asn1::bit_ref bref(buffer->msg, buffer->get_tailroom()); + if (rrc_ue->eutra_capabilities.pack(bref) == asn1::SRSASN_ERROR_ENCODE_FAIL) { + rrc_log->error("Failed to pack UE EUTRA Capability\n"); + return false; } + hoprep_r8.ue_radio_access_cap_info[0].ue_cap_rat_container.resize(bref.distance_bytes()); + memcpy(&hoprep_r8.ue_radio_access_cap_info[0].ue_cap_rat_container[0], buffer->msg, bref.distance_bytes()); } /*** fill AS-Config ***/ hoprep_r8.as_cfg_present = true;