更新时间:2023-12-05 21:06:16
For the time being1 I think your best option here is to use the programming language expect. It is written to monitor growing text output and support scenarios like
"Username:"
出现在输出中."my_name"
."Password:"
出现在输出中."my_secret_password"
."Username:"
to appear in the output."my_name"
."Password:"
to appear in the output."my_secret_password"
.发送AT命令并等待响应非常相似,因此这是绝对可行的.当我在爱立信工作时,我们编写了一个测试套件,期望它可以发送AT命令并解析日志文件以运行测试.
Sending AT command and waiting for the response is very similar, so this is absolutely doable. When I worked at Ericsson we had a test suite written in expect that sent AT commands and parsed log files to run tests.
1 作为我的 atinout 程序的伴侣,我已经开始编写一个程序来发送命令AT + CMGS及其有效载荷正确.但是除非您非常非常有耐心,否则您不应该等待此操作完成.
1 As a companion to my atinout program, I have started to write a program to send the command AT+CMGS and its payload correctly. But unless you are very, very patient you should not wait for this to be finished.