AT+CMGS doesn't work correctly

前提是你 提交于 2019-12-11 07:05:58

问题


I have a problem with AT command for sending SMS - AT+CMGS. After sending AT+CMGS=<length of PDU datagram><CR> I wait for response of modem. After reading <CR><LF>><Space> I send <PDU datagram><CTRL-Z> but I don't get any answer from modem. If I send any command after that the response to that command is +CMGS=<reference number> which is exactly the response which I expected later.

But if I wait for about 100ms after reading <CR><LF>><Space> and than send PDU datagram than everything works well and I receive expected answer from modem.

It is really necessary to wait after receiving response from modem? I thought that I can send response immediately after reading <CR><LF>><Space>. Can someone help me to understand where could be a problem?

Thanks a lot


回答1:


You are correct in your assumption, 27.005 states for AT+CMGS:

the TA shall send a four character sequence <CR><LF><greater_than><space> (IRA 13, 10, 62, 32) after command line is terminated with <CR>; after that text can be entered from TE to ME/TA.

(TA (terminal adapter) is modem, TE (terminal equipment) is sender of AT commands)

However, in practice some additional small delay might be needed even in cases where the modem have signalled that it is ready to receive.



来源:https://stackoverflow.com/questions/45932723/atcmgs-doesnt-work-correctly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!