fixed indent

master
Ismael Gomez 8 years ago
parent 8a5a2bbb4d
commit 79e9bccbd8

@ -49,284 +49,289 @@ namespace bpo = boost::program_options;
***********************************************************************/ ***********************************************************************/
string config_file; string config_file;
void parse_args(all_args_t *args, int argc, char* argv[]) { void parse_args(all_args_t *args, int argc, char *argv[]) {
// Command line only options // Command line only options
bpo::options_description general("General options"); bpo::options_description general("General options");
general.add_options()
("help,h", "Produce help message") general.add_options()
("version,v", "Print version information and exit") ("help,h", "Produce help message")
; ("version,v", "Print version information and exit");
// Command line or config file options // Command line or config file options
bpo::options_description common("Configuration options"); bpo::options_description common("Configuration options");
common.add_options() common.add_options()
("rf.dl_freq", bpo::value<float>(&args->rf.dl_freq)->default_value(2680000000), "Downlink centre frequency") ("rf.dl_freq", bpo::value<float>(&args->rf.dl_freq)->default_value(2680000000), "Downlink centre frequency")
("rf.ul_freq", bpo::value<float>(&args->rf.ul_freq)->default_value(2560000000), "Uplink centre frequency") ("rf.ul_freq", bpo::value<float>(&args->rf.ul_freq)->default_value(2560000000), "Uplink centre frequency")
("rf.rx_gain", bpo::value<float>(&args->rf.rx_gain)->default_value(-1), "Front-end receiver gain") ("rf.rx_gain", bpo::value<float>(&args->rf.rx_gain)->default_value(-1), "Front-end receiver gain")
("rf.tx_gain", bpo::value<float>(&args->rf.tx_gain)->default_value(-1), "Front-end transmitter gain") ("rf.tx_gain", bpo::value<float>(&args->rf.tx_gain)->default_value(-1), "Front-end transmitter gain")
("rf.nof_rx_ant", bpo::value<uint32_t>(&args->rf.nof_rx_ant)->default_value(1), "Number of RX antennas") ("rf.nof_rx_ant", bpo::value<uint32_t>(&args->rf.nof_rx_ant)->default_value(1), "Number of RX antennas")
("rf.device_name", bpo::value<string>(&args->rf.device_name)->default_value("auto"), "Front-end device name") ("rf.device_name", bpo::value<string>(&args->rf.device_name)->default_value("auto"), "Front-end device name")
("rf.device_args", bpo::value<string>(&args->rf.device_args)->default_value("auto"), "Front-end device arguments") ("rf.device_args", bpo::value<string>(&args->rf.device_args)->default_value("auto"), "Front-end device arguments")
("rf.time_adv_nsamples", bpo::value<string>(&args->rf.time_adv_nsamples)->default_value("auto"), "Transmission time advance") ("rf.time_adv_nsamples", bpo::value<string>(&args->rf.time_adv_nsamples)->default_value("auto"),
("rf.burst_preamble_us", bpo::value<string>(&args->rf.burst_preamble)->default_value("auto"), "Transmission time advance") "Transmission time advance")
("rf.burst_preamble_us", bpo::value<string>(&args->rf.burst_preamble)->default_value("auto"),
("pcap.enable", bpo::value<bool>(&args->pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark") "Transmission time advance")
("pcap.filename", bpo::value<string>(&args->pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename")
("pcap.enable", bpo::value<bool>(&args->pcap.enable)->default_value(false),
("trace.enable", bpo::value<bool>(&args->trace.enable)->default_value(false), "Enable PHY and radio timing traces") "Enable MAC packet captures for wireshark")
("trace.phy_filename",bpo::value<string>(&args->trace.phy_filename)->default_value("ue.phy_trace"), "PHY timing traces filename") ("pcap.filename", bpo::value<string>(&args->pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename")
("trace.radio_filename",bpo::value<string>(&args->trace.radio_filename)->default_value("ue.radio_trace"), "Radio timing traces filename")
("trace.enable", bpo::value<bool>(&args->trace.enable)->default_value(false), "Enable PHY and radio timing traces")
("gui.enable", bpo::value<bool>(&args->gui.enable)->default_value(false), "Enable GUI plots") ("trace.phy_filename", bpo::value<string>(&args->trace.phy_filename)->default_value("ue.phy_trace"),
"PHY timing traces filename")
("log.phy_level", bpo::value<string>(&args->log.phy_level), "PHY log level") ("trace.radio_filename", bpo::value<string>(&args->trace.radio_filename)->default_value("ue.radio_trace"),
("log.phy_hex_limit", bpo::value<int>(&args->log.phy_hex_limit), "PHY log hex dump limit") "Radio timing traces filename")
("log.mac_level", bpo::value<string>(&args->log.mac_level), "MAC log level")
("log.mac_hex_limit", bpo::value<int>(&args->log.mac_hex_limit), "MAC log hex dump limit") ("gui.enable", bpo::value<bool>(&args->gui.enable)->default_value(false), "Enable GUI plots")
("log.rlc_level", bpo::value<string>(&args->log.rlc_level), "RLC log level")
("log.rlc_hex_limit", bpo::value<int>(&args->log.rlc_hex_limit), "RLC log hex dump limit") ("log.phy_level", bpo::value<string>(&args->log.phy_level), "PHY log level")
("log.pdcp_level", bpo::value<string>(&args->log.pdcp_level), "PDCP log level") ("log.phy_hex_limit", bpo::value<int>(&args->log.phy_hex_limit), "PHY log hex dump limit")
("log.pdcp_hex_limit",bpo::value<int>(&args->log.pdcp_hex_limit), "PDCP log hex dump limit") ("log.mac_level", bpo::value<string>(&args->log.mac_level), "MAC log level")
("log.rrc_level", bpo::value<string>(&args->log.rrc_level), "RRC log level") ("log.mac_hex_limit", bpo::value<int>(&args->log.mac_hex_limit), "MAC log hex dump limit")
("log.rrc_hex_limit", bpo::value<int>(&args->log.rrc_hex_limit), "RRC log hex dump limit") ("log.rlc_level", bpo::value<string>(&args->log.rlc_level), "RLC log level")
("log.gw_level", bpo::value<string>(&args->log.gw_level), "GW log level") ("log.rlc_hex_limit", bpo::value<int>(&args->log.rlc_hex_limit), "RLC log hex dump limit")
("log.gw_hex_limit", bpo::value<int>(&args->log.gw_hex_limit), "GW log hex dump limit") ("log.pdcp_level", bpo::value<string>(&args->log.pdcp_level), "PDCP log level")
("log.nas_level", bpo::value<string>(&args->log.nas_level), "NAS log level") ("log.pdcp_hex_limit", bpo::value<int>(&args->log.pdcp_hex_limit), "PDCP log hex dump limit")
("log.nas_hex_limit", bpo::value<int>(&args->log.nas_hex_limit), "NAS log hex dump limit") ("log.rrc_level", bpo::value<string>(&args->log.rrc_level), "RRC log level")
("log.usim_level", bpo::value<string>(&args->log.usim_level), "USIM log level") ("log.rrc_hex_limit", bpo::value<int>(&args->log.rrc_hex_limit), "RRC log hex dump limit")
("log.usim_hex_limit",bpo::value<int>(&args->log.usim_hex_limit), "USIM log hex dump limit") ("log.gw_level", bpo::value<string>(&args->log.gw_level), "GW log level")
("log.gw_hex_limit", bpo::value<int>(&args->log.gw_hex_limit), "GW log hex dump limit")
("log.all_level", bpo::value<string>(&args->log.all_level)->default_value("info"), "ALL log level") ("log.nas_level", bpo::value<string>(&args->log.nas_level), "NAS log level")
("log.all_hex_limit", bpo::value<int>(&args->log.all_hex_limit)->default_value(32), "ALL log hex dump limit") ("log.nas_hex_limit", bpo::value<int>(&args->log.nas_hex_limit), "NAS log hex dump limit")
("log.usim_level", bpo::value<string>(&args->log.usim_level), "USIM log level")
("log.filename", bpo::value<string>(&args->log.filename)->default_value("/tmp/ue.log"),"Log filename") ("log.usim_hex_limit", bpo::value<int>(&args->log.usim_hex_limit), "USIM log hex dump limit")
("usim.algo", bpo::value<string>(&args->usim.algo), "USIM authentication algorithm") ("log.all_level", bpo::value<string>(&args->log.all_level)->default_value("info"), "ALL log level")
("usim.op", bpo::value<string>(&args->usim.op), "USIM operator variant") ("log.all_hex_limit", bpo::value<int>(&args->log.all_hex_limit)->default_value(32), "ALL log hex dump limit")
("usim.amf", bpo::value<string>(&args->usim.amf), "USIM authentication management field")
("usim.imsi", bpo::value<string>(&args->usim.imsi), "USIM IMSI") ("log.filename", bpo::value<string>(&args->log.filename)->default_value("/tmp/ue.log"), "Log filename")
("usim.imei", bpo::value<string>(&args->usim.imei), "USIM IMEI")
("usim.k", bpo::value<string>(&args->usim.k), "USIM K") ("usim.algo", bpo::value<string>(&args->usim.algo), "USIM authentication algorithm")
("usim.op", bpo::value<string>(&args->usim.op), "USIM operator variant")
("usim.amf", bpo::value<string>(&args->usim.amf), "USIM authentication management field")
/* Expert section */ ("usim.imsi", bpo::value<string>(&args->usim.imsi), "USIM IMSI")
("expert.phy.worker_cpu_mask", ("usim.imei", bpo::value<string>(&args->usim.imei), "USIM IMEI")
bpo::value<int>(&args->expert.phy.worker_cpu_mask)->default_value(-1), ("usim.k", bpo::value<string>(&args->usim.k), "USIM K")
"cpu bit mask (eg 255 = 1111 1111)")
("expert.phy.sync_cpu_affinity", /* Expert section */
bpo::value<int>(&args->expert.phy.sync_cpu_affinity)->default_value(-1), ("expert.phy.worker_cpu_mask",
"index of the core used by the sync thread") bpo::value<int>(&args->expert.phy.worker_cpu_mask)->default_value(-1),
"cpu bit mask (eg 255 = 1111 1111)")
("expert.ue_category",
bpo::value<int>(&args->expert.ue_cateogry)->default_value(4), ("expert.phy.sync_cpu_affinity",
"UE Category (1 to 5)") bpo::value<int>(&args->expert.phy.sync_cpu_affinity)->default_value(-1),
"index of the core used by the sync thread")
("expert.metrics_period_secs",
bpo::value<float>(&args->expert.metrics_period_secs)->default_value(1.0), ("expert.ue_category",
"Periodicity for metrics in seconds") bpo::value<int>(&args->expert.ue_cateogry)->default_value(4),
"UE Category (1 to 5)")
("expert.pregenerate_signals",
bpo::value<bool>(&args->expert.pregenerate_signals)->default_value(false), ("expert.metrics_period_secs",
"Pregenerate uplink signals after attach. Improves CPU performance.") bpo::value<float>(&args->expert.metrics_period_secs)->default_value(1.0),
"Periodicity for metrics in seconds")
("expert.rssi_sensor_enabled",
bpo::value<bool>(&args->expert.phy.rssi_sensor_enabled)->default_value(true), ("expert.pregenerate_signals",
"Enable or disable RF frontend RSSI sensor. In some USRP devices can cause segmentation fault") bpo::value<bool>(&args->expert.pregenerate_signals)->default_value(false),
"Pregenerate uplink signals after attach. Improves CPU performance.")
("expert.prach_gain",
bpo::value<float>(&args->expert.phy.prach_gain)->default_value(-1.0), ("expert.rssi_sensor_enabled",
"Disable PRACH power control") bpo::value<bool>(&args->expert.phy.rssi_sensor_enabled)->default_value(true),
"Enable or disable RF frontend RSSI sensor. In some USRP devices can cause segmentation fault")
("expert.cqi_max",
bpo::value<int>(&args->expert.phy.cqi_max)->default_value(15), ("expert.prach_gain",
"Upper bound on the maximum CQI to be reported. Default 15.") bpo::value<float>(&args->expert.phy.prach_gain)->default_value(-1.0),
"Disable PRACH power control")
("expert.cqi_fixed",
bpo::value<int>(&args->expert.phy.cqi_fixed)->default_value(-1), ("expert.cqi_max",
"Fixes the reported CQI to a constant value. Default disabled.") bpo::value<int>(&args->expert.phy.cqi_max)->default_value(15),
"Upper bound on the maximum CQI to be reported. Default 15.")
("expert.snr_ema_coeff",
bpo::value<float>(&args->expert.phy.snr_ema_coeff)->default_value(0.1), ("expert.cqi_fixed",
"Sets the SNR exponential moving average coefficient (Default 0.1)") bpo::value<int>(&args->expert.phy.cqi_fixed)->default_value(-1),
"Fixes the reported CQI to a constant value. Default disabled.")
("expert.snr_estim_alg",
bpo::value<string>(&args->expert.phy.snr_estim_alg)->default_value("refs"), ("expert.snr_ema_coeff",
"Sets the noise estimation algorithm. (Default refs)") bpo::value<float>(&args->expert.phy.snr_ema_coeff)->default_value(0.1),
"Sets the SNR exponential moving average coefficient (Default 0.1)")
("expert.pdsch_max_its",
bpo::value<int>(&args->expert.phy.pdsch_max_its)->default_value(4), ("expert.snr_estim_alg",
"Maximum number of turbo decoder iterations") bpo::value<string>(&args->expert.phy.snr_estim_alg)->default_value("refs"),
"Sets the noise estimation algorithm. (Default refs)")
("expert.attach_enable_64qam",
bpo::value<bool>(&args->expert.phy.attach_enable_64qam)->default_value(false), ("expert.pdsch_max_its",
"PUSCH 64QAM modulation before attachment") bpo::value<int>(&args->expert.phy.pdsch_max_its)->default_value(4),
"Maximum number of turbo decoder iterations")
("expert.nof_phy_threads",
bpo::value<int>(&args->expert.phy.nof_phy_threads)->default_value(2), ("expert.attach_enable_64qam",
"Number of PHY threads") bpo::value<bool>(&args->expert.phy.attach_enable_64qam)->default_value(false),
"PUSCH 64QAM modulation before attachment")
("expert.equalizer_mode",
bpo::value<string>(&args->expert.phy.equalizer_mode)->default_value("mmse"), ("expert.nof_phy_threads",
"Equalizer mode") bpo::value<int>(&args->expert.phy.nof_phy_threads)->default_value(2),
"Number of PHY threads")
("expert.cfo_integer_enabled",
bpo::value<bool>(&args->expert.phy.cfo_integer_enabled)->default_value(false), ("expert.equalizer_mode",
"Enables integer CFO estimation and correction.") bpo::value<string>(&args->expert.phy.equalizer_mode)->default_value("mmse"),
"Equalizer mode")
("expert.cfo_correct_tol_hz",
bpo::value<float>(&args->expert.phy.cfo_correct_tol_hz)->default_value(50.0), ("expert.cfo_integer_enabled",
"Tolerance (in Hz) for digial CFO compensation.") bpo::value<bool>(&args->expert.phy.cfo_integer_enabled)->default_value(false),
"Enables integer CFO estimation and correction.")
("expert.time_correct_period",
bpo::value<int>(&args->expert.phy.time_correct_period)->default_value(5), ("expert.cfo_correct_tol_hz",
"Period for sampling time offset correction.") bpo::value<float>(&args->expert.phy.cfo_correct_tol_hz)->default_value(50.0),
"Tolerance (in Hz) for digial CFO compensation.")
("expert.sfo_correct_disable",
bpo::value<bool>(&args->expert.phy.sfo_correct_disable)->default_value(false), ("expert.time_correct_period",
"Disables phase correction before channel estimation.") bpo::value<int>(&args->expert.phy.time_correct_period)->default_value(5),
"Period for sampling time offset correction.")
("expert.sss_algorithm",
bpo::value<string>(&args->expert.phy.sss_algorithm)->default_value("full"), ("expert.sfo_correct_disable",
"Selects the SSS estimation algorithm.") bpo::value<bool>(&args->expert.phy.sfo_correct_disable)->default_value(false),
"Disables phase correction before channel estimation.")
("expert.estimator_fil_w",
bpo::value<float>(&args->expert.phy.estimator_fil_w)->default_value(0.1), ("expert.sss_algorithm",
"Chooses the coefficients for the 3-tap channel estimator centered filter.") bpo::value<string>(&args->expert.phy.sss_algorithm)->default_value("full"),
"Selects the SSS estimation algorithm.")
("rf_calibration.tx_corr_dc_gain", bpo::value<float>(&args->rf_cal.tx_corr_dc_gain)->default_value(0.0), "TX DC offset gain correction") ("expert.estimator_fil_w",
("rf_calibration.tx_corr_dc_phase", bpo::value<float>(&args->rf_cal.tx_corr_dc_phase)->default_value(0.0), "TX DC offset phase correction") bpo::value<float>(&args->expert.phy.estimator_fil_w)->default_value(0.1),
("rf_calibration.tx_corr_iq_i", bpo::value<float>(&args->rf_cal.tx_corr_iq_i)->default_value(0.0), "TX IQ imbalance inphase correction") "Chooses the coefficients for the 3-tap channel estimator centered filter.")
("rf_calibration.tx_corr_iq_q", bpo::value<float>(&args->rf_cal.tx_corr_iq_q)->default_value(0.0), "TX IQ imbalance quadrature correction")
("rf_calibration.tx_corr_dc_gain", bpo::value<float>(&args->rf_cal.tx_corr_dc_gain)->default_value(0.0),
"TX DC offset gain correction")
("rf_calibration.tx_corr_dc_phase", bpo::value<float>(&args->rf_cal.tx_corr_dc_phase)->default_value(0.0),
"TX DC offset phase correction")
("rf_calibration.tx_corr_iq_i", bpo::value<float>(&args->rf_cal.tx_corr_iq_i)->default_value(0.0),
"TX IQ imbalance inphase correction")
("rf_calibration.tx_corr_iq_q", bpo::value<float>(&args->rf_cal.tx_corr_iq_q)->default_value(0.0),
"TX IQ imbalance quadrature correction");
// Positional options - config file location
bpo::options_description position("Positional options");
position.add_options()
("config_file", bpo::value<string>(&config_file), "UE configuration file");
bpo::positional_options_description p;
p.add("config_file", -1);
// these options are allowed on the command line
bpo::options_description cmdline_options;
cmdline_options.add(common).add(position).add(general);
// parse the command line and store result in vm
bpo::variables_map vm;
bpo::store(bpo::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm);
bpo::notify(vm);
// help option was given - print usage and exit
if (vm.count("help")) {
cout << "Usage: " << argv[0] << " [OPTIONS] config_file" << endl << endl;
cout << common << endl << general << endl;
exit(0);
}
; // print version number and exit
if (vm.count("version")) {
// Positional options - config file location cout << "Version " <<
bpo::options_description position("Positional options"); srslte_get_version_major() << "." <<
position.add_options() srslte_get_version_minor() << "." <<
("config_file", bpo::value< string >(&config_file), "UE configuration file") srslte_get_version_patch() << endl;
; exit(0);
bpo::positional_options_description p; }
p.add("config_file", -1);
// these options are allowed on the command line
bpo::options_description cmdline_options;
cmdline_options.add(common).add(position).add(general);
// parse the command line and store result in vm // no config file given - print usage and exit
bpo::variables_map vm; if (!vm.count("config_file")) {
bpo::store(bpo::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm); cout << "Error: Configuration file not provided" << endl;
cout << "Usage: " << argv[0] << " [OPTIONS] config_file" << endl << endl;
exit(0);
} else {
cout << "Reading configuration file " << config_file << "..." << endl;
ifstream conf(config_file.c_str(), ios::in);
if (conf.fail()) {
cout << "Failed to read configuration file " << config_file << " - exiting" << endl;
exit(1);
}
bpo::store(bpo::parse_config_file(conf, common), vm);
bpo::notify(vm); bpo::notify(vm);
}
// help option was given - print usage and exit // Apply all_level to any unset layers
if (vm.count("help")) { if (vm.count("log.all_level")) {
cout << "Usage: " << argv[0] << " [OPTIONS] config_file" << endl << endl; if (!vm.count("log.phy_level")) {
cout << common << endl << general << endl; args->log.phy_level = args->log.all_level;
exit(0);
} }
if (!vm.count("log.mac_level")) {
// print version number and exit args->log.mac_level = args->log.all_level;
if (vm.count("version")) {
cout << "Version " <<
srslte_get_version_major() << "." <<
srslte_get_version_minor() << "." <<
srslte_get_version_patch() << endl;
exit(0);
} }
if (!vm.count("log.rlc_level")) {
// no config file given - print usage and exit args->log.rlc_level = args->log.all_level;
if (!vm.count("config_file")) {
cout << "Error: Configuration file not provided" << endl;
cout << "Usage: " << argv[0] << " [OPTIONS] config_file" << endl << endl;
exit(0);
} else {
cout << "Reading configuration file " << config_file << "..." << endl;
ifstream conf(config_file.c_str(), ios::in);
if(conf.fail()) {
cout << "Failed to read configuration file " << config_file << " - exiting" << endl;
exit(1);
}
bpo::store(bpo::parse_config_file(conf, common), vm);
bpo::notify(vm);
} }
if (!vm.count("log.pdcp_level")) {
// Apply all_level to any unset layers args->log.pdcp_level = args->log.all_level;
if (vm.count("log.all_level")) { }
if(!vm.count("log.phy_level")) { if (!vm.count("log.rrc_level")) {
args->log.phy_level = args->log.all_level; args->log.rrc_level = args->log.all_level;
} }
if(!vm.count("log.mac_level")) { if (!vm.count("log.nas_level")) {
args->log.mac_level = args->log.all_level; args->log.nas_level = args->log.all_level;
} }
if(!vm.count("log.rlc_level")) { if (!vm.count("log.gw_level")) {
args->log.rlc_level = args->log.all_level; args->log.gw_level = args->log.all_level;
}
if(!vm.count("log.pdcp_level")) {
args->log.pdcp_level = args->log.all_level;
}
if(!vm.count("log.rrc_level")) {
args->log.rrc_level = args->log.all_level;
}
if(!vm.count("log.nas_level")) {
args->log.nas_level = args->log.all_level;
}
if(!vm.count("log.gw_level")) {
args->log.gw_level = args->log.all_level;
}
if(!vm.count("log.usim_level")) {
args->log.usim_level = args->log.all_level;
}
} }
if (!vm.count("log.usim_level")) {
args->log.usim_level = args->log.all_level;
}
}
// Apply all_hex_limit to any unset layers
if (vm.count("log.all_hex_limit")) { // Apply all_hex_limit to any unset layers
if(!vm.count("log.phy_hex_limit")) { if (vm.count("log.all_hex_limit")) {
args->log.phy_hex_limit = args->log.all_hex_limit; if (!vm.count("log.phy_hex_limit")) {
} args->log.phy_hex_limit = args->log.all_hex_limit;
if(!vm.count("log.mac_hex_limit")) { }
args->log.mac_hex_limit = args->log.all_hex_limit; if (!vm.count("log.mac_hex_limit")) {
} args->log.mac_hex_limit = args->log.all_hex_limit;
if(!vm.count("log.rlc_hex_limit")) { }
args->log.rlc_hex_limit = args->log.all_hex_limit; if (!vm.count("log.rlc_hex_limit")) {
} args->log.rlc_hex_limit = args->log.all_hex_limit;
if(!vm.count("log.pdcp_hex_limit")) { }
args->log.pdcp_hex_limit = args->log.all_hex_limit; if (!vm.count("log.pdcp_hex_limit")) {
} args->log.pdcp_hex_limit = args->log.all_hex_limit;
if(!vm.count("log.rrc_hex_limit")) { }
args->log.rrc_hex_limit = args->log.all_hex_limit; if (!vm.count("log.rrc_hex_limit")) {
} args->log.rrc_hex_limit = args->log.all_hex_limit;
if(!vm.count("log.nas_hex_limit")) {
args->log.nas_hex_limit = args->log.all_hex_limit;
}
if(!vm.count("log.gw_hex_limit")) {
args->log.gw_hex_limit = args->log.all_hex_limit;
}
if(!vm.count("log.usim_hex_limit")) {
args->log.usim_hex_limit = args->log.all_hex_limit;
}
} }
if (!vm.count("log.nas_hex_limit")) {
args->log.nas_hex_limit = args->log.all_hex_limit;
}
if (!vm.count("log.gw_hex_limit")) {
args->log.gw_hex_limit = args->log.all_hex_limit;
}
if (!vm.count("log.usim_hex_limit")) {
args->log.usim_hex_limit = args->log.all_hex_limit;
}
}
} }
static bool running = true; static bool running = true;
static bool do_metrics = false; static bool do_metrics = false;
void sig_int_handler(int signo) void sig_int_handler(int signo) {
{
running = false; running = false;
} }
void *input_loop(void *m) void *input_loop(void *m) {
{ metrics_stdout *metrics = (metrics_stdout *) m;
metrics_stdout *metrics = (metrics_stdout*)m;
char key; char key;
while(running) { while (running) {
cin >> key; cin >> key;
if('t' == key) { if ('t' == key) {
do_metrics = !do_metrics; do_metrics = !do_metrics;
if(do_metrics) { if (do_metrics) {
cout << "Enter t to stop trace." << endl; cout << "Enter t to stop trace." << endl;
} else { } else {
cout << "Enter t to restart trace." << endl; cout << "Enter t to restart trace." << endl;
@ -337,17 +342,16 @@ void *input_loop(void *m)
return NULL; return NULL;
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[]) {
{
signal(SIGINT, sig_int_handler); signal(SIGINT, sig_int_handler);
all_args_t args; all_args_t args;
metrics_stdout metrics; metrics_stdout metrics;
ue *ue = ue::get_instance(); ue *ue = ue::get_instance();
cout << "--- Software Radio Systems LTE UE ---" << endl << endl; cout << "--- Software Radio Systems LTE UE ---" << endl << endl;
parse_args(&args, argc, argv); parse_args(&args, argc, argv);
if(!ue->init(&args)) { if (!ue->init(&args)) {
exit(1); exit(1);
} }
metrics.init(ue, args.expert.metrics_period_secs); metrics.init(ue, args.expert.metrics_period_secs);
@ -355,9 +359,9 @@ int main(int argc, char *argv[])
pthread_t input; pthread_t input;
pthread_create(&input, NULL, &input_loop, &metrics); pthread_create(&input, NULL, &input_loop, &metrics);
bool plot_started = false; bool plot_started = false;
bool signals_pregenerated = false; bool signals_pregenerated = false;
while(running) { while (running) {
if (ue->is_attached()) { if (ue->is_attached()) {
if (!signals_pregenerated && args.expert.pregenerate_signals) { if (!signals_pregenerated && args.expert.pregenerate_signals) {
ue->pregenerate_signals(true); ue->pregenerate_signals(true);

Loading…
Cancel
Save