diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 7e9a83727a..806c70881d 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -2383,10 +2383,13 @@ uint8_t do_RRCConnectionReconfigurationComplete( const protocol_ctxt_t *const ctxt_pP, uint8_t *buffer, + LTE_RRCConnectionReconfigurationComplete_v1510_IEs_t *str, const uint8_t Transaction_id ) //------------------------------------------------------------------------------ { + LOG_I(RRC, "Melissa, entered do_RRCConnectionReconfigurationComplete \n"); + asn_enc_rval_t enc_rval; LTE_UL_DCCH_Message_t ul_dcch_msg; LTE_RRCConnectionReconfigurationComplete_t *rrcConnectionReconfigurationComplete; @@ -2398,6 +2401,14 @@ do_RRCConnectionReconfigurationComplete( rrcConnectionReconfigurationComplete->criticalExtensions.present = LTE_RRCConnectionReconfigurationComplete__criticalExtensions_PR_rrcConnectionReconfigurationComplete_r8; rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.nonCriticalExtension=NULL; + rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8. + nonCriticalExtension->nonCriticalExtension->nonCriticalExtension-> + nonCriticalExtension->nonCriticalExtension->nonCriticalExtension-> + scg_ConfigResponseNR_r15->buf = str->scg_ConfigResponseNR_r15->buf; + rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8. + nonCriticalExtension->nonCriticalExtension->nonCriticalExtension-> + nonCriticalExtension->nonCriticalExtension->nonCriticalExtension-> + scg_ConfigResponseNR_r15->size = str->scg_ConfigResponseNR_r15->size; /* Melissa need to add the release 15 message here into the ul_dcch_msg that we just got. We will receive the buffer as an octet string and then pull the data out and put it into this message we are encoding here. */ diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index 9bf4901a07..bf46451bcb 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -156,6 +156,7 @@ uint8_t do_RRCConnectionReconfigurationComplete( const protocol_ctxt_t *const ctxt_pP, uint8_t *buffer, + LTE_RRCConnectionReconfigurationComplete_v1510_IEs_t *str, const uint8_t Transaction_id ); diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h index 6b56be1022..82465780e1 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.h @@ -132,6 +132,7 @@ uint8_t do_RRCConnectionSetupComplete_NB_IoT(uint8_t Mod_id, uint8_t* buffer, co uint8_t do_RRCConnectionReconfigurationComplete_NB_IoT( const protocol_ctxt_t* const ctxt_pP, uint8_t* buffer, + LTE_RRCConnectionReconfigurationComplete_v1510_IEs_t *str, const uint8_t Transaction_id ); diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index a1d871d506..dc20bfd124 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -163,7 +163,10 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( * \param eNB_index Index of corresponding eNB/CH * \param Transaction_id RRC transaction identifier */ -static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id ); +static void rrc_ue_generate_RRCConnectionReconfigurationComplete(const protocol_ctxt_t *const ctxt_pP, + const uint8_t eNB_index, + const uint8_t Transaction_id, + LTE_RRCConnectionReconfigurationComplete_v1510_IEs_t *str); static void rrc_ue_generate_MeasurementReport(protocol_ctxt_t *const ctxt_pP, uint8_t eNB_index ); @@ -563,9 +566,13 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( } //----------------------------------------------------------------------------- -void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id ) { +void rrc_ue_generate_RRCConnectionReconfigurationComplete(const protocol_ctxt_t *const ctxt_pP, + const uint8_t eNB_index, + const uint8_t Transaction_id, + LTE_RRCConnectionReconfigurationComplete_v1510_IEs_t *str) { uint8_t buffer[32], size; - size = do_RRCConnectionReconfigurationComplete(ctxt_pP, buffer, Transaction_id); + LOG_I(RRC, "Melissa, calling do_RRCConnectionReconfigurationComplete \n"); + size = do_RRCConnectionReconfigurationComplete(ctxt_pP, buffer, str, Transaction_id); LOG_I(RRC,PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel UL-DCCH (SRB1), Generating RRCConnectionReconfigurationComplete (bytes %d, eNB_index %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), size, eNB_index); LOG_D(RLC, @@ -2293,7 +2300,8 @@ rrc_ue_decode_dcch( rrc_ue_generate_RRCConnectionReconfigurationComplete( ctxt_pP, target_eNB_index, - dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier); + dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier, + NULL); UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP].State = RRC_HO_EXECUTION; UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED; LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n", @@ -2347,7 +2355,8 @@ rrc_ue_decode_dcch( rrc_ue_generate_RRCConnectionReconfigurationComplete( ctxt_pP, eNB_indexP, - dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier); + dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier, + NULL); UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP].State = RRC_RECONFIGURED; LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n", ctxt_pP->module_id, @@ -6626,9 +6635,33 @@ void process_nr_nsa_msg(nsa_msg_t *msg, int msg_len) case NR_RRC_CONFIG_COMPLETE_REQ: { - LOG_I(RRC, "Got an NR_RRC_CONFIG_COMPLETE_REQ. Now make octet string and call below!\n"); - //rrc_ue_generate_RRCConnectionReconfigurationComplete(ctxt, 0, 0); - break; + LOG_I(RRC, "Got an NR_RRC_CONFIG_COMPLETE_REQ. Now make octet string and call below!\n"); + LTE_UL_DCCH_Message_t *nr_ul_dcch_msg = NULL; + asn_dec_rval_t dec_rval = uper_decode_complete(NULL, + &asn_DEF_LTE_UL_DCCH_Message, + (void **)&nr_ul_dcch_msg, + msg_buffer, + msg_len); + if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) + { + SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, (void *)nr_ul_dcch_msg, ASFM_FREE_EVERYTHING); + LOG_E(NR_RRC, "Failed to decode UECapabilityInfo (%zu bits)\n", dec_rval.consumed); + break; + } + LTE_RRCConnectionReconfigurationComplete_t *rrc_comp = &nr_ul_dcch_msg-> + message.choice. + c1.choice. + rrcConnectionReconfigurationComplete; + uint8_t t_id = rrc_comp->rrc_TransactionIdentifier; + LTE_RRCConnectionReconfigurationComplete_r8_IEs_t *rrc_comp_r8 = &rrc_comp->criticalExtensions.choice. + rrcConnectionReconfigurationComplete_r8; + LTE_RRCConnectionReconfigurationComplete_v1510_IEs_t *str = rrc_comp_r8->nonCriticalExtension-> + nonCriticalExtension->nonCriticalExtension-> + nonCriticalExtension->nonCriticalExtension-> + nonCriticalExtension; + + rrc_ue_generate_RRCConnectionReconfigurationComplete(&ctxt, &ctxt.eNB_index, t_id, &str); + break; } default: LOG_E(RRC, "No NSA Message Found\n"); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index c8cdfb9bc6..35b7d34781 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -287,9 +287,10 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR nr_rrc_ue_process_scg_config(module_id,cellGroupConfig); }else{ // after first time, update it and free the memory after. - SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)NR_UE_rrc_inst[module_id].cell_group_config, 0); NR_UE_rrc_inst[module_id].cell_group_config = cellGroupConfig; nr_rrc_ue_process_scg_config(module_id,cellGroupConfig); + LOG_I(NR_RRC, "Melissa, we have finished nr_rrc_ue_process_scg_config. Now freeing. \n"); + SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)NR_UE_rrc_inst[module_id].cell_group_config, 0); } } if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->measConfig != NULL){