[Epic-ID: ODUHIGH-516][Task-ID: 526] Handling of RIC Service Acknowledge and Failure
[o-du/l2.git] / src / du_app / du_tmr.c
index 28663d8..838dd35 100644 (file)
@@ -53,7 +53,15 @@ bool duChkTmr(PTR cb, int16_t tmrEvnt)
              return TRUE;
          }
       }
-      
+      case EVENT_RIC_SERVICE_UPDATE_TMR:
+      {
+         if(((RicServiceUpdateTimer*)cb)->timer.tmrEvnt == EVENT_RIC_SERVICE_UPDATE_TMR)
+         {
+            DU_LOG("\nERROR  -->  DU_APP : duChkTmr: Timer already running for event [%d]", tmrEvnt);
+            return TRUE;
+         }
+         break;
+      }      
       default:
       {
          DU_LOG("\nERROR  -->  DU_APP : duChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
@@ -90,6 +98,16 @@ void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue)
          arg.max = MAX_E2_SETUP_TMR;
          break;
       }
+      case EVENT_RIC_SERVICE_UPDATE_TMR:
+      {
+         RicServiceUpdateTimer *ricServiceUpdateTimer;
+         ricServiceUpdateTimer= ((RicServiceUpdateTimer*)cb);
+         TMR_CALCUATE_WAIT(arg.wait, timerValue, duCb.duTimersInfo.tmrRes);
+
+         arg.timers = &ricServiceUpdateTimer->timer;
+         arg.max = MAX_RIC_SERVICE_UPDATE_TMR;
+         break;
+      }
       default:
       {
          DU_LOG("\nERROR  -->  DU : duStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
@@ -132,6 +150,14 @@ void duTmrExpiry(PTR cb,int16_t tmrEvnt)
          BuildAndSendE2SetupReq();
          break;
       }
+      case EVENT_RIC_SERVICE_UPDATE_TMR:
+      {
+         RicServiceUpdateTimer *ricServiceUpdateTimer;
+         
+         ricServiceUpdateTimer= ((RicServiceUpdateTimer*)cb);
+         BuildAndSendRicServiceUpdate(ricServiceUpdateTimer->ricService);
+         break;
+      }
       default:
       {
          DU_LOG("\nERROR  -->  DU : duStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);