69 lines
1.1 KiB
Plaintext
69 lines
1.1 KiB
Plaintext
opengt
|
|
set com 115200n81
|
|
set comecho off
|
|
set senddelay 0.02
|
|
waitquiet 0.2 0.2
|
|
|
|
let $g=$env("TIMEOUT")
|
|
if $g = "" let f=25
|
|
else let f = val($g)
|
|
|
|
send "AT+CSQ^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
|
|
send "AT+QENG=\"servingcell\"^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
|
|
send "AT+QRSRP^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
|
|
send "AT+QCAINFO^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
|
|
send "AT+QCFG=\"nwscanmode\"^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
if $s="^jERROR" goto qnwpref
|
|
goto temp
|
|
|
|
:qnwpref
|
|
send "AT+QNWPREFCFG=\"mode_pref\"^m"
|
|
let t=time()+f
|
|
gosub getresult
|
|
if $s="^mTIMEOUT ERROR" print $s
|
|
|
|
:temp
|
|
send "AT+QTEMP^m"
|
|
let t=time()+1
|
|
gosub gettemp
|
|
|
|
exit 0
|
|
|
|
:getresult
|
|
get 1 "^m" $s
|
|
let x=len($s)
|
|
if x=0 let $s="^mTIMEOUT ERROR"
|
|
else print $s
|
|
if $s="^jOK" return
|
|
if $mid($s,0,6)="^jERROR" return
|
|
if $mid($s,0,8)="^jCOMMAND" return
|
|
if $mid($s,0,11)="^j+CME ERROR" return
|
|
if time()>t return
|
|
goto getresult
|
|
|
|
:gettemp
|
|
get 1 "^m" $s
|
|
let x=len($s)
|
|
if x>0 print $s
|
|
if time()>t return
|
|
goto gettemp
|