响应于一个AT命令的结束 [英] End of response to an AT command

查看:634
本文介绍了响应于一个AT命令的结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确保什么是AT命令结束发送到GSM模块?

How to be sure what is end of an AT command send to GSM module?

我需要重新AT命令present结束对每一种情况,由于在接收整个响应发现了一些字符或字符串。

I need some character or string that represent end of AT command for every case due to finding when whole response is received.

我想这有什么\\ r \\ n序列,但这个序列可能是在AT命令响应的开始?

I guess it have something with "\r\n" sequence but, this sequence could be at the beginning of AT command response?

推荐答案

就像你想这是 \\ r \\ n 。结果
这限定了一行的末尾。

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

和它使只处理完整的生产线感。

And it makes only sense to process complete lines.

有些命令respons仅 OK \\ r \\ n ,有的用一些数据。结果
所以,你应该建立在第一个解析器,谁可以检测到完整的生产线,使他们能够
与处理的响应函数进行处理。

Some commands respons with only OK\r\n, 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.

有时你可以连你也不请求响应,如更改事件网​​登录或SIM状态 #QSS:2 \\ r \\ ñ

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

所以,你需要知道什么回答你期望和等待,直到你得到这个

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

这篇关于响应于一个AT命令的结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆