nr,gnb,rrc: Add initial UE capability transfer

master
Bedran Karakoc 3 years ago committed by Andre Puschmann
parent 8a27cdf45a
commit 647882d03e

@ -69,6 +69,9 @@ public:
void handle_rrc_reestablishment_request(const asn1::rrc_nr::rrc_reest_request_s& msg); void handle_rrc_reestablishment_request(const asn1::rrc_nr::rrc_reest_request_s& msg);
void handle_rrc_reestablishment_complete(const asn1::rrc_nr::rrc_reest_complete_s& msg); void handle_rrc_reestablishment_complete(const asn1::rrc_nr::rrc_reest_complete_s& msg);
/* TS 38.331 - 5.6.1 UE capability transfer */
void handle_ue_capability_information(const asn1::rrc_nr::ue_cap_info_s& msg);
/** TS 38.331 - 5.3.8 Connection Release */ /** TS 38.331 - 5.3.8 Connection Release */
void send_rrc_release(); void send_rrc_release();
@ -87,6 +90,9 @@ public:
/* TS 38.331 - 5.3.5 RRC reconfiguration */ /* TS 38.331 - 5.3.5 RRC reconfiguration */
void send_rrc_reconfiguration(); void send_rrc_reconfiguration();
/* TS 38.331 - 5.6.1 UE capability transfer */
void send_ue_capability_enquiry();
private: private:
int send_dl_ccch(const asn1::rrc_nr::dl_ccch_msg_s& dl_ccch_msg); int send_dl_ccch(const asn1::rrc_nr::dl_ccch_msg_s& dl_ccch_msg);
int send_dl_dcch(srsran::nr_srb srb, const asn1::rrc_nr::dl_dcch_msg_s& dl_dcch_msg); int send_dl_dcch(srsran::nr_srb srb, const asn1::rrc_nr::dl_dcch_msg_s& dl_dcch_msg);

@ -554,6 +554,9 @@ void rrc_nr::handle_ul_dcch(uint16_t rnti, uint32_t lcid, srsran::const_byte_spa
case ul_dcch_msg_type_c::c1_c_::types_opts::rrc_reest_complete: case ul_dcch_msg_type_c::c1_c_::types_opts::rrc_reest_complete:
u.handle_rrc_reestablishment_complete(ul_dcch_msg.msg.c1().rrc_reest_complete()); u.handle_rrc_reestablishment_complete(ul_dcch_msg.msg.c1().rrc_reest_complete());
break; break;
case ul_dcch_msg_type_c::c1_c_::types_opts::ue_cap_info:
u.handle_ue_capability_information(ul_dcch_msg.msg.c1().ue_cap_info());
break;
default: default:
log_rx_pdu_fail(rnti, srb_to_lcid(lte_srb::srb0), pdu, "Unsupported UL-CCCH message type", false); log_rx_pdu_fail(rnti, srb_to_lcid(lte_srb::srb0), pdu, "Unsupported UL-CCCH message type", false);
// TODO Remove user // TODO Remove user

@ -1116,8 +1116,8 @@ void rrc_nr::ue::handle_security_mode_complete(const asn1::rrc_nr::security_mode
// finally, also enable ciphering on SRB1 // finally, also enable ciphering on SRB1
update_as_security(srb_to_lcid(srsran::nr_srb::srb1), false, true); update_as_security(srb_to_lcid(srsran::nr_srb::srb1), false, true);
send_ue_capability_enquiry();
send_rrc_reconfiguration(); send_rrc_reconfiguration();
// Note: Skip UE capabilities
// Send RRCReconfiguration if necessary // Send RRCReconfiguration if necessary
if (not nas_pdu_queue.empty()) { if (not nas_pdu_queue.empty()) {
@ -1189,6 +1189,49 @@ void rrc_nr::ue::send_rrc_reconfiguration()
} }
} }
void rrc_nr::ue::send_ue_capability_enquiry()
{
dl_dcch_msg_s dl_dcch_msg;
dl_dcch_msg.msg.set_c1().set_ue_cap_enquiry().rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
ue_cap_enquiry_ies_s& ies = dl_dcch_msg.msg.c1().ue_cap_enquiry().crit_exts.set_ue_cap_enquiry();
// ue-CapabilityRAT-RequestList
ue_cap_rat_request_s cap_rat_request;
cap_rat_request.rat_type.value = rat_type_opts::nr;
cap_rat_request.cap_request_filt_present = true;
// capabilityRequestFilter
ue_cap_request_filt_nr_s request_filter;
// frequencyBandListFilter
request_filter.freq_band_list_filt_present = true;
freq_band_info_c freq_band_info;
freq_band_info_nr_s& freq_band_info_nr = freq_band_info.set_band_info_nr();
// Iterate through cell list and assign bandInformationNR items
for (auto& iter : parent->cfg.cell_list) {
freq_band_info_nr.band_nr = iter.band;
request_filter.freq_band_list_filt.push_back(freq_band_info);
}
// Pack capabilityRequestFilter
cap_rat_request.cap_request_filt.resize(128);
asn1::bit_ref bref_pack(cap_rat_request.cap_request_filt.data(), cap_rat_request.cap_request_filt.size());
if (request_filter.pack(bref_pack) != asn1::SRSASN_SUCCESS) {
logger.error("Failed to pack capabilityRequestFilter in UE Capability Enquiry");
}
cap_rat_request.cap_request_filt.resize(bref_pack.distance_bytes());
ies.ue_cap_rat_request_list.push_back(cap_rat_request);
send_dl_dcch(srsran::nr_srb::srb1, dl_dcch_msg);
}
void rrc_nr::ue::handle_ue_capability_information(const asn1::rrc_nr::ue_cap_info_s& msg)
{
logger.info("UECapabilityInformation transaction ID: %d", msg.rrc_transaction_id);
}
void rrc_nr::ue::handle_rrc_reconfiguration_complete(const asn1::rrc_nr::rrc_recfg_complete_s& msg) void rrc_nr::ue::handle_rrc_reconfiguration_complete(const asn1::rrc_nr::rrc_recfg_complete_s& msg)
{ {
update_mac(next_cell_group_cfg, true); update_mac(next_cell_group_cfg, true);

Loading…
Cancel
Save