[Epic-ID: ODUHIGH-538][Issue-ID: ODUHIGH-575] Deallocating the variables allocated...
[o-du/l2.git] / src / phy_stub / phy_stub_thread_hdl.c
index 7699009..72ddaac 100644 (file)
 #include "common_def.h"
 #include "phy_stub_utils.h"
 #ifdef INTEL_FAPI
-#include "fapi.h"
+#include "nr5g_fapi_internal.h"
 #include "fapi_vendor_extension.h"
 #endif
 #include "phy_stub.h"
 #include "mac_sch_interface.h"
 
+uint16_t sfnValue;
+uint16_t slotValue;
+PhyDb phyDb;
 extern uint16_t l1BuildAndSendBSR(uint8_t ueIdx, BsrType bsrType,\
              LcgBufferSize lcgBsIdx[MAX_NUM_LOGICAL_CHANNEL_GROUPS]);
 pthread_t thread = 0;
 int socket_fd =0;
+bool     slotIndicationStarted;
 
 /*******************************************************************
  *
@@ -159,7 +163,7 @@ void *l1ConsoleHandler(void *args)
          while(counter)
          {
             /* Start Pumping data from PHY stub to DU */
-            for(ueIdx=0; ueIdx < MAX_NUM_UE; ueIdx++)
+            for(ueIdx=0; ueIdx < phyDb.ueDb.numActvUe; ueIdx++)
             {
                for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run
                {
@@ -205,6 +209,18 @@ void *l1ConsoleHandler(void *args)
             }
          }
       }
+      else if(ch == 'r')
+      {
+         /* Trigger RACH Indication towards DU */
+         if(phyDb.ueDb.ueCb[phyDb.ueDb.numActvUe].rachIndSent == false)
+         {
+            phyDb.ueDb.ueCb[phyDb.ueDb.numActvUe].rachIndSent = true;
+            phyDb.ueDb.ueCb[phyDb.ueDb.numActvUe].isCFRA = true;
+            l1BuildAndSendRachInd(slotValue, sfnValue, CF_RA_PREAMBLE_IDX);
+            phyDb.ueDb.numActvUe++;
+         }
+
+      }
       DU_LOG("\n");
       continue;
    }