USSD消息通过华为调制解调器通过AT命令发送

问题描述 投票:3回答:1

我正在尝试通过AT Command用华为调制解调器发送usd消息。这是我的函数,它将At命令写入串行端口。

对于短信,请尝试以下内容及其工作方式,我可以拒绝短信。

 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, 3000, "Failed to send message"); //3 seconds
            if (recievedData.EndsWith("\r\nOK\r\n"))
            {
                isSend = true;
            }
            else if (recievedData.Contains("ERROR"))
            {
                isSend = false;
            }

但是对于ussd消息,我正在尝试以下操作,

  string recievedData = ExecCommand(port,"AT", 300, "No phone connected");
            recievedData = ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.");
            String command = "AT+CUSD=1,*566#";
            recievedData = ExecCommand(port,command, 3000, "Failed to send ussd");
            Console.WriteLine("received data : " +recievedData);
          //  command = Message + char.ConvertFromUtf32(26) + "\r";
          //  recievedData = ExecCommand(port,command, 3000, "Failed to send message"); //3 seconds
            if (recievedData.EndsWith("\r\nOK\r\n"))
            {
                isSend = true;
            }
            else if (recievedData.Contains("ERROR"))
            {
                isSend = false;
            }

[前两个exec命令返回ok,但是第三个exec命令返回错误。

USSD代码正在提供商的移动合作伙伴应用程序中工作,

我需要发送哪些AT命令才能正确处理usdd应用程序?

c# c#-4.0 gsm modem ussd
1个回答
0
投票

您终于能够解决如何在华为调制解调器上使用AT命令执行USSD代码的问题?如果是,您是如何做到的?因为我当前正面临着同样的问题,每当在我的华为E173调制解调器上编写用于执行USSD代码的AT命令(AT + CUSD = 1,“ 2331323323”,15)时,我只会收到一个OK作为响应。

© www.soinside.com 2019 - 2024. All rights reserved.