mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-11 19:37:51 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,51 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.01
|
||||
waitquiet 0.01 0.01
|
||||
|
||||
let $c="AT+CSQ^m"
|
||||
let $r="+CSQ"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+COPS=3,0;+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+COPS=3,2;+COPS?^m"
|
||||
let $r="+COPS"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CREG=2;+CREG?^m"
|
||||
let $r="+CREG"
|
||||
gosub readatcmd
|
||||
|
||||
let $c="AT+CPIN?^m"
|
||||
let $r="+CPIN"
|
||||
gosub readatcmd
|
||||
|
||||
exit 0
|
||||
|
||||
:readatcmd
|
||||
let i=15
|
||||
send $c
|
||||
:loop
|
||||
get 0.1 "^m" $s
|
||||
let l=len($r)
|
||||
if len($s) < l goto loop1
|
||||
if $mid($s,1,l) <> $r goto loop1
|
||||
print $s
|
||||
return
|
||||
|
||||
:loop1
|
||||
if len($s) < 2 goto loop2
|
||||
if $mid($s,1,2) = "ER" return
|
||||
if $mid($s,1,2) = "CO" return
|
||||
if len($s) < 10 goto loop2
|
||||
if $mid($s,1,10) != "+CME ERROR" goto loop2
|
||||
print $s
|
||||
return
|
||||
:loop2
|
||||
if i = 0 exit 0
|
||||
let i=i-1
|
||||
goto loop
|
||||
Reference in new issue
Block a user