17. AT Command Operations: Test, Set, Read and Execution

There are four types of AT command operations:

The command syntax for performing an operation will be described in detail in the following sections.


17.1. Test Command -- Checks Whether a Certain AT Command is Supported

A test operation is used to check whether a certain AT command is supported by the GSM/GPRS modem or mobile phone. All extended AT commands support the test operation. The syntax is:


command=?


where command is an AT command. When an AT command is used in the above syntax to perform a test operation, it is called a test command.

Here is an example. The AT command +CGMI (command name in text: Request Manufacturer Identification) is used to get the manufacturer name of the GSM/GPRS modem or mobile phone. To test whether +CGMI is supported, you can make use of the test command "+CGMI=?". The complete command line that should be entered is:


AT+CGMI=?


If the GSM/GPRS modem or mobile phone supports the AT command +CGMI, the result code "OK" will be returned, like this:


AT+CGMI=?
OK


If the GSM/GPRS modem or mobile phone does not support the AT command +CGMI, the result code "ERROR" will be returned, like this:


AT+CGMI=?
ERROR


In the above example, the AT command +CGMI does not have any parameters. If the AT command to be tested has parameter(s), the parameter value(s) supported by the GSM/GPRS modem or mobile phone may be printed additionally. Below is an example that illustrates the format of the response. +COMMAND1 is a fictitious AT command that has four parameters.


AT+COMMAND1=?
+COMMAND1: (0,1),(0-10),(0,1,5-10),("GSM","UCS2")

OK


The supported values of each of the four parameters are enclosed in parentheses. Commas are used to delimit the parentheses and the values inside parentheses. A hyphen is used to indicate a range of values. The values inside parentheses can be of the string type.

In the above example, the response of the test command "+COMMAND1=?" provides us the following information:

To a few AT commands, the test operation does not return the parameter values supported. Instead, it returns the values that are allowed to appear in the information response of the AT command. An example is the +CBC AT command (command name in text: Battery Charge). The +CBC command is used to retrieve the connection status and charge level of the battery of the mobile device. Two values are returned in the information response of the +CBC AT command. The format is:


+CBC: connection_status,charge_level


For example, if the battery is placed in the mobile device with no charger connected and the charge level is 80%, the result of the execution of the +CBC AT command will be:


AT+CBC
+CBC: 0,80

OK


If you run the test command "+CBC=?", all the supported values that are allowed to appear in the connection status field and charge level field will be provided. With my Nokia 6021, the result is:


AT+CBC=?
+CBC: (0,1),(0-100)

OK


"(0,1)" means the connection status field in the information response of the +CBC AT command can contain either 0 or 1, while "(0-100)" means the charge level field can contain any integer between 0 and 100.


Previous Page Page 25 of 65 Next Page

Contents at a Glance (Click Here for Full Table of Contents)

Feedback Form (ExpandCollapse)

What do you think about this web page?






(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:

Please enter again to confirm:

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