X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_msg_hdl.c;h=644494300bd104e862f2f2908386fbff1fda4894;hb=refs%2Fchanges%2F87%2F11787%2F4;hp=e29aa3b0dec6bdd419fc5c67e4b96ea78c8ca238;hpb=f73456bd55152c329601f8286ae67fe9875025bc;p=o-du%2Fl2.git diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index e29aa3b0d..644494300 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -2150,11 +2150,13 @@ Statistics FetchStatsFromActionDefFormat1(ActionDefFormat1 format1) /* Hardcoding values for now for testing purpose * Will be removed in next gerrit */ - stats.macStatsReq.numStats = 2; - stats.macStatsReq.statsList[0].type = MAC_DL_TOTAL_PRB_USAGE; - stats.macStatsReq.statsList[0].periodicity = 100; - stats.macStatsReq.statsList[1].type = MAC_UL_TOTAL_PRB_USAGE; - stats.macStatsReq.statsList[1].periodicity = 100; + stats.macStatsReq.subscriptionId = 1; + stats.macStatsReq.numStatsGroup = 1; + stats.macStatsReq.statsGrpList[0].groupId = 1; + stats.macStatsReq.statsGrpList[0].periodicity = 100; + stats.macStatsReq.statsGrpList[0].numStats = 2; + stats.macStatsReq.statsGrpList[0].statsList[0] = MAC_DL_TOTAL_PRB_USAGE; + stats.macStatsReq.statsGrpList[0].statsList[1] = MAC_UL_TOTAL_PRB_USAGE; return stats; } @@ -2217,6 +2219,103 @@ uint8_t BuildAndSendStatsReq(ActionDefinition subscribedAction) return ROK; } +/******************************************************************* + * + * @brief Process statistics response from MAC + * + * @details + * + * Function : DuProcMacStatsRsp + * + * Functionality: Processes statistics configuration response + * from MAC. If configuration is succsessful, DUAPP starts + * reporting period timer for this subscription request + * from RIC + * + * @params[in] + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t DuProcMacStatsRsp(Pst *pst, MacStatsRsp *statsRsp) +{ + uint8_t idx = 0; + + DU_LOG("\nINFO --> DU_APP : DuProcMacStatsRsp: Received Statistics Response from MAC"); + + if(statsRsp) + { +#ifdef DEBUG_PRINT + DU_LOG("\n Subscription Id [%ld]", statsRsp->subscriptionId); + + DU_LOG("\n Number of Accepted Groups [%d]", statsRsp->numGrpAccepted); + for(idx=0; idxnumGrpAccepted; idx++) + { + DU_LOG("\n Group Id [%d]", statsRsp->statsGrpAcceptedList[idx]); + } + + DU_LOG("\n Number of Rejected Groups [%d]", statsRsp->numGrpRejected); + for(idx=0; idxnumGrpRejected; idx++) + { + DU_LOG("\n Group Id [%d]", statsRsp->statsGrpRejectedList[idx]); + } +#endif + + DU_FREE_SHRABL_BUF(pst->region, pst->pool, statsRsp, sizeof(MacStatsRsp)); + return ROK; + } + + DU_LOG("\nERROR --> DU_APP : DuProcMacStatsRsp: Received NULL Pointer"); + return RFAILED; +} + +/******************************************************************* + * + * @brief Process statistics indication from MAC + * + * @details + * + * Function : DuProcMacStatsInd + * + * Functionality: Processes statistics indication from MAC. + * + * @params[in] + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t DuProcMacStatsInd(Pst *pst, MacStatsInd *statsInd) +{ + if(statsInd) + { +#ifdef DEBUG_PRINT + DU_LOG("\nDEBUG --> DU_APP : DuProcMacStatsInd: Received Statistics Indication"); + DU_LOG("\n Subscription Id [%ld]", statsInd->subscriptionId); + DU_LOG("\n Group Id [%d]", statsInd->groupId); + for(int idx = 0; idx < statsInd->numStats; idx++) + { + DU_LOG("\n Meas type [%d] Meas Value [%lf]", statsInd->measuredStatsList[idx].type,\ + statsInd->measuredStatsList[idx].value); + } +#endif + + /* TODO : When stats indication is received + * DU APP searches for the message type in E2AP RIC subscription database + * and stores in the value in the list of subscribed measurements + * + * This will be implemented in next gerrit. + */ + + DU_FREE_SHRABL_BUF(pst->region, pst->pool, statsInd, sizeof(MacStatsInd)); + return ROK; + } + + DU_LOG("\nINFO --> DU_APP : DuProcMacStatsInd: Received NULL Pointer"); + return RFAILED; +} + /********************************************************************** End of file **********************************************************************/