diff options
author | John Crispin <blogic@openwrt.org> | 2014-09-16 18:34:44 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-09-16 18:34:44 +0000 |
commit | 82f727d3807ec45bdcafd21e5c3375309a42ecc5 (patch) | |
tree | cf31c7b5d1182f3ce449f440b70b5392df87d542 /package/network/utils/comgt/files/directip.gcom | |
parent | f15440561bdd321551239ca9dee043819936e91a (diff) | |
download | upstream-82f727d3807ec45bdcafd21e5c3375309a42ecc5.tar.gz upstream-82f727d3807ec45bdcafd21e5c3375309a42ecc5.tar.bz2 upstream-82f727d3807ec45bdcafd21e5c3375309a42ecc5.zip |
comgt: add directip proto
add a proto handler for sierra wireless directip modems
Signed-off-by: John Crispin <blogic@openwrt.org>
Backport of r42465
git-svn-id: svn://svn.openwrt.org/openwrt/branches/barrier_breaker@42577 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils/comgt/files/directip.gcom')
-rw-r--r-- | package/network/utils/comgt/files/directip.gcom | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/package/network/utils/comgt/files/directip.gcom b/package/network/utils/comgt/files/directip.gcom new file mode 100644 index 0000000000..afaaacf4ad --- /dev/null +++ b/package/network/utils/comgt/files/directip.gcom @@ -0,0 +1,55 @@ +opengt +set com 115200n81 +set comecho off +set senddelay 0.05 +waitquiet 1 0.2 + +:start + if $env("USE_AUTH") = "0" goto connect + send "AT$QCPDPP=3," + send $env("USE_AUTH") + send ",\"" + if $env("USE_USER") <> "" send $env("USE_USER") + send "\",\"" + if $env("USE_PASS") <> "" send $env("USE_PASS") + send "\"^m" + waitfor 5 "OK" + if % = 0 goto connect + print "WWAN error. Auth failed.\r\n" + exit 1 + +:connect + send "AT+CFUN=1^m" + send "AT+CGDCONT=3,\"IP\",\"" + send $env("USE_APN") + send "\"^m" + waitfor 5 "OK" + if % = 0 goto connok + print "WWAN error. Connection failed.\r\n" + exit 1 + +:connok + let c=1 +:loop + sleep 2 + send "AT+CGATT?^m" + waitfor 5 "+CGATT: 1" + if % = 0 goto carrierok + if c > 10 goto carriererr + inc c + goto loop + +carriererr: + print "WWAN error. No carrier.\r\n" + exit 1 + +:carrierok + send "AT!SCACT=1,3^m" + waitfor 5 "OK" + if % = 0 goto dialok + print "WWAN error. Dialing failed.\r\n" + exit 1 + +:dialok + print "WWAN connection established.\r\n" + exit 0 |