+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Failed to fetch subscriprtion details");
+ return RFAILED;
+ }
+
+ /* Fetch RIC subscription's action DB */
+ actionInfo = fetchActionInfoFromActionId(statsInd->groupId, ricSubscriptionInfo);
+ if(actionInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Failed to fetch action ID [%d]", statsInd->groupId);
+ return RFAILED;
+ }
+
+ /* Check Action format */
+ switch(actionInfo->definition.formatType)
+ {
+ case 1:
+ {
+ actionFormat = &actionInfo->definition.choice.format1;
+ break;
+ }
+ default:
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Action Format [%d] is not supported", \
+ actionInfo->definition.formatType);
+ return RFAILED;
+ }
+ }
+
+ /* Fetch each Measurement info from action info and store its reported value in DB */
+ for(statsIdx = 0; statsIdx < statsInd->numStats; statsIdx++)
+ {
+ memset(e2MeasTypeName, 0, STRING_SIZE_150_BYTES);
+ measInfo = NULLP;
+ measInfoNode = NULLP;
+
+ /* Convert Measurement type from MAC-supported format to E2-supported format */
+ if(convertMacMeasTypeToE2MeasType(statsInd->measuredStatsList[statsIdx].type, e2MeasTypeName) != ROK)
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Failed to convert measurement type from MAC-supported\
+ MAC-supported format to E2-supported format");
+ continue;
+ }
+
+ /* Fetch Measurement Info using E2-supported measurement type name */
+ measInfo = fetchMeasInfoFromMeasTypeName(e2MeasTypeName, &actionFormat->measurementInfoList, &measInfoNode);
+ if(measInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Measurement Type Name [%s] not found", e2MeasTypeName);
+ continue;
+ }
+
+ /* Store the measurement value in the measurement info DB fetched */
+ DU_ALLOC(measValue, sizeof(double));
+ if(!measValue)
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Memory allocation failed at line [%d]", __LINE__);
+ return RFAILED;
+ }
+ *measValue = statsInd->measuredStatsList[statsIdx].value;
+
+ DU_ALLOC(measValueNode, sizeof(CmLList));
+ if(!measValueNode)
+ {
+ DU_LOG("\nERROR --> E2AP : extractStatsMeasurement: Memory allocation failed at line [%d]", __LINE__);
+ DU_FREE(measValue, sizeof(double));
+ return RFAILED;
+ }
+ measValueNode->node = (PTR) measValue;
+ cmLListAdd2Tail(&measInfo->measuredValue, measValueNode);
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Handle RIC Subscription reporting timer expry
+ *
+ * @details
+ *
+ * Function : E2apHdlRicSubsReportTmrExp
+ *
+ * Functionality: On expiry of RIC subscription reporting
+ * timer expiry, RIC indication is sent for all actions
+ * in RIC subscription
+ *
+ * @params[in] RIC subscription DB
+ * @return void
+ *
+ * ****************************************************************/
+void E2apHdlRicSubsReportTmrExp(RicSubscription *ricSubscription)
+{
+ uint8_t actionIdx = 0;
+ uint32_t reportingPeriod = 0;
+
+ for(actionIdx = 0; actionIdx < MAX_RIC_ACTION; actionIdx++)
+ {
+ if(ricSubscription->actionSequence[actionIdx].actionId >= 0)
+ {
+ BuildAndSendRicIndication(ricSubscription, &ricSubscription->actionSequence[actionIdx]);
+ }
+ }
+
+ /* Start RIC Subscription reporting timer again */
+ switch(ricSubscription->eventTriggerDefinition.formatType)
+ {
+ case 1:
+ {
+ reportingPeriod = ricSubscription->eventTriggerDefinition.choice.format1.reportingPeriod;
+ /* Save the start time of reporting period */
+ storeReportStartTime(&ricSubscription->eventTriggerDefinition.choice.format1.startTime);
+ break;
+ }
+ default:
+ return;
+ }
+ if(duChkTmr((PTR)ricSubscription, EVENT_RIC_SUBSCRIPTION_REPORTING_TMR) != true)
+ {
+ duStartTmr((PTR)ricSubscription, EVENT_RIC_SUBSCRIPTION_REPORTING_TMR, reportingPeriod);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> E2AP : Failed in %s at line %d", __func__, __LINE__);