I want to make a c# program that connects to my mobile phone by usb cable to make just a call. I found how to connect by SerialPort and how to make call by AT Commands, but when I run my program and click to make the call, nothing happens. This is my code, please Help me:
SerialPort SP = new SerialPort("COM3");
SP.BaudRate = 9600;
SP.Parity = Parity.None;
SP.DataBits = 8;
SP.StopBits = StopBits.One;
SP.RtsEnable = true;
SP.DtrEnable = true;
SP.Encoding = System.Text.Encoding.Unicode;
SP.ReceivedBytesThreshold = 1;
SP.NewLine = Environment.NewLine;
SP.Open();
SP.Write("ATDT 0999182542"+ Environment.NewLine);
SP.Close();
First of all to see if your modem is connected, send an
ATcommand to the port. If you get aOKas response, then it means your modem is connected.To make a call the syntax is:
ATDYourphnumber;//Donot forget the “;”Example:
ATD9012345645;So you should write to the port the same way.
Syntax:
SP.WriteLine("ATD"+phonenumber+";");You can use WriteLine since that serves the
\r\ntoo.Update: How to see the response from modem:
After SP.Open( ) ;