fix(phy simulators): fix cmdline configmodule for LTE_PHY ulsim and dlsim

This commit is contained in:
Romain Beurdouche
2024-05-15 14:05:54 +02:00
parent 08dbc5bf08
commit 8b889d908c
2 changed files with 22 additions and 6 deletions
+11 -3
View File
@@ -662,7 +662,15 @@ int main(int argc, char **argv) {
int option_index;
int res;
while ((res=getopt_long_only(argc, argv, "", long_options, &option_index)) == 0) {
/* disable error messages from getopt_long_only */
opterr = 0;
while ((res=getopt_long_only(argc, argv, "-", long_options, &option_index)) >= 0) {
/* ignore configmodule options and their arguments*/
/* with these opstring and long_options getopt returns 1 for non-option arguments and '?' for unrecognized long options, refer to 'man 3 getopt' */
if (res == 1 || res == '?')
continue;
if (options[option_index].voidptr != NULL ) {
if (long_options[option_index].has_arg==no_argument)
*(bool *)options[option_index].iptr=1;
@@ -877,8 +885,8 @@ int main(int argc, char **argv) {
if (transmission_mode>1) pa=dBm3;
printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa);
AssertFatal((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) != NULL,
"Cannot load configuration module, exiting\n");
uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
AssertFatal(uniqCfg != NULL, "Cannot load configuration module, exiting\n");
logInit();
set_glog_onlinelog(true);
// enable these lines if you need debug info
+11 -3
View File
@@ -395,8 +395,8 @@ int main(int argc, char **argv) {
cpuf = cpu_freq_GHz;
set_parallel_conf("PARALLEL_SINGLE_THREAD");
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
AssertFatal((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) != NULL,
"Cannot load configuration module, exiting\n");
uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
AssertFatal(uniqCfg != NULL, "Cannot load configuration module, exiting\n");
logInit();
set_glog(OAILOG_INFO);
// enable these lines if you need debug info
@@ -447,7 +447,15 @@ int main(int argc, char **argv) {
int option_index;
int res;
while ((res=getopt_long_only(argc, argv, "", long_options, &option_index)) == 0) {
/* disable error messages from getopt_long_only */
opterr = 0;
while ((res=getopt_long_only(argc, argv, "-", long_options, &option_index)) >= 0) {
/* ignore configmodule options and their arguments*/
/* with these opstring and long_options getopt returns 1 for non-option arguments and '?' for unrecognized long options, refer to 'man 3 getopt' */
if (res == 1 || res == '?')
continue;
if (options[option_index].voidptr != NULL ) {
if (long_options[option_index].has_arg==no_argument)
*(bool *)options[option_index].iptr=1;