diff --git a/cmake_targets/tools/epc.local.enb.conf.in b/cmake_targets/tools/epc.local.enb.conf.in index 3ea1bab2bb9a3906e950ae0875955b4c5e93847b..8ae32903afc24fd333fb6b7ffd2659870213fde8 100755 --- a/cmake_targets/tools/epc.local.enb.conf.in +++ b/cmake_targets/tools/epc.local.enb.conf.in @@ -62,7 +62,7 @@ MME : # max values = 999.999:65535 # maximum of 32 values, comma separated TAI_LIST = ( - {MCC="208" ; MNC="10"; TAC = "1"; } # YOUR PLMN CONFIG HERE + {MCC="208" ; MNC="95"; TAC = "1"; } # YOUR PLMN CONFIG HERE ); }; diff --git a/cmake_targets/tools/run_epc b/cmake_targets/tools/run_epc index 0fa77c28be2b5c9e24e831b03874d62331832b77..da8652883330694b4fc3345776c27f0a1f57a565 100755 --- a/cmake_targets/tools/run_epc +++ b/cmake_targets/tools/run_epc @@ -39,6 +39,8 @@ ################################ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) source $THIS_SCRIPT_PATH/build_helper +global -i g_run_msc_gen=0 +global g_msc_dir="/tmp" set_openair_env @@ -62,17 +64,39 @@ function help() echo_error " 2 -> ASN1 XER printf on and ASN1 debug on" } +function do_msc_gen() +{ + cd $g_msc_dir + last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` + $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py + sync + last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` + + if [ x"$last_created_file" != x"$last_created_file2" ]; then + if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then + command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png + fi + fi +} + +function control_c() +# run if user hits control-c +{ + echo_warning "\nExiting by ctrl+c\n" + if [ $g_run_msc_gen -eq 1 ]; then + do_msc_gen + fi + exit $? +} function main() { local -i run_gdb=0 - local -i run_mscgen=0 local exe_arguments=" " local -i epc_local=0 local -r epc_default_config_file="$OPENAIR_TARGETS/bin/epc.conf" local epc_config_file=$epc_default_config_file - local MSC_DIR="/tmp" until [ -z "$1" ] do @@ -103,11 +127,11 @@ function main() shift; ;; -m | --mscgen) - MSC_DIR=$2 + g_msc_dir=$2 # can omit file name if last arg on the line - if [ -d "$MSC_DIR" ]; then - echo "setting mscgen log files to dir: $MSC_DIR" - run_mscgen=1 + if [ -d "$g_msc_dir" ]; then + echo "setting mscgen log files to dir: $g_msc_dir" + g_run_msc_gen=1 exe_arguments="-m $exe_arguments" shift 2; else @@ -141,38 +165,29 @@ function main() epc_config_file="$OPENAIR_DIR/targets/bin/epc.local.enb.conf" fi - if [ $run_mscgen -eq 1 ]; then + if [ $g_run_msc_gen -eq 1 ]; then rm -f /tmp/openair.msc.* fi exe_arguments="-O $epc_config_file $exe_arguments" if [ $run_gdb -eq 0 ]; then + # trap keyboard interrupt (control-c) + trap control_c SIGINT $OPENAIR_DIR/targets/bin/mme_gw.Rel10 `echo $exe_arguments` 2>&1 else + # trap keyboard interrupt (control-c) is done by gdb touch ~/.gdb_mme_gw chmod 777 ~/.gdb_mme_gw echo "file $OPENAIR_DIR/targets/bin/mme_gw.Rel10" > ~/.gdb_mme_gw echo "set args $exe_arguments " >> ~/.gdb_mme_gw echo "run" >> ~/.gdb_mme_gw cat ~/.gdb_mme_gw - gdb -n -x ~/.gdb_mme_gw + gdb -n -x ~/.gdb_mme_gw + if [ $g_run_msc_gen -eq 1 ]; then + do_msc_gen + fi fi - - if [ $run_mscgen -eq 1 ]; then - cd $MSC_DIR - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - fi - } sudo echo