return ret;
}
+/*******************************************************************
+ *
+ * @brief Fill and send statistics response to MAC
+ *
+ * @details
+ *
+ * Function : SchSendStatsRspToMac
+ *
+ * Functionality: Fill and send statistics response to MAC
+ *
+ * @params[in] Inst inst, SchMacRsp result
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchSendStatsRspToMac(Inst inst, SchMacRsp result, CauseOfResult cause)
+{
+ Pst rspPst;
+ uint8_t ret = ROK;
+ SchStatsRsp *statsRsp;
+
+ DU_LOG("\nINFO --> SCH : Filling statistics response");
+ SCH_ALLOC(statsRsp, sizeof(SchStatsRsp));
+ if(statsRsp == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Failed to allocate memory in SchSendStatsRspToMac()");
+ return RFAILED;
+ }
+ memset(statsRsp, 0, sizeof(SchStatsRsp));
+ statsRsp->rsp = result;
+ statsRsp->cause = cause;
+
+ /* Filling response post */
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_SCH_TO_MAC(rspPst, inst);
+ rspPst.event = EVENT_STATISTICS_RSP_TO_MAC;
+
+ ret = MacMessageRouter(&rspPst, (void *)statsRsp);
+ if(ret == RFAILED)
+ {
+ DU_LOG("\nERROR --> SCH : SchSendStatsRspToMac(): Failed to send Statistics Response");
+ return ret;
+ }
+ return ret;
+}
+
/*******************************************************************
*
* @brief Processes Statistics Request from MAC
SCH_FREE(statsReq, sizeof(SchStatsReq));
- /* TODO : in next gerrit */
- //SchSendStatsRspToMac(inst, rsp, cause);
+ SchSendStatsRspToMac(inst, rsp, cause);
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
**********************************************************************/