Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

c - End of response to an AT command

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

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

And it makes only sense to process complete lines.

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...