0
我已經成功發送一個多PDU短信,
發送多部分PDU短信通過AT命令
問題是,當我嘗試這條短信發送到多個不同的網絡上它給了我下面的錯誤:
+CMGS ERROR:500
請任何人告訴我該怎麼辦。
atCommandStr = "AT+CMGF=0\r";
comPort.WriteLine(atCommandStr + (char)13);
Console.WriteLine(comPort.ReadExisting());
Thread.Sleep(2000);
for (int i = 0; i < number_of_parts; i++)
{
int oct = (messagesParts[i].ToCharArray().Count()/2) -1;
atCommandStr = "AT+CMGS=" + oct + "\r";
comPort.WriteLine(atCommandStr + (char)13);
Console.WriteLine(comPort.ReadExisting());
Thread.Sleep(2000);
string path;
path = messagesParts[i] + Char.ConvertFromUtf32(26);
comPort.WriteLine(path + (char)13);
for (int a = 0; a < 100; a++)
{
Thread.Sleep(2000);
string t = comPort.ReadExisting();
Console.WriteLine(t);
if (t != "" && t.Contains("CMGS") || t.Contains("ERROR"))
{
break;
}
}
//Console.WriteLine(comPort.ReadExisting());
}