From 5f7e99760e92ded43456eaf130a0009a903e375a Mon Sep 17 00:00:00 2001
From: Rohit Gupta <rohit.gupta@eurecom.fr>
Date: Sat, 19 Dec 2015 16:39:56 +0100
Subject: [PATCH] added to stop exmimo2

---
 cmake_targets/tools/exmimo_stop_octave.m |  4 ++++
 cmake_targets/tools/stop_exmimo2         | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 cmake_targets/tools/exmimo_stop_octave.m
 create mode 100755 cmake_targets/tools/stop_exmimo2

diff --git a/cmake_targets/tools/exmimo_stop_octave.m b/cmake_targets/tools/exmimo_stop_octave.m
new file mode 100644
index 0000000000..82aa1f2845
--- /dev/null
+++ b/cmake_targets/tools/exmimo_stop_octave.m
@@ -0,0 +1,4 @@
+n=oarf_get_num_detected_cards;
+for i=n-1:0
+	oarf_stop(i);
+end
diff --git a/cmake_targets/tools/stop_exmimo2 b/cmake_targets/tools/stop_exmimo2
new file mode 100755
index 0000000000..6931229f7a
--- /dev/null
+++ b/cmake_targets/tools/stop_exmimo2
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+echo "This script stops exmimo2 as it might be transmitting signal by itself if lte-softmodem terminates incorrectly"
+
+if [ "$OPENAIR_DIR" == "" ]; then
+  echo "Is the OPENAIR_DIR path set correctly? Exiting now"
+  exit
+fi
+
+#load the module
+sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
+
+#now we stop the card from transmitting anything
+cd $OPENAIR_DIR/targets/bin
+sudo -E octave $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
+
-- 
GitLab