I have been thinking over it for a while and finally I spent some time in looking into SMS world. Always wondered as to how to send SMS using PC or process SMS received on mobile using the application running on PC.
Well, people have solved this problem long ago. In fact, most of the applications are based on short codes which are issued by Telecom operators. Short codes are like domain names. I was interested in using plain old mobile phone number instead of a short code to achieve the same result.
GSM phones have built in GPS/GPRS modem which can be used with PC when we connect our mobile to PC using either Bluetooth or USB cable. Most of the mobile phones available in market today provide connectivity to PC using either or both of the methods. I explored the connectivity using USB cable.
When connected using USB cable, the mobile phone acts as a conventional modem, using which we can communicate with it. This is plain old serial communication. We can initialize the mobile phone modem and also send commands to it, to perform tasks such as sending SMS, listing the SMSs and reading the messages etc.
The modem is initialized and controlled using set of AT commands. AT stands for "ATtention". There is also a set of extened AT commands which mobile phone manufactures implement in their mobile phone modem software. We perform SMS send, read, list, delete operatoins using these set of commands . Ironically, not all mobile phones implement all the functionality. Some mobile phones allow sending SMS, where as some allow all (send, read , list, delete etc) operations. For example SMS is sent using AT+CMGS command. Before using this command, we can verify if the attached mobile phone modem supports this command using syntax AT+CMGS=?
Similarly, SMS is read using AT+CMGR command and they are listed using AT+CMGL command.
There are two formats in which SMS messages are stored on mobile phone. First is the text format. The text format is very simple. It is human readable. The other format is known as PDU format, which is kind of cryptic and is not human readable. Both the formats are well documented in GSM standard though. There are bunch of AT+ commands and one of them also lets you check if your mobile phone supports text, PDU or both modes for reading the SMS.
I happen to experiement with my Nokia 5800 Xpress Music and Sony Ericsson W880i phones. Nokia phone allowed me to send SMS, where as SE phone supported all, send, read and list SMS operations.
Finally, have a look at these web pages. They were of great help in understanding the whole concept. http://www.developershome.com/sms/smsIntro.asp provides a very good information on the topic where as http://www.dreamfabric.com/sms/ provides info about PDU format.
Hope you enjoyed the story. Next to try, would be some good application around this whole concept. So stay tuned.
Till next, take care.
Cheers,
- Manoj
--------
Friday, July 2, 2010
Subscribe to:
Posts (Atom)