From 30977ecc12feb850a94bd5a0ec0e7bb525a7ded8 Mon Sep 17 00:00:00 2001
From: Bing-Kai Hong <Bing-Kai.Hong@eurecom.fr>
Date: Fri, 14 Sep 2018 15:12:37 +0200
Subject: [PATCH] Replace some dummy value with DU from exist define in
 f1ap_setup_req_t

---
 openair2/ENB_APP/enb_config.c                 |  2 +-
 openair2/F1AP/f1ap_cu_interface_management.c  |  2 +-
 openair2/F1AP/f1ap_du_interface_management.c  | 14 +++++++-------
 openair2/F1AP/f1ap_du_ue_context_management.c | 14 ++------------
 4 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index b6e16f35ae..fcdd0fc893 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -2477,7 +2477,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
           F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.nr_band[0]              = rrc->carrier[0].sib1->freqBandIndicator;
           F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.sul_active              = 0;
         }
-        F1AP_SETUP_REQ (msg_p).measurement_timing_information[k]             = NULL;
+        F1AP_SETUP_REQ (msg_p).measurement_timing_information[k]             = "0";
         F1AP_SETUP_REQ (msg_p).ranac[k]                                      = 0;
         F1AP_SETUP_REQ (msg_p).mib[k]                                        = rrc->carrier[0].MIB;
         F1AP_SETUP_REQ (msg_p).sib1[k]                                       = rrc->carrier[0].SIB1;
diff --git a/openair2/F1AP/f1ap_cu_interface_management.c b/openair2/F1AP/f1ap_cu_interface_management.c
index 4564c99794..c3f1e5e34c 100644
--- a/openair2/F1AP/f1ap_cu_interface_management.c
+++ b/openair2/F1AP/f1ap_cu_interface_management.c
@@ -212,7 +212,7 @@ void CU_handle_F1_SETUP_REQUEST(instance_t instance,
 
   //   } tdd;
   // } nr_mode_info[F1AP_MAX_NB_CELLS];
-  if (num_cells_available < 1) {
+  if (num_cells_available > 0) {
     itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
   } else {
     CU_send_F1_SETUP_FAILURE(instance);
diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c
index dfcd6048a3..94dec3659b 100644
--- a/openair2/F1AP/f1ap_du_interface_management.c
+++ b/openair2/F1AP/f1ap_du_interface_management.c
@@ -265,7 +265,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance) {
         served_cell_information.nR_Mode_Info = nR_Mode_Info;
 
         /* - measurementTimingConfiguration */
-        char *measurementTimingConfiguration = "0"; //&f1ap_du_data->measurement_timing_information[i]; // sept. 2018
+        char *measurementTimingConfiguration = f1ap_du_data->measurement_timing_information[i]; // sept. 2018
 
         OCTET_STRING_fromBuf(&served_cell_information.measurementTimingConfiguration,
                              measurementTimingConfiguration,
@@ -390,11 +390,11 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
         served_cell_information.nRCGI = nRCGI;
 
         /* - nRPCI */
-        served_cell_information.nRPCI = 321L;  // int 0..1007
+        served_cell_information.nRPCI = f1ap_du_data->nr_pci[i];  // int 0..1007
 
         /* - fiveGS_TAC */
         OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
-                             "10",
+                             &f1ap_du_data->tac[i],
                              3);
 
         /* - Configured_EPS_TAC */
@@ -556,11 +556,11 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
         served_cell_information.nRCGI = nRCGI;
 
         /* - nRPCI */
-        served_cell_information.nRPCI = 321L;  // int 0..1007
+        served_cell_information.nRPCI = f1ap_du_data->nr_pci[i];  // int 0..1007
 
         /* - fiveGS_TAC */
         OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
-                             "10",
+                             &f1ap_du_data->tac[i],
                              3);
 
         /* - Configured_EPS_TAC */
@@ -706,7 +706,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
         F1AP_NRCGI_t oldNRCGI;
         MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
                                          &oldNRCGI.pLMN_Identity);
-        NR_CELL_ID_TO_BIT_STRING(123456, &oldNRCGI.nRCellIdentity);
+        NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &oldNRCGI.nRCellIdentity);
         served_cells_to_delete_item.oldNRCGI = oldNRCGI;
 
         /* ADD */
@@ -742,7 +742,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
         F1AP_NRCGI_t nRCGI;
         MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
                                          &nRCGI.pLMN_Identity);
-        NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+        NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[i], &nRCGI.nRCellIdentity);
         active_cells_item.nRCGI = nRCGI;
         
         /* ADD */
diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c
index 281e5f58a6..57dfa4703b 100644
--- a/openair2/F1AP/f1ap_du_ue_context_management.c
+++ b/openair2/F1AP/f1ap_du_ue_context_management.c
@@ -259,18 +259,8 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
      /* - nRCGI */
      F1AP_NRCGI_t nRCGI;  // issue here
      MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &nRCGI.pLMN_Identity);
-//
-     // INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
-     // nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
 
-     // nRCGI.nRCellIdentity.size = (36+7)/8;
-     // nRCGI.nRCellIdentity.bits_unused = 4;
-
-     // nRCGI.nRCellIdentity.buf[0] = 123;
-
-     //nRCGI.nRCellIdentity = 15;
-
-     NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+     NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
 
      sCell_FailedtoSetup_item.sCell_ID = nRCGI;
 
@@ -625,7 +615,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
      MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i],
                                         &nRCGI.pLMN_Identity);
 
-     NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+     NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
 
      scell_failedtoSetupMod_item.sCell_ID = nRCGI;
 
-- 
GitLab