我已成功发送多部分 pdu 短信,
问题是当我尝试将此短信发送到不同网络上的号码时,它给了我以下错误:
+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());
}