From 0cb8546a91a5fc9b200170ac257caab693dae38e Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Wed, 23 Jul 2014 14:55:59 +0000
Subject: [PATCH] add L after frequency value in enb config file

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5587 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair2/ENB_APP/enb_config.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index 2ac8dbf9876..3463afa7468 100755
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -37,6 +37,7 @@
 
 #include <string.h>
 #include <libconfig.h>
+#include <inttypes.h>
 
 #include "log.h"
 #include "assertions.h"
@@ -235,7 +236,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
   long int          tdd_config_s;
   const char*       prefix_type;
   long int          eutra_band;
-  long int          downlink_frequency;
+  long long int     downlink_frequency;
   long int          uplink_frequency_offset;
   char*             ipv4                          = NULL;
   char*             ipv6                          = NULL;
@@ -422,17 +423,22 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
 
                   if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_EUTRA_BAND, &eutra_band)) {
                       enb_properties.properties[enb_properties_index]->eutra_band = eutra_band;
+                      printf( "\teutra band:\t%d\n",enb_properties.properties[enb_properties_index]->eutra_band);
                   } else {
                       enb_properties.properties[enb_properties_index]->eutra_band = 7; // Default band
+                      printf( "\teutra band:\t%d (default)\n",enb_properties.properties[enb_properties_index]->eutra_band);
                   }
 
-                  if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) {
-                      enb_properties.properties[enb_properties_index]->downlink_frequency = (unsigned int) downlink_frequency;
+                  if(config_setting_lookup_int64(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) {
+                      enb_properties.properties[enb_properties_index]->downlink_frequency = (uint32_t) downlink_frequency;
+                      printf( "\tdownlink freq:\t%u\n",enb_properties.properties[enb_properties_index]->downlink_frequency);
                   } else {
                       enb_properties.properties[enb_properties_index]->downlink_frequency = 2680000000UL; // Default downlink frequency
+                      printf( "\tdownlink freq:\t%u (default)\n",enb_properties.properties[enb_properties_index]->downlink_frequency);
                   }
                   if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)) {
                       enb_properties.properties[enb_properties_index]->uplink_frequency_offset = (unsigned int) uplink_frequency_offset;
+                      printf( "\tuplink freq offset:\t%ld\n",enb_properties.properties[enb_properties_index]->uplink_frequency_offset);
                   } else {
                       // Default uplink frequency offset
                       if (enb_properties.properties[enb_properties_index]->frame_type == FDD) {
@@ -440,6 +446,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
                       } else {
                           enb_properties.properties[enb_properties_index]->uplink_frequency_offset = 0;
                       }
+                      printf( "\tuplink freq offset:\t%ld (default)\n",enb_properties.properties[enb_properties_index]->uplink_frequency_offset);
                   }
 
                   parse_errors += enb_check_band_frequencies(lib_config_file_name_pP,
-- 
GitLab