// if button was clicked, read sms stored on sim
private void button3_Click(object sender, EventArgs e)
{
if (this.serialPort1.IsOpen)
{
serialPort1.BaseStream.Flush();
string a = "sm"; string b = "all";
//this.serialPort1.Write("AT+CPMS=\"" + a + "\"\r\n");
this.serialPort1.Write("AT+CMGF=1\r\n");
this.serialPort1.Write("AT+CSCS=\"PCCP437\"");
this.serialPort1.Write("AT+CPMS=\"" + a + "\"\r\n");
this.serialPort1.Write("AT+CMGR=2\r\n");
//this.serialPort1.Write("AT+CMGL=\"" + b + "\"\r\n");
//textBox5.Text = this.serialPort1.ReadLine();
//textBox5.Text = this.serialPort1.ReadExisting();
MessageBox.Show("\nMessage Was Read\n", "Information");
}
else
{
MessageBox.Show("\nSerial Port Is Not Open\n", " ERROR ");
}
}
Help reading sms with at commands(text mode).
Page 1 of 10 Replies - 485 Views - Last Post: 04 September 2012 - 11:39 PM
#1
Help reading sms with at commands(text mode).
Posted 04 September 2012 - 11:39 PM
I tried to send and read sms from hyperterminal using text mode, it works fine. I can now also send at command using serial port of c#. Now my porblem, after lots of time researching and trying, I can't figure how to read sms using at commands with c#.. I wrote the codes below, but I know there is something wrong with it. How can I read the sms message and sender number and be displayed on listview? Thanks
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote


|