mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-29 21:01:42 +08:00
26 lines
313 B
Plaintext
26 lines
313 B
Plaintext
let $d = $env("DEVPORT")
|
|
if $d = "" goto timeout
|
|
|
|
open com $d
|
|
set com 57600n81
|
|
set senddelay 0.05
|
|
waitquiet 2 0.5
|
|
send "AT^m"
|
|
waitfor 2 "OK"
|
|
if % = -1 goto timeout
|
|
if % = 0 goto continue
|
|
exit 0
|
|
|
|
:continue
|
|
send "AT+CPIN?^m"
|
|
waitfor 2 "+CME ERROR:"
|
|
if % = 0 goto simerr
|
|
exit 0
|
|
|
|
:timeout
|
|
exit 1
|
|
|
|
:simerr
|
|
exit 2
|
|
|