19.2. Checking if
the AT Commands Required for Sending, Receiving and Reading SMS
Messages are Supported
next thing to do is to check if the AT commands required for sending,
receiving and reading SMS messages are supported by the mobile phone
or GSM/GPRS modem. As pointed out earlier in this SMS tutorial, you
can check if a certain AT command is supported by performing a test
operation. Simply execute an AT command with "=?" attached
at its end. For example, "AT+CMGS=?".
we begin the check, let's go through an overview of the AT commands
that are required for sending, receiving and reading SMS messages.
You will learn which AT commands should be checked and get a general
idea about when these AT commands should be used.
19.2.1. Overview of
the AT Commands Required
Sending SMS Messages
send SMS messages via AT commands, the GSM/GPRS modem or mobile phone
has to support either +CMGS (command name in text: Send Message) or
+CMSS (command name in text: Send Message from Storage). You may also
find +CMGW (command name in text: Write Message to Memory) and +CMGD
(command name in text: Delete Message) useful, since they are
sometimes used together with +CMSS. +CMSS is used to send an SMS
message located in the message storage area. If an SMS message does
not exist in the message storage area, you must first use the AT
command +CMGW to write the SMS message to the message storage area
before you can use the AT command +CMSS to send the SMS message to
the SMSC. After message submission, you may use the AT command +CMGD
to delete the SMS message to free some space from the message storage
Receiving and Reading SMS Messages
receive and read SMS messages via AT commands, the GSM/GPRS modem or
mobile phone has to support the AT command +CNMI (command name in
text: New Message Indications to TE. TE stands for Terminal
Equipment, which is the equipment that controls the GSM/GPRS modem or
mobile phone. For example, a PC / computer), +CMGL (command name in
text: List Messages), or +CMGR (command name in text: Read Messages).
AT command +CNMI is used to specify how newly arrived SMS messages
should be handled. You can tell the GSM/GPRS modem or mobile phone
either to forward newly arrived SMS messages directly to the PC, or
to save them in message storage and then notify the PC about their
locations in message storage.
AT command +CMGL is used to read all SMS messages that have a certain
status (e.g. "received unread", "received read",
etc) from the message storage area, while the AT command +CMGR is
used to read the SMS message saved at a certain location of the
message storage area.
that you've learned the AT commands required for outbound and inbound
SMS messaging are +CMGS, +CMSS, +CNMI, +CMGL and +CMGR. You can begin
the check by performing a test operation with each of the AT
commands. For example, you can execute the command line "AT+CMGS=?"
to check whether +CMGS is supported, like this:
final result code "OK" indicates the AT command +CMGS is
supported. If the GSM/GPRS modem or mobile phone returns the final
result code "ERROR", it means the command is not supported.
quicker way is to copy and paste the following command line to the
terminal program and execute it:
an example, here shows the response returned from my Nokia 6021 to
HyperTerminal after the execution of above command line:
return of the final result code "OK" indicates all AT
commands under test are supported. If the final result code "ERROR"
is returned, it means one or more AT commands are not supported.
Feedback Form (ExpandCollapse)