如何使用AT命令获取消息传递报告 [英] How to Get delivery Report of Message using AT command

查看:94
本文介绍了如何使用AT命令获取消息传递报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个C#程序,使用AT命令和使用GSM调制解调器发送短信。但我想收到我发送的每个短信的发送报告。如何使用AT命令用C#程序进行?

发送消息的代码:

I wrote a C# programme to send sms using AT commands and using GSM Modem.But I want to receive the delivery report for every sms which I send.How can I do it with C# programme using AT Command?
Code For Sending Message:

string recievedData = ExecCommand(port,"AT", 300, "No phone connected");
recievedData = ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.");
               String command = "AT+CMGS=\"" + PhoneNo + "\"";
               recievedData = ExecCommand(port,command, 300, "Failed to accept phoneNo");
               command = Message + char.ConvertFromUtf32(26) + "\r";
               recievedData = ExecCommand(port,command, 10000, "Failed to send message"); //10 seconds
               if (recievedData.EndsWith("\r\nOK\r\n"))
               {
                   isSend = true;
               }
               else if (recievedData.Contains("ERROR"))
               {
                   isSend = false;
               }
               return isSend;

推荐答案

试试这个 - http://www.activexperts.com/sms-component/



非常实用..
Try this - http://www.activexperts.com/sms-component/

Very useful..


这篇关于如何使用AT命令获取消息传递报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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