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
- Wait for the string
"Username:"
to appear in the output.
- Send the string
"my_name"
.
- Wait for the string
"Password:"
to appear in the output.
- Send the string
"my_secret_password"
.
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
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…