In my SMS application, I read the COM messages with the following function :
void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
if (e.EventType == SerialData.Chars)
{
string t = _sp.ReadExisting();
Debug.WriteLine("message recu : " + t);
}
}
And I launch command in the COM port with :
public void ExecCommand(string command)
{
_sp.DiscardOutBuffer();
_sp.DiscardInBuffer();
_sp.Write(command + "\r");
}
I launch the CMTI notifications for the new messages received with :
ExecCommand("AT+CNMI=2,1,0,0,0");
And I receive the notifications (for example) :
+CMTI: "ME",0
Then, I try to read this received message with :
ExecCommand("AT+CMGR=" + pos);
But my only response is
OK
And the `AT+CPMS?` command :
+CPMS: "ME",0,20,"ME",0,20,"ME",0,20
The ME and SM storage are empty... how can I read the messages I receive ?