且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

对 AT 命令的响应结束

更新时间:2023-12-06 07:54:40

就像你想象的那样 .
这定义了一行的结尾.

Like you suppose it's .
This defines the end of a line.

而且只有处理完整的行才有意义.

And it makes only sense to process complete lines.

有些命令只响应 OK ,有些命令响应一些数据.
所以你应该首先构建一个解析器,它可以检测完整的行,这样它们就可以使用处理响应的函数进行处理.

Some commands respons with only OK , some with some data.
So you should build at first a parser, who can detect complete lines, so they can be processed with a function that handles responses.

有时您甚至可以得到您不要求的响应,例如更改事件 net login 或 sim 状态 #QSS: 2 .

Sometimes you can get even responses you don't request, like change events net login or the sim status #QSS: 2 .

所以你需要知道你期望什么答案,然后等到你得到这个

So you need to know what answer you expect and wait until you get this