b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | opengt |
2 | set com 115200n81 | ||||
3 | set comecho off | ||||
4 | set senddelay 0.02 | ||||
5 | waitquiet 0.2 0.2 | ||||
6 | flash 0.1 | ||||
7 | |||||
8 | :start | ||||
9 | send "AT+CUSD=1," | ||||
10 | send $env("ussd") | ||||
11 | send ",15" | ||||
12 | send "^m" | ||||
13 | waitfor 120 "+CUSD:" | ||||
14 | if % = -1 goto timeout | ||||
15 | get 1 "^m" $s | ||||
16 | print $s | ||||
17 | exit 0 | ||||
18 | |||||
19 | :timeout | ||||
20 | print "ERROR: no USSD response, timeout.\n" | ||||
21 | exit 1 |