From 98c354fedd7afce97967e6c552ce630566ccbfec Mon Sep 17 00:00:00 2001 From: frtabu Date: Mon, 15 Mar 2021 23:26:09 +0100 Subject: [PATCH] Set path for libconfig include directive, so that all config files could be located in the same directory. minor fixes in softmodem-common --- .../enb.band7.tm1.50PRB.usrpb210.conf | 2 +- common/config/config_load_configmodule.h | 8 ++++-- common/config/libconfig/config_libconfig.c | 28 +++++++++++++++---- executables/softmodem-common.c | 9 +++--- executables/softmodem-common.h | 1 + 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 4d89ad96da..087ee37f01 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -260,7 +260,6 @@ NETWORK_CONTROLLER : FLEXRAN_CACHE = "/mnt/oai_agent_cache"; FLEXRAN_AWAIT_RECONF = "no"; }; - log_config : { global_log_level ="info"; @@ -279,3 +278,4 @@ NETWORK_CONTROLLER : rrc_log_verbosity ="medium"; }; +@include "channelmod_rfsimu.conf" diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h index 8baaa99bb8..0688f6531f 100644 --- a/common/config/config_load_configmodule.h +++ b/common/config/config_load_configmodule.h @@ -82,10 +82,12 @@ typedef struct configmodule_interface { #ifdef CONFIG_LOADCONFIG_MAIN configmodule_interface_t *cfgptr=NULL; -static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]> \n \ - debugflags can also be defined in the config_libconfig section of the config file\n \ +static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]><:incp[path]>\n \ + debugflags can also be defined in the config section of the config file\n \ debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \ - 4->print command line processing debug messages\n "; + 4->print command line processing debug messages\n \ + incp parameter can be used to define the include path used for config files (@include directive)\n \ + defaults is set to the path of the main config file.\n"; #define CONFIG_SECTIONNAME "config" #define CONFIGPARAM_DEBUGFLAGS_IDX 0 diff --git a/common/config/libconfig/config_libconfig.c b/common/config/libconfig/config_libconfig.c index eb08a70183..abd7b7b504 100644 --- a/common/config/libconfig/config_libconfig.c +++ b/common/config/libconfig/config_libconfig.c @@ -33,8 +33,9 @@ #include #include +#include + #include -#include #include "config_libconfig.h" #include "config_libconfig_private.h" @@ -347,17 +348,34 @@ int config_libconfig_init(char *cfgP[], int numP) { config_get_if()->numptrs=0; memset(config_get_if()->ptrs,0,sizeof(void *) * CONFIG_MAX_ALLOCATEDPTRS); memset(config_get_if()->ptrsAllocated, 0, sizeof(config_get_if()->ptrsAllocated)); - + /* search for include path parameter and set config file include path accordingly */ + for (int i=0; i