Beruflich Dokumente
Kultur Dokumente
Krishna Akkulu
The paper describes the Java program implemented for the MultiModem GPRS wireless
modem. The MultiModem offers standards-based quad-band GSM/GPRS Class 10
performance.
Also the GPRS wireless modem with an Ethernet interface provides shared Internet
access with one IP address. The advantage of Ethernet interface is any machine which is
on network can communicate to with the modem. The picture shows MultiModem GPRS
wireless modem.
Generally programmers use AT commands through Telnet to send and receive the
messages from the Modem. But most of the software applications prefer to send or
receive the commands through programs depends on certain events occur in an
application.
Example let us say a software application determines the room temperature increased or
earth quake or fire alert occurred, then the program has to notify, the operator by sending
SMS message etc. In such situations telnet program may not be good a solution.
So, in this paper the telnet application has been simulated with Java Socket program. The
present Java program demonstrates sending and receiving SMS messages to/from cell
phones.
The AT commands used for receiving SMS messages are:
1) at+cmgf=1 (The command sets to text mode)
2) at+cnmi=2,2,0,0,0 (selects the procedure for message reception from the
network)
Now the Modem is ready to receive the SMS messages.
The Java Class name is GPRSMultiModem. The class implements Runnable interface
to achieve multithreading feature.
if(bValue)
{
os.writeBytes(strMsg);
os.writeByte(0x1A);
}
else
os.writeBytes(strMsg);
}
catch (UnknownHostException e)
{
System.out.println("Trying to connect to unknown
host: " + e.getLocalizedMessage());
}
catch (IOException e)
{
System.out.println("IOException: " +
e.getLocalizedMessage());
}
}
}
/************************************************
* Prepare SMS Msg Command
*@param String, String
************************************************/
public void PrepareSMSMsg(String strPhone, String strMsg)
{
try
{
String Str ="at+cmgs=\""+strPhone+"\"";
SendMsg(Str, false);
Thread.sleep(5000);
SendMsg(strMsg, true);
}
catch (Exception e)
{
System.out.println("IOException: " +
e.getLocalizedMessage());
}
}
}