if (const char *env_opmode = std::getenv("OPERATING_MODE")){
config_instance.operating_mode.assign(env_opmode);
- if ( config_instance.operating_mode != "REPORT" && config_instance.operating_mode != "CONTROL"){
- throw std::runtime_error("Invalid operating mode: " + config_instance.operating_mode + " Must be REPORT or CONTROL");
- }
mdclog_write(MDCLOG_INFO, "Operating mode set from environment variable to %s\n", config_instance.operating_mode.c_str());
}
mdclog_write(MDCLOG_INFO, "xAPP set to Test Mode state %d from Environment Variable", config_instance.test_mode);
}
+ if (const char *id = std::getenv("XAPP_ID")){
+ config_instance.xapp_id.assign(id);
+ mdclog_write(MDCLOG_INFO, "xAPP ID set to Test Mode state %d from Environment Variable", config_instance.xapp_id);
+ }
+
if (const char *log_env = std::getenv("LOG_LEVEL")){
if (!strcmp(log_env, "MDCLOG_INFO")){
config_instance.log_level = MDCLOG_INFO;
{"interval", required_argument, 0, 'i'},
{"gNodeB", required_argument, 0, 'g'},
{"opmode", required_argument, 0, 'c'},
- {"verbose", no_argument, &config_instance.log_level, MDCLOG_INFO},
+ {"xappid", required_argument, 0, 'x'},
+ {"verbose", no_argument, &config_instance.log_level, MDCLOG_DEBUG},
{"test", no_argument, &config_instance.test_mode, 1},
};
while(1) {
int option_index = 0;
- char c = getopt_long(argc, argv, "n:p:t:s:g:a:v:u:i:c:", long_options, &option_index);
+ char c = getopt_long(argc, argv, "n:p:t:s:g:a:v:u:i:c:x:", long_options, &option_index);
if(c == -1){
break;
mdclog_write(MDCLOG_INFO, "VES collector url set to %s from command line ", config_instance.ves_collector_url.c_str());
break;
+ case 'x':
+ config_instance.xapp_id.assign(optarg);
+ mdclog_write(MDCLOG_INFO, "XAPP ID set to %s from command line ", config_instance.xapp_id.c_str());
+ break;
+
case 'i':
config_instance.measurement_interval = atoi(optarg);
if (config_instance.measurement_interval < 1 || config_instance.measurement_interval > MAX_SLEEP){
std::cout <<"[--gNodeB[][-g] gNodeB" << std::endl;
std::cout <<"--interval[-i] measurement interval to send to ves collector (in seconds)" << std::endl;
std::cout <<"--test puts xapp in test mode where it sends subscription, waits for interval and then sends delete subscription " << std::endl;
- std::cout <<"--opmode [-c] type of operatoring mode : either REPORT or INSERT. In REPORT, does not send a control message back to gNodeB" << std::endl;
+ std::cout <<"--opmode [-c] type of operatoring mode : either REPORT or CONTROL. In REPORT, does not send a control message back to gNodeB" << std::endl;
std::cout << "--verbose " << std::endl;
}