diff options
author | Roman Yeryomin <roman@advem.lv> | 2012-10-10 19:07:43 +0300 |
---|---|---|
committer | Roman Yeryomin <roman@advem.lv> | 2012-12-03 00:13:25 +0200 |
commit | c1f8d33d3b3563ef77bcaaae3d16921540079ef2 (patch) | |
tree | 4d7a8fadaa6b022551f022da1e6ff1b0f02a1d82 /package/query3g/files/query3g.gcom | |
parent | 44edd760c668907a304ffc022e4c50fa8eb5d81a (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/query3g/files/query3g.gcom')
-rw-r--r-- | package/query3g/files/query3g.gcom | 76 |
1 files changed, 67 insertions, 9 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 |