Send SMS using AT commands via Dual sim phone

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I wrote application to send sms using AT commands as follows
SerialPort _serialPort = new SerialPort("COM40", 115200);

Thread.Sleep(1000);

_serialPort.Open();

Thread.Sleep(1000);

_serialPort.Write("AT+CMGF=1r");

Thread.Sleep(1000);


_serialPort.Write("AT+CMGS="" + toPhoneNumber + ""rn");

Thread.Sleep(1000);

_serialPort.Write("Test" + "x1A");

Thread.Sleep(1000);

//labelStatus.Text = "Status: Message sent";

_serialPort.Close();



This code works well if the phone is installed and if COM port number is available.
My problem is when dual sim phone is connected to the computer, is there any way to select the sim to send message from?

View the full article
 
Back
Top