X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcu_stub%2Fcu_f1ap_msg_hdl.c;h=4313f699d37040d88f374a3c72d44da6ccfe7aa1;hb=ef711b0830aedde36f4a1beceed146d08e77ce58;hp=55c95ca134cbacbe877f6cf7861f9872387fc315;hpb=be7e4e372cc1d6f12f7af9c6b6d09a7ecedca58c;p=o-du%2Fl2.git diff --git a/src/cu_stub/cu_f1ap_msg_hdl.c b/src/cu_stub/cu_f1ap_msg_hdl.c index 55c95ca13..4313f699d 100644 --- a/src/cu_stub/cu_f1ap_msg_hdl.c +++ b/src/cu_stub/cu_f1ap_msg_hdl.c @@ -114,7 +114,37 @@ void plmnBuildCU(Plmn plmn, OCTET_STRING_t *octe) octe->buf[2] = ((plmn.mnc[2] << 4) | (plmn.mnc[1])); } } + /******************************************************************* +* +* @brief Builds NRCell ID +* +* @details +* +* Function : BuildNrCellId +* +* Functionality: Building the NR Cell ID +* +* @params[in] BIT_STRING_t *nrcell +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +S16 BuildNrCellId(BIT_STRING_t *nrcell) +{ + U8 tmp; + for (tmp = 0 ; tmp < nrcell->size-1; tmp++) + { + nrcell->buf[tmp] = 0; + } + nrcell->buf[4] = 16; + nrcell->bits_unused = 4; + nrcell->size = 5 * sizeof(uint8_t); + RETVALUE(ROK); +} + +/******************************************************************** * * @brief Builds and sends the F1SetupResponse * @@ -320,7 +350,7 @@ S16 BuildAndSendF1SetupRsp() plmnBuildCU(cuCfgParams.plmn , &cellToActivate->list.array[0]->value.choice.\ Cells_to_be_Activated_List_Item.nRCGI.pLMN_Identity); cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\ - nRCGI.nRCellIdentity.size = 5*sizeof(uint8_t); + nRCGI.nRCellIdentity.size = 5; CU_ALLOC(cellToActivate->list.array[0]->value.choice.\ Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf,\ 5*sizeof(uint8_t)); @@ -351,18 +381,7 @@ S16 BuildAndSendF1SetupRsp() CU_FREE(f1apMsg, sizeof(F1AP_PDU_t)); RETVALUE(RFAILED); } - for (int tmp = 0 ; tmp < cellToActivate->list.array[0]->value.\ - choice.Cells_to_be_Activated_List_Item.\ - nRCGI.nRCellIdentity.size-1; tmp++) - { - cellToActivate->list.array[0]->value.choice.\ - Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf[tmp] = 0; - } - cellToActivate->list.array[0]->value.choice.\ - Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity.buf[4] = 16; - cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.\ - nRCGI.nRCellIdentity.bits_unused = 4; - + BuildNrCellId(&(cellToActivate->list.array[0]->value.choice.Cells_to_be_Activated_List_Item.nRCGI.nRCellIdentity)); /* RRC Version */ idx++; f1SetupRsp->protocolIEs.list.array[idx]->id = \