Commit 8b889d90 authored by Romain Beurdouche's avatar Romain Beurdouche

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

parent 08dbc5bf
...@@ -662,7 +662,15 @@ int main(int argc, char **argv) { ...@@ -662,7 +662,15 @@ int main(int argc, char **argv) {
int option_index; int option_index;
int res; 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 (options[option_index].voidptr != NULL ) {
if (long_options[option_index].has_arg==no_argument) if (long_options[option_index].has_arg==no_argument)
*(bool *)options[option_index].iptr=1; *(bool *)options[option_index].iptr=1;
...@@ -877,8 +885,8 @@ int main(int argc, char **argv) { ...@@ -877,8 +885,8 @@ int main(int argc, char **argv) {
if (transmission_mode>1) pa=dBm3; if (transmission_mode>1) pa=dBm3;
printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa); printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa);
AssertFatal((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) != NULL, uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
"Cannot load configuration module, exiting\n"); AssertFatal(uniqCfg != NULL, "Cannot load configuration module, exiting\n");
logInit(); logInit();
set_glog_onlinelog(true); set_glog_onlinelog(true);
// enable these lines if you need debug info // enable these lines if you need debug info
......
...@@ -395,8 +395,8 @@ int main(int argc, char **argv) { ...@@ -395,8 +395,8 @@ int main(int argc, char **argv) {
cpuf = cpu_freq_GHz; cpuf = cpu_freq_GHz;
set_parallel_conf("PARALLEL_SINGLE_THREAD"); set_parallel_conf("PARALLEL_SINGLE_THREAD");
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz); printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
AssertFatal((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) != NULL, uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
"Cannot load configuration module, exiting\n"); AssertFatal(uniqCfg != NULL, "Cannot load configuration module, exiting\n");
logInit(); logInit();
set_glog(OAILOG_INFO); set_glog(OAILOG_INFO);
// enable these lines if you need debug info // enable these lines if you need debug info
...@@ -447,7 +447,15 @@ int main(int argc, char **argv) { ...@@ -447,7 +447,15 @@ int main(int argc, char **argv) {
int option_index; int option_index;
int res; 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 (options[option_index].voidptr != NULL ) {
if (long_options[option_index].has_arg==no_argument) if (long_options[option_index].has_arg==no_argument)
*(bool *)options[option_index].iptr=1; *(bool *)options[option_index].iptr=1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment