summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-30 14:16:44 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-30 14:16:44 +0000
commitb592127753bede8c59a975df9d54b0e326b49a43 (patch)
tree349116f7666040b4acdfec8c1c99057e98f8a089 /package
parent46e8f2fce587b8b1ee1ebcb430f533b5dce31c04 (diff)
comgt: Add scripts to comgt to retrieve the IMSI and CNUM to identify the SIM card.
Signed-off-by: Daniel Golle <dgolle@allnet.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29365 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/comgt/Makefile2
-rw-r--r--package/comgt/files/getcnum.gcom20
-rw-r--r--package/comgt/files/getimsi.gcom17
3 files changed, 39 insertions, 0 deletions
diff --git a/package/comgt/Makefile b/package/comgt/Makefile
index d853276a45..f2a6966e9b 100644
--- a/package/comgt/Makefile
+++ b/package/comgt/Makefile
@@ -74,6 +74,8 @@ define Package/comgt/install
$(INSTALL_DATA) ./files/getcardinfo.gcom $(1)/etc/gcom/getcardinfo.gcom
$(INSTALL_DATA) ./files/getstrength.gcom $(1)/etc/gcom/getstrength.gcom
$(INSTALL_DATA) ./files/getcarrier.gcom $(1)/etc/gcom/getcarrier.gcom
+ $(INSTALL_DATA) ./files/getcnum.gcom $(1)/etc/gcom/getcnum.gcom
+ $(INSTALL_DATA) ./files/getimsi.gcom $(1)/etc/gcom/getimsi.gcom
$(INSTALL_DIR) $(1)/etc/hotplug.d/tty
$(INSTALL_DATA) $(FILES_DIR)/3g.usb $(1)/etc/hotplug.d/tty/30-3g
$(Package/comgt/install/$(COMGT_VARIANT))
diff --git a/package/comgt/files/getcnum.gcom b/package/comgt/files/getcnum.gcom
new file mode 100644
index 0000000000..450cf8c413
--- /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 0000000000..04854561b1
--- /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