mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-30 18:49:23 +02:00
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
This commit is contained in:
parent
46e8f2fce5
commit
b592127753
@ -74,6 +74,8 @@ define Package/comgt/install
|
|||||||
$(INSTALL_DATA) ./files/getcardinfo.gcom $(1)/etc/gcom/getcardinfo.gcom
|
$(INSTALL_DATA) ./files/getcardinfo.gcom $(1)/etc/gcom/getcardinfo.gcom
|
||||||
$(INSTALL_DATA) ./files/getstrength.gcom $(1)/etc/gcom/getstrength.gcom
|
$(INSTALL_DATA) ./files/getstrength.gcom $(1)/etc/gcom/getstrength.gcom
|
||||||
$(INSTALL_DATA) ./files/getcarrier.gcom $(1)/etc/gcom/getcarrier.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_DIR) $(1)/etc/hotplug.d/tty
|
||||||
$(INSTALL_DATA) $(FILES_DIR)/3g.usb $(1)/etc/hotplug.d/tty/30-3g
|
$(INSTALL_DATA) $(FILES_DIR)/3g.usb $(1)/etc/hotplug.d/tty/30-3g
|
||||||
$(Package/comgt/install/$(COMGT_VARIANT))
|
$(Package/comgt/install/$(COMGT_VARIANT))
|
||||||
|
20
package/comgt/files/getcnum.gcom
Normal file
20
package/comgt/files/getcnum.gcom
Normal file
@ -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
|
17
package/comgt/files/getimsi.gcom
Normal file
17
package/comgt/files/getimsi.gcom
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user