@@ -489,29 +489,44 @@ static void configure_cli11_amplitude_control_args(CLI::App& app, amplitude_cont
489489 ->capture_default_str ();
490490}
491491
492- static void configure_cli11_tdd_ul_dl_args (CLI::App& app, tdd_ul_dl_appconfig& tdd_ul_dl_params )
492+ static void configure_cli11_tdd_ul_dl_pattern_args (CLI::App& app, tdd_ul_dl_pattern_appconfig& pattern_params )
493493{
494- app.add_option (" --dl_ul_tx_period" , tdd_ul_dl_params .dl_ul_tx_period , " TDD pattern periodicity in milliseconds" )
494+ app.add_option (" --dl_ul_tx_period" , pattern_params .dl_ul_tx_period , " TDD pattern periodicity in milliseconds" )
495495 ->capture_default_str ()
496496 ->check (CLI::Range (0.0 , 10.0 ));
497- app.add_option (" --nof_dl_slots" , tdd_ul_dl_params .nof_dl_slots , " TDD pattern nof. consecutive full DL slots" )
497+ app.add_option (" --nof_dl_slots" , pattern_params .nof_dl_slots , " TDD pattern nof. consecutive full DL slots" )
498498 ->capture_default_str ()
499499 ->check (CLI::Range (0 , 80 ));
500500 app.add_option (" --nof_dl_symbols" ,
501- tdd_ul_dl_params .nof_dl_symbols ,
501+ pattern_params .nof_dl_symbols ,
502502 " TDD pattern nof. DL symbols at the beginning of the slot following full DL slots" )
503503 ->capture_default_str ()
504504 ->check (CLI::Range (0 , 13 ));
505- app.add_option (" --nof_ul_slots" , tdd_ul_dl_params .nof_ul_slots , " TDD pattern nof. consecutive full UL slots" )
505+ app.add_option (" --nof_ul_slots" , pattern_params .nof_ul_slots , " TDD pattern nof. consecutive full UL slots" )
506506 ->capture_default_str ()
507507 ->check (CLI::Range (0 , 80 ));
508508 app.add_option (" --nof_ul_symbols" ,
509- tdd_ul_dl_params .nof_ul_symbols ,
509+ pattern_params .nof_ul_symbols ,
510510 " TDD pattern nof. UL symbols at the end of the slot preceding the first full UL slot" )
511511 ->capture_default_str ()
512512 ->check (CLI::Range (0 , 13 ));
513513}
514514
515+ static void configure_cli11_tdd_ul_dl_args (CLI::App& app, tdd_ul_dl_appconfig& tdd_ul_dl_params)
516+ {
517+ configure_cli11_tdd_ul_dl_pattern_args (app, tdd_ul_dl_params.pattern1 );
518+ CLI::App* pattern2_subcmd =
519+ app.add_subcommand (" pattern2" , " TDD UL DL pattern2 configuration parameters" )->configurable ();
520+ configure_cli11_tdd_ul_dl_pattern_args (*pattern2_subcmd, tdd_ul_dl_params.pattern2 .emplace ());
521+ auto tdd_ul_dl_verify_callback = [&]() {
522+ CLI::App* tdd_cfg = app.get_subcommand (" pattern2" );
523+ if (tdd_cfg->count_all () == 0 ) {
524+ tdd_ul_dl_params.pattern2 .reset ();
525+ }
526+ };
527+ app.callback (tdd_ul_dl_verify_callback);
528+ }
529+
515530static void configure_cli11_paging_args (CLI::App& app, paging_appconfig& pg_params)
516531{
517532 app.add_option (" --pg_search_space_id" , pg_params.paging_search_space_id , " SearchSpace to use for Paging" )
0 commit comments