You Are Here:

Community: Wiki

This page was last modified on 5 September 2008, at 22:35.

Using AT commands to send and read SMS

From Forum Nokia Wiki

Contents

Introduction

This article discusses how to use AT commands to send and receive SMS. It can be used to create a PC application that send SMS from the phone. This kind of application is useful, for example, in automating test cases related to SMS.

Note that not all phones support all SMS AT commands. For example, some phones may support send command only and not support read command. See also links at the end of this article to find more about AT commands, including complete list of SMS AT commands on Nokia's GSM and WCDMA products.

Image:At_command_sms.jpg

Message Format

There are basically two modes to work with SMS, i.e.:

  • PDU (Protocol Data Unit)
  • Text mode.

A mobile phone internally uses PDU format. Developers normally uses text mode because it is easier to use. AT+CMGF is the command to set the mode.

AT+CMGF=0

sets the format to PDU mode.

AT+CMGF=1

sets the format to text mode.

AT+CMGF?

queries the current format.

Sending SMS

Although you can send SMS in PDU or text mode, it is easier to use text mode to type the message.

The following commands change the message format to text mode and send a text message.

AT+CMGF=1
OK
AT+CMGS="7789952010"
> Hello World�<Ctrl>+<Z>
+CMGS: 44
 
OK

Note that <Ctrl>+<Z> has to be entered at the end of message to send the message.

Reading SMS

Use the following command to read the list of all messages on the phone:

AT+CMGL="ALL"
+CMGL: 123,"REC READ","+123456789"
Hello World
 
 
OK

Use the following command to read a message with has index of 123:

AT+CMGR=123
+CMGR: "REC READ","+17789975545","08/09/05,17:46:49-12"
Hello World
 
OK

Links

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fSocketE5fcodeE5fforE5festablishingE5fconnectionE5fbetweenE5ftwoE5femulatorsE5fonE5fdifferentE5fmachineX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZconnectivityQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxconnectivityX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ