summaryrefslogtreecommitdiff
path: root/package/comgt/files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2011-11-30 14:16:44 +0000
committerJohn Crispin <john@openwrt.org>2011-11-30 14:16:44 +0000
commit6db7b50cec7b65e10b28c32b3e442e1c4e90d933 (patch)
tree90209930689f1231a5a30fe3a141061cb5f535af /package/comgt/files
parentfc6b568cab2e097428296fe299cedcdb2553f0b1 (diff)
downloadmtk-20170518-6db7b50cec7b65e10b28c32b3e442e1c4e90d933.zip
mtk-20170518-6db7b50cec7b65e10b28c32b3e442e1c4e90d933.tar.gz
mtk-20170518-6db7b50cec7b65e10b28c32b3e442e1c4e90d933.tar.bz2
comgt: Add scripts to comgt to retrieve the IMSI and CNUM to identify the SIM card.
Signed-off-by: Daniel Golle <dgolle@allnet.de> SVN-Revision: 29365
Diffstat (limited to 'package/comgt/files')
-rw-r--r--package/comgt/files/getcnum.gcom20
-rw-r--r--package/comgt/files/getimsi.gcom17
2 files changed, 37 insertions, 0 deletions
diff --git a/package/comgt/files/getcnum.gcom b/package/comgt/files/getcnum.gcom
new file mode 100644
index 0000000..450cf8c
--- /dev/null
+++ b/package/comgt/files/getcnum.gcom
@@ -0,0 +1,20 @@
+opengt
+ set com 115200n81
+ set comecho off
+ set senddelay 0.02
+ waitquiet 0.2 0.2
+ flash 0.1
+
+:start
+ send "AT+CNUM^m"
+ get 1 "^m" $n
+ get 1 ":" $n
+ get 1 "\"" $n
+ get 1 "\"" $n
+ get 1 "\"" $n
+ get 1 "\"" $n
+ let n = len($n)
+ if n<1 goto continue
+ print $n
+:continue
+ exit 0
diff --git a/package/comgt/files/getimsi.gcom b/package/comgt/files/getimsi.gcom
new file mode 100644
index 0000000..0485456
--- /dev/null
+++ b/package/comgt/files/getimsi.gcom
@@ -0,0 +1,17 @@
+opengt
+ set com 115200n81
+ set comecho off
+ set senddelay 0.02
+ waitquiet 0.2 0.2
+ flash 0.1
+
+:start
+ send "AT+CIMI^m"
+ get 1 "^m" $s
+ get 1 "^m" $s
+ let x = len($s)
+ if x<2 goto continue
+ let $s = $right($s, x-1)
+ print $s
+:continue
+ exit 0