summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorRoman Yeryomin <roman@advem.lv>2012-10-10 19:07:43 +0300
committerRoman Yeryomin <roman@advem.lv>2013-05-26 00:46:39 +0300
commit412c781600fa41c0133de2e0fb4af9e9ef3f08b5 (patch)
tree182bdcd0f728df1789551f5826af282ab66079b6 /package
parent5a0e79b3b34d22b9b60941ff20d205bb55a31ab7 (diff)
Fix query3g so it could detect more 3g dongles which don't have AT+CPIN command
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'package')
-rw-r--r--package/query3g/files/query3g.gcom76
-rw-r--r--package/query3g/files/query3g.sh4
2 files changed, 69 insertions, 11 deletions
diff --git a/package/query3g/files/query3g.gcom b/package/query3g/files/query3g.gcom
index f63207805..9b3ecc6cb 100644
--- a/package/query3g/files/query3g.gcom
+++ b/package/query3g/files/query3g.gcom
@@ -7,15 +7,7 @@ opengt
send "AT\^CURC=0^m"
waitfor 5 "OK","ERROR"
- let $c="AT+CPIN?^m"
- let $r="+CPIN"
- gosub readatcmd
-
- let $c="AT+CSQ^m"
- let $r="+CSQ"
- gosub readatcmd
-
- let $c="ATE1; +CGMI^m"
+ let $c="AT+CGMI^m"
gosub readatcmdnr
let $v=$s
@@ -26,27 +18,74 @@ opengt
if $toupper($mid($v,0,3)) = "HUA" goto huawei
if $toupper($mid($v,0,3)) = "VOD" goto vodafone
if $toupper($mid($v,0,3)) = "NOK" goto vodafone
+ if $toupper($mid($v,0,4)) = "HSPA" goto ccrap
+ goto generic
+
+
+:signal-generic
+ let $c="AT+CSQ^m"
+ let $r="+CSQ"
+ gosub readatcmd
+ return
+
+
+:cpin-generic
+ let $c="AT+CPIN?^m"
+ let $r="+CPIN"
+ gosub readatcmd
+ return
+
+
+:cpin-qualcomm
+ let $c="AT$QCPINSTAT?^m"
+ let $r="$QCPINSTAT"
+ gosub readatcmd
+ return
+
+
+:ccrap
+ gosub cpin-qualcomm
+
goto generic
+
:vodafone
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT%NWSTATE=1^m"
let $r="%NWSTATE"
gosub readatcmd
+
goto next
+
:novatel
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT$CNTI=0^m"
let $r="$CNTI"
gosub readatcmd
+
goto next
+
:sierra
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT*CNTI=0^m"
let $r="*CNTI"
gosub readatcmd
+
goto next
+
:option
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT_OCTI?^m"
let $r="_OCTI"
gosub readatcmd
@@ -54,9 +93,14 @@ opengt
let $c="AT_OWCTI?^m"
let $r="_OWCTI"
gosub readatcmd
+
goto next
+
:zte
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT+COPS?^m"
let $r="+COPS"
gosub readatcmd
@@ -64,23 +108,36 @@ opengt
let $c="AT+ZPAS?^m"
let $r="+ZPAS"
gosub readatcmd
+
goto next1
+
:huawei
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT\^SYSINFOEX^m"
let $r="\^SYSINFOEX"
gosub readatcmd
+ goto next
+
+
:generic
+ gosub cpin-generic
+ gosub signal-generic
+
let $c="AT\^SYSINFO^m"
let $r="\^SYSINFO"
gosub readatcmd
+
:next
let $c="AT+COPS=3,2; +COPS?^m"
let $r="+COPS"
gosub readatcmd
+
:next1
let $c="AT+CREG=2; +CREG?^m"
let $r="+CREG"
@@ -100,6 +157,7 @@ opengt
exit 0
+
:readatcmd
let i=5
send $c
diff --git a/package/query3g/files/query3g.sh b/package/query3g/files/query3g.sh
index b591d61a3..33cfe2379 100644
--- a/package/query3g/files/query3g.sh
+++ b/package/query3g/files/query3g.sh
@@ -22,9 +22,9 @@ for port in 0 1 2 3 4 5 6 7 8 9; do
local vid="$(cat "$tty/../../idVendor")"
local pid="$(cat "$tty/../../idProduct")"
- if [ "$last_reset" != "$vid:$pid" ]; then
+ if [ "$last_reset" != "$vid:$pid" ] && [ "$vid:$pid" != "0685:7000" ]; then
last_reset="$vid:$pid"
- $reset "$vid:$pid" >/dev/null
+# $reset "$vid:$pid" >/dev/null
local try=0
while [ $((try++)) -lt 5 ] && [ ! -e "$dev" ]; do sleep 1; done