[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-481] Adding Trigger for Ul/Dl data
[o-du/l2.git] / src / phy_stub / phy_stub_msg_hdl.c
index 8021a87..e086982 100644 (file)
 #include "phy_stub_utils.h"
 #include "lwr_mac_phy_stub_inf.h"
 
+/*******************************************************************
+ *
+ * @brief start the uplink data
+ *
+ * @details
+ *
+ *    Function : startUlData 
+ *
+ *    Functionality: start the uplink data
+ *
+ * @params[in]   
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void startUlData()
+{
+   uint8_t ueIdx=0, drbIdx=0;
+
+   /* Start Pumping data from PHY stub to DU */
+   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
+      {
+         DU_LOG("\nDEBUG  --> PHY STUB: Sending UL User Data[DrbId:%d] for UEIdx %d\n",drbIdx,ueIdx);
+         l1SendUlUserData(drbIdx,ueIdx);
+      }
+   } 
+}
+
 /*******************************************************************
  *
  * @brief Builds and sends param response to MAC CL
@@ -667,6 +698,13 @@ break;
    if(pduInfo->pdu_length)
       MAC_FREE(pduInfo->pduData, pduInfo->pdu_length);
    MAC_FREE(rxDataInd, sizeof(fapi_rx_data_indication_t));
+
+#ifdef START_DL_UL_DATA 
+      if(phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp == true)
+      {
+         startUlData();
+      }
+#endif
    return ROK;
 }
 #endif
@@ -732,6 +770,7 @@ uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn, uint8_t raPreambleId
    return ROK;
 }
 
+
 /*******************************************************************
  *
  * @brief Builds and Send the Slot Indication message to MAC
@@ -799,6 +838,7 @@ uint16_t l1BuildAndSendSlotIndication()
       }
       CMCHKPK(oduPackPointer, (PTR)slotIndMsg, mBuf);
       ODU_POST_TASK(&pst, mBuf);
+
    }
 #endif
    return ROK;