This is a mirror of official site: http://jasper-net.blogspot.com/

How To Send and Receive SMS using GSM Modem

| Monday, July 26, 2010
Introduction

SMS client and server is an application software which is used for sending and receiving messages(SMS). It listens for incoming messages to arrive, processes the message if it's in a valid format. Note the processing of arrived messages depends on the application which will be discussed later. I am going to explain the following things:

Communication Port Settings
Receive Incoming Message
Send Messages
Read All Messages (Sent by the users)
Delete Messages (One or All)
I have used the GSMComm Library for Sending and Receiving SMS. You require a GSM modem or phone for sending an SMS.

Using the code

1) Communication Port Settings

CommSetting class is used for storing comm port settings:

public class CommSetting
{
   public static int Comm_Port=0;
   public static Int64 Comm_BaudRate=0;
   public static Int64 Comm_TimeOut=0;
   public static GsmCommMain comm;

   public CommSetting()
   {
       //

       // TODO: Add constructor logic here

       //

   }
}

Comm is an object of type GsmCommMain which is required for sending and receiving messages. We have to set the Comm port, Baud rate and time out for our comm object of type GsmCommMain. Then try to open with the above settings. We can test the Comm port settings by clicking on the Test button after selecting the Comm port, baud rate and Time out. Sometimes if the comm port is unable to open, you will get a message "No phone connected". This is mainly due to Baud rate settings. Change the baud rate and check again by clicking the Test button until you get a message "Successfully connected to the phone."

Read more: Codeproject

Posted via email from .NET Info

0 comments: