Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhouShuya
OpenXG-RAN
Commits
bcb6f171
Commit
bcb6f171
authored
Nov 22, 2017
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch from francois UE config
parent
fc0a60e1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
22 deletions
+48
-22
common/config/config_cmdline.c
common/config/config_cmdline.c
+6
-3
common/config/config_userapi.c
common/config/config_userapi.c
+9
-1
common/config/config_userapi.h
common/config/config_userapi.h
+1
-0
common/config/libconfig/config_libconfig.c
common/config/libconfig/config_libconfig.c
+20
-9
openair2/UTIL/LOG/log.h
openair2/UTIL/LOG/log.h
+2
-2
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+10
-7
No files found.
common/config/config_cmdline.c
View file @
bcb6f171
...
...
@@ -52,9 +52,12 @@ char defbool[2]="1";
switch
(
cfgoptions
->
type
)
{
case
TYPE_STRING
:
config_check_valptr
(
cfgoptions
,
(
char
**
)(
cfgoptions
->
strptr
),
sizeof
(
char
*
));
config_check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
tmpval
+
1
));
sprintf
(
*
(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
if
(
cfgoptions
->
numelt
==
0
)
{
config_check_valptr
(
cfgoptions
,
cfgoptions
->
strptr
,
strlen
(
tmpval
)
+
1
);
sprintf
(
*
(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
}
else
{
sprintf
(
(
char
*
)(
cfgoptions
->
strptr
),
"%s"
,
tmpval
);
}
printf_cmdl
(
"[CONFIG] %s set to %s from command line
\n
"
,
cfgoptions
->
optname
,
tmpval
);
optisset
=
1
;
break
;
...
...
common/config/config_userapi.c
View file @
bcb6f171
...
...
@@ -50,7 +50,11 @@ configmodule_interface_t *config_get_if(void)
char
*
config_check_valptr
(
paramdef_t
*
cfgoptions
,
char
**
ptr
,
int
length
)
{
printf_ptrs
(
"-- %s 0x%08lx %i
\n
"
,
cfgoptions
->
optname
,(
uintptr_t
)(
*
ptr
),
length
);
printf_ptrs
(
"[CONFIG] %s ptr: 0x%08lx requested size: %i
\n
"
,
cfgoptions
->
optname
,(
uintptr_t
)(
ptr
),
length
);
if
(
cfgoptions
->
numelt
>
0
)
{
/* already allocated */
return
*
ptr
;
}
if
(
*
ptr
==
NULL
)
{
*
ptr
=
malloc
(
length
);
if
(
*
ptr
!=
NULL
)
{
...
...
@@ -147,3 +151,7 @@ int config_isparamset(paramdef_t *params,int paramidx)
return
0
;
}
}
int
config_getparamval_fromparamdefidx
(
paramdef_t
*
cfgoptions
,
int
paramidx
)
{
}
common/config/config_userapi.h
View file @
bcb6f171
...
...
@@ -51,6 +51,7 @@ extern int config_get(paramdef_t *params,int numparams, char *prefix);
extern
int
config_isparamset
(
paramdef_t
*
params
,
int
paramidx
);
extern
void
config_assign_int
(
paramdef_t
*
cfgoptions
,
char
*
fullname
,
int
val
);
extern
int
config_process_cmdline
(
paramdef_t
*
cfgoptions
,
int
numoptions
,
char
*
prefix
);
extern
int
config_getparamval_fromparamdefidx
(
paramdef_t
*
cfgoptions
,
int
paramidx
);
#define config_getlist config_get_if()->getlist
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
...
...
common/config/libconfig/config_libconfig.c
View file @
bcb6f171
...
...
@@ -104,17 +104,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
cfgpath
,
str
,
cfgoptions
[
i
].
numelt
);
str
[
strlen
(
str
)
-
1
]
=
0
;
}
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
str
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
)
);
if
(
cfgoptions
[
i
].
numelt
==
0
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
str
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
)
);
}
else
{
sprintf
(
(
char
*
)(
cfgoptions
[
i
].
strptr
)
,
"%s"
,
str
);
printf_params
(
"[LIBCONFIG] %s: %s
\n
"
,
cfgpath
,(
char
*
)
cfgoptions
[
i
].
strptr
);
}
}
else
{
if
(
cfgoptions
[
i
].
defstrval
!=
NULL
)
{
defval
=
1
;
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
cfgoptions
[
i
].
defstrval
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
),
"%s"
,
cfgoptions
[
i
].
defstrval
);
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
));
if
(
cfgoptions
[
i
].
numelt
==
0
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),
(
char
**
)(
&
(
cfgoptions
[
i
].
strptr
)),
sizeof
(
char
*
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),
cfgoptions
[
i
].
strptr
,
strlen
(
cfgoptions
[
i
].
defstrval
)
+
1
);
sprintf
(
*
(
cfgoptions
[
i
].
strptr
),
"%s"
,
cfgoptions
[
i
].
defstrval
);
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
*
(
cfgoptions
[
i
].
strptr
));
}
else
{
sprintf
((
char
*
)(
cfgoptions
[
i
].
strptr
),
"%s"
,
cfgoptions
[
i
].
defstrval
);
printf_params
(
"[LIBCONFIG] %s set to default value %s
\n
"
,
cfgpath
,
(
char
*
)
cfgoptions
[
i
].
strptr
);
}
}
else
{
notfound
=
1
;
}
...
...
@@ -183,7 +194,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
read_intarray
(
&
cfgoptions
[
i
],
setting
,
cfgpath
);
}
else
{
if
(
cfgoptions
[
i
].
defintarrayval
!=
NULL
)
{
config_check_valptr
(
&
(
cfgoptions
[
i
]),(
char
**
)
&
(
cfgoptions
[
i
].
iptr
),
sizeof
(
int32_t
));
config_check_valptr
(
&
(
cfgoptions
[
i
]),(
char
**
)
&
(
cfgoptions
[
i
].
iptr
),
sizeof
(
int32_t
*
));
cfgoptions
[
i
].
iptr
=
cfgoptions
[
i
].
defintarrayval
;
defval
=
1
;
for
(
int
j
=
0
;
j
<
cfgoptions
[
i
].
numelt
;
j
++
)
{
...
...
openair2/UTIL/LOG/log.h
View file @
bcb6f171
...
...
@@ -314,8 +314,8 @@ void *log_thread_function(void * list);
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOG_GLOBALPARAMS_DESC { \
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING,
sizeof(gloglevel)
}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING,
sizeof(glogverbo)
}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING,
0
}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING,
0
}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0, }, \
{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0, }, \
}
...
...
targets/RT/USER/lte-softmodem.c
View file @
bcb6f171
...
...
@@ -227,6 +227,9 @@ threads_t threads= {-1,-1,-1,-1,-1,-1,-1};
*/
uint8_t
abstraction_flag
=
0
;
/* forward declarations */
void
set_default_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
]);
/*---------------------BMC: timespec helpers -----------------------------*/
struct
timespec
min_diff_time
=
{
.
tv_sec
=
0
,
.
tv_nsec
=
0
};
...
...
@@ -609,9 +612,9 @@ static void get_options(void) {
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBUERX_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_calib_ue
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBUERXMED_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_calib_ue_med
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBUERXBYP_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
rx_calib_ue_byp
;
if
(
*
(
cmdline_uemodeparams
[
CMDLINE_DEBUGUEPRACH_IDX
].
uptr
)
>
0
)
mode
=
debug_prach
;
if
(
*
(
cmdline_uemodeparams
[
CMDLINE_NOL2CONNECT_IDX
].
uptr
)
>
0
)
mode
=
no_L2_connect
;
if
(
*
(
cmdline_uemodeparams
[
CMDLINE_CALIBPRACHTX_IDX
].
uptr
)
>
0
)
mode
=
calib_prach_tx
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_DEBUGUEPRACH_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
debug_prach
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_NOL2CONNECT_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
no_L2_connect
;
if
(
(
cmdline_uemodeparams
[
CMDLINE_CALIBPRACHTX_IDX
].
paramflags
&
PARAMFLAG_PARAMSET
)
!=
0
)
mode
=
calib_prach_tx
;
if
(
dumpframe
>
0
)
mode
=
rx_dump_frame
;
if
(
downlink_frequency
[
0
][
0
]
>
0
)
{
...
...
@@ -628,7 +631,7 @@ static void get_options(void) {
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
frame_parms
[
CC_id
]
->
frame_type
=
TDD
;
}
set_default_frame_parms
(
frame_parms
);
if
(
frame_parms
[
0
]
->
N_RB_DL
!=
0
)
{
if
(
frame_parms
[
0
]
->
N_RB_DL
<
6
)
{
frame_parms
[
0
]
->
N_RB_DL
=
6
;
...
...
@@ -691,7 +694,7 @@ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
#endif
void
set_default_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
]);
void
set_default_frame_parms
(
LTE_DL_FRAME_PARMS
*
frame_parms
[
MAX_NUM_CCs
])
{
int
CC_id
;
...
...
@@ -905,14 +908,14 @@ int main( int argc, char **argv )
// set default parameters
if
(
UE_flag
==
1
)
set_default_frame_parms
(
frame_parms
);
//
if (UE_flag == 1) set_default_frame_parms(frame_parms);
logInit
();
printf
(
"Reading in command-line options
\n
"
);
get_options
();
if
(
CONFIG_ISFLAGSET
(
CONFIG_ABORT
))
{
if
(
CONFIG_ISFLAGSET
(
CONFIG_ABORT
)
&&
UE_flag
==
0
)
{
fprintf
(
stderr
,
"Getting configuration failed
\n
"
);
exit
(
-
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment