How to handle delivery report in GSM Modem?

浪尽此生 提交于 2019-12-23 04:12:12

问题


i want to use GSM Modem in an application for some purpose.

what i want is handling SMS delivery report for list of sent sms.

GSM Modem inbox & outbox are limited to 15 items. every time i read the inbox the gsm modem return a list an clear the list.

how to check delivery status of sms that had been deleted from GSM Modem inbox ?

i need something unique that enables me to identify each message.


回答1:


every time i read the inbox the gsm modem return a list an clear the list.

Messages that are stored in modem's memory will not be removed after you read them. You just read message with at+cmgl={message id in storage} command and then remove it using at+cmgd={message id in storage} command (or not, as you wish. You can clear all modem's storages using at+cmgd=1,4 command).

Back to the question: after sending SMS, you'll get a response from modem, smth like this: +cmgs: {sms id, 0 to 255} OK. In case, if Service Center has delivered the SMS successfully, modem will return this response: +cds: {some id which does not matter} {PDU status report}. You need just decode this PDU to obtain status report, id of original SMS and other useful data. If sent sms's ID and ID from status report are equal, you have status report exactly for your message. Note, if you remove message from modem's storage before receiving of delivery report, you'll get report which will be containing all usual information, but status of delivery will be most likely 71 instead of 0.



来源:https://stackoverflow.com/questions/18251903/how-to-handle-delivery-report-in-gsm-modem

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