16. Result
Codes of AT Commands

Result
codes are messages sent from the GSM/GPRS modem or mobile phone to
provide you information about the execution of an AT command and the
occurrence of an event. Two types of result codes are useful to you
when dealing with AT commands for SMS messaging:

Final
result codes

Unsolicited
result codes

16.1. Final Result
Codes of AT Commands

A
final result code marks the end of an AT command response. It is an
indication that the GSM/GPRS modem or mobile phone has finished the
execution of a command line. Two frequently used final result codes
are OK and ERROR. Only one final result code will be returned for
each command line. Thus, you will not see both OK and ERROR in the
response of a command line.

16.1.1. The OK
Final Result Code

The
OK final result code indicates that a command line has been executed
successfully by the GSM/GPRS modem or mobile phone. It always starts
and ends with a carriage return character and a linefeed character.

Here
is an example for illustration. Let's say you send the command line
"AT+CMGL;+CGMI<CR>" to your GSM/GPRS modem.
The AT command "+CMGL" is used to list SMS messages stored
in the message storage area and the AT command "+CGMI" is
used to get the manufacturer name of the GSM/GPRS modem. If
everything works properly without any errors, the command line,
together with the response returned, should be something similar to
this:

As
mentioned earlier, when a terminal program such as HyperTerminal of
Microsoft Windows sees a carriage return character, it moves the
cursor to the beginning of the current line. When it sees a linefeed
character, it moves the cursor to the same position on the next line.
Hence, the command line you entered, together with the response
returned, will be displayed like this in a terminal program such as
HyperTerminal of Microsoft Windows:

16.1.2. The ERROR
Final Result Code

The
ERROR final result code indicates that an error occurs when the
GSM/GPRS modem or mobile phone tries to execute a command line. After
the occurrence of an error, the GSM/GPRS modem or mobile phone will
not process the remaining AT commands in the command-line string.

Below
are some common causes of error:

The
syntax of the command line is incorrect.

The
value specified to a certain parameter is invalid.

The
name of the AT command is spelt incorrectly.

The
GSM/GPRS modem or mobile phone does not support one or more of the
AT commands, command parameters or parameter values in the
command-line string.

Like
the OK final result code, the ERROR final result code always starts
and ends with a carriage return character and a linefeed character.

Here
is an example for illustration. Suppose you want to instruct your
GSM/GPRS modem to list SMS messages from the message storage area and
get the manufacturer name of the GSM/GPRS modem. You intend to type
the command line "AT+CMGL;+CGMI<CR>" but make
a careless mistake by typing "+CMFL" instead of "+CMGL".
The GSM/GPRS modem will return the ERROR final result code, as shown
below:

AT+CMFL;+CGMI<CR><CR><LF>ERROR<CR><LF>

As
an error occurs when the GSM/GPRS modem processes "+CMFL",
the GSM/GPRS modem stops the execution of the command line and so the
second AT command "+CGMI" is not processed.

If
you type the second AT command "+CGMI" incorrectly instead
of the first AT command "+CMGL", the GSM/GPRS modem will
output the result of the execution of the AT command "+CMGL"
before outputting the ERROR final result code, like this:

As
mentioned earlier, when a terminal program such as HyperTerminal of
Microsoft Windows sees a carriage return character, it moves the
cursor to the beginning of the current line. When it sees a linefeed
character, it moves the cursor to the same position on the next line.
Hence, the command line you entered, together with the response
returned, will be displayed like this in a terminal program such as
HyperTerminal of Microsoft Windows:

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.