I am currently creating an app to send sms message to GSM Modem (mobile phone) using System.IO.Ports.SerialPort.
I beleive I have correctly configured the port as I am able to send AT commands to the modem and get replies form the modem which tells me I am connected.
But my problem is using the AT commands themselves, I dont know if they are being sent as expected.
All the commands I am using work with Hyperterminal on the same GSM Modem/Phone.
The problem may be the escape character for the end of the message, in Hyperterminal it is CTRL+Z, which I have read is chr(26).
Or it could be the other AT commands themselves.
Can anyone see my error in this code:
private void OpenPort()
port.PortName = "COM4";
port.ReceivedBytesThreshold = 1;
port.BaudRate = 115200;
port.DtrEnable = true;
port.DataReceived += new SerialDataReceivedEventHandler(OnCom4Receive);
private void SendMSG()
//port.WriteLine("> TESTING 1,2,3,4" + char.ConvertFromUtf32(26));
port.WriteLine("TESTING 1,2,3,4" + Convert.ToChar(26));
static private void OnCom4Receive(object sender, SerialDataReceivedEventArgs e)
There are not any errors returned at all.
Many thanks for your time in reading this.
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.