I am trying to make a SMS application to send message to phone number from this C# application by using GSM modem, but it gives this error:
+CME Error:PACM(AP),UNREGISTED
OK
OK
+CME Ошибка: PACM (AP), Not_Allowed_SLO < /p>
ok < /p>
+cme error: pacm (ap), not_lowed_slo < /p>
ok < /p>
+cme error: pacm (ap), не_аллос. /> Hi < /p>
error < /p>
< /blockquote>
Вот мой код: < /p>
private void btnsend_Click(object sender, EventArgs e)
{
try
{
SerialPort sp = new SerialPort();
sp.PortName = txtport.Text;
sp.Open();
sp.WriteLine("AT" + Environment.NewLine);
Thread.Sleep(100);
sp.WriteLine("AT+CMGF=1" + Environment.NewLine);
Thread.Sleep(100);
sp.WriteLine("AT+CSCS=\"GSM\"" + Environment.NewLine);
Thread.Sleep(100);
sp.WriteLine("AT+CMGS=\"" + txtphone.Text + "\"" + Environment.NewLine);
Thread.Sleep(100);
sp.WriteLine(txtmessage.Text + Environment.NewLine);
Thread.Sleep(100);
sp.Write(new byte[] { 26 }, 0, 1);
Thread.Sleep(100);
var response = sp.ReadExisting();
if (response.Contains("ERROR"))
{
MessageBox.Show("Sending fialed", "Message", MessageBoxButtons.OK, MessageBoxIcon.Stop);
MessageBox.Show(response);
}
else
{
MessageBox.Show("Message sent", "Message", MessageBoxButtons.OK, MessageBoxIcon.None);
}
sp.Close();
}
catch (Exception ex)
{
}
}
Подробнее здесь: https://stackoverflow.com/questions/718 ... ving-error