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=38bc4b5310b63c09e900be34018ce540a387be8c;hpb=a14bf79bbc001990f96e01ada0dd291bcc9ddcad;p=o-du%2Fl2.git diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index 38bc4b531..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; } @@ -2238,23 +2240,79 @@ uint8_t BuildAndSendStatsReq(ActionDefinition subscribedAction) * ****************************************************************/ uint8_t DuProcMacStatsRsp(Pst *pst, MacStatsRsp *statsRsp) { + uint8_t idx = 0; + + DU_LOG("\nINFO --> DU_APP : DuProcMacStatsRsp: Received Statistics Response from MAC"); + if(statsRsp) { - if(statsRsp->rsp == MAC_DU_APP_RSP_OK) +#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("\nINFO --> DU_APP : Statistics configured successfully"); - /* TODO : Start Reporting period timer for this subscription request - * To be handled in next gerrit */ + DU_LOG("\n Group Id [%d]", statsRsp->statsGrpAcceptedList[idx]); } - else + + DU_LOG("\n Number of Rejected Groups [%d]", statsRsp->numGrpRejected); + for(idx=0; idxnumGrpRejected; idx++) { - DU_LOG("\nERROR --> DU_APP : Statistics configuration failed with cause [%d]", statsRsp->cause); + 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("\nINFO --> DU_APP : DuProcMacStatsRsp: Received NULL Pointer"); + 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; }