I'm writing a very simple program which uses AT commands to send a SMS via a GSM modem on my com port. I've managed to successfully communicate with the modem through my program (thanks for the "serial Port Comms in c#" tutorial
When you issue the command to write a text in HyperTerminal you get a '>' prompt in which you type your message and then press 'ctrl-z' to return to the command prompt. How do I do this in my program?
Any suggestions are much appreciated or anu pointers in the right direction will do nicely.
Here is a bit of my code to help understanding.....maybe!!!
Thanks
private void button1_Click(object sender, EventArgs e)
{
//Firstly set the modem to text mode
serialPort1.Write("at+cmgf=1\r\n");
//Now enter message writing mode to send an sms to the number below
serialPort1.Write("at+cmgw=\"+447878xxxxxx\"\r\n");
//Now send the contents of the message
serialPort1.Write("Test message from coded program"); [b]At the end of this line I need ctrl-z[/b]
//Now send the message stored at position 2
serialPort1.Write("at+cmss=2\r\n");
}
This post has been edited by PsychoCoder: 10 April 2008 - 07:10 AM

New Topic/Question
Reply




MultiQuote










|