handle config parsing error gracefully and fix op/opc selection issue

master
Andre Puschmann 7 years ago
parent 8c92f3fddc
commit 3dc5a40caf

@ -363,8 +363,14 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
exit(1);
}
// parse config file and handle errors gracefully
try {
bpo::store(bpo::parse_config_file(conf, common), vm);
bpo::notify(vm);
} catch (const boost::program_options::error& e) {
cerr << e.what() << endl;
exit(1);
}
//Check conflicting OP/OPc options and which is being used
if (vm.count("usim.op") && !vm["usim.op"].defaulted() &&
@ -373,14 +379,8 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
cout << "Conflicting options OP and OPc. Please configure either one or the other." << endl;
exit(1);
}
else
{
if(vm["usim.op"].defaulted()){
args->usim.using_op = true;
}
else {
args->usim.using_op = false;
}
args->usim.using_op = vm.count("usim.op");
}
// Apply all_level to any unset layers

@ -53,8 +53,7 @@ int usim::init(usim_args_t *args, srslte::log *usim_log_)
usim_log->console("Invalid length for K: %zu should be %d\n", args->k.length(), 32);
}
if(args->using_op)
{
if(args->using_op) {
if(32 == args->op.length()) {
str_to_hex(args->op, op);
compute_opc(k,op,opc);

Loading…
Cancel
Save