X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2F5gnrsch%2Fsch.c;h=397e8621a629cfb9af8d4503189eb0db1b1784e9;hb=refs%2Fchanges%2F60%2F11760%2F2;hp=8e90431a2101d9f46c39ec18c778c6216cec03ac;hpb=a14bf79bbc001990f96e01ada0dd291bcc9ddcad;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch.c b/src/5gnrsch/sch.c index 8e90431a2..397e8621a 100644 --- a/src/5gnrsch/sch.c +++ b/src/5gnrsch/sch.c @@ -2690,6 +2690,52 @@ uint8_t SchProcStatsReq(Pst *pst, SchStatsReq *statsReq) return ROK; } /* End of SchProcStatsReq */ +/******************************************************************* + * + * @brief Fill and send statistics indication to MAC + * + * @details + * + * Function : SchSendStatsIndToMac + * + * Functionality: Fill and send statistics indication to MAC + * + * @params[in] SCH Instance + * Measurement Type + * Measurement Value + * Size of value parameter + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t SchSendStatsIndToMac(Inst inst, SchMeasurementType measType, double value) +{ + Pst pst; + uint8_t ret = ROK; + SchStatsInd statsInd; + +#ifdef DEBUG_PRINT + DU_LOG("\nDEBUG --> SCH : Filling statistics indication"); +#endif + + memset(&statsInd, 0, sizeof(SchStatsInd)); + statsInd.type = measType; + statsInd.value = value; + + /* Filling post structure */ + memset(&pst, 0, sizeof(Pst)); + FILL_PST_SCH_TO_MAC(pst, inst); + pst.event = EVENT_STATISTICS_IND_TO_MAC; + + ret = MacMessageRouter(&pst, (void *)&statsInd); + if(ret == RFAILED) + { + DU_LOG("\nERROR --> SCH : SchSendStatsIndToMac(): Failed to send Statistics Indication"); + } + return ret; +} + + /********************************************************************** End of file **********************************************************************/