First and the foremost thing before you start developing an application based on AT command , know which mode (text/pdu) your mobile handset supports.
If handset supports TEXT mode then work is simple.
- First you need to set text mode by using AT+CMFG=1 Command.
- And then use AT+CMGS=”+CellPhoneNumber” <enter>.
- If command execute successfully then It will return “>” as a response.
- After getting success response simply write your message ex. “this is test SMS”. This will submit SMS to network and will return the Message ID.
- If you want to send long message i.e. greater than 160 character length message then, this is really very useful.
I will cover how to send long message in my succeeding posts.
If handset supports PDU mode then work will be little lengthy and need some more efforts.
- For PDU mode, you need to set pdu mode by using AT+CMFG=0 Command.
- And then write AT+CMGS=<length><CR> command for modem to response. Here you can’t send the length of actual message. You need to convert the text into 7-bit or 8-bit encoding scheme. I included some useful links and sample application at the bottom of the page to accomplish this task.
- If command execute successfully then It will return “>” as a response.
- After getting success response, send <PDU><ctr-z/esc > sequence. This will submit SMS to network and will return the Message ID.
- If you want to send long message i.e. greater than 160 character length message then, this is really very useful.
Reference :
- PDU message format : http://www.dreamfabric.com/sms/
- Complete information about all AT Commands : http://www.developershome.com/sms/operatingMode.asp
- Text to PDU converter : http://nerdlabs.org/tools/pdu.php
Sample Application :
- PDU Decoder : http://www.codeproject.com/KB/IP/PDUDecoder.aspx
- Sample Applications : http://www.scampers.org/steve/sms/samples.htm
Do share new things with me.
No comments:
Post a Comment