1.1 Introduction to Interface between TE and MS--------------------------------------------- 2
1.2 Initial the Test Environment--------------------------------------------------------------------- 5
1.3 How to Handle SMS messages----------------------------------------------------------------- 5
2. IMPLEMENTED AT COMMANDS FOR MS-------------------------------- 11
2.1 Commands specified by GSM REC.27.07--------------------------------------------------11
2.1.1 General Commands--------------------------------------------------------------------------------------- 11
Request manufacturer identification +CGMI-----------------------------------------------------------------------------11
Request model identification +CGMM ------------------------------------------------------------------------------------ 11
Request revision identification +CGMR-----------------------------------------------------------------------------------12
Request product serial number identification +CGSN ----------------------------------------------------- ------- ---- 12
Select TE character set +CSCS-------------------------------------------------------------------------------------------- 13
Request international mobile subscriber identity +CIMI -------------------------------------------------------------- 15
Multiplexing mode +CMUX--------------------------------------------------------------------------------------------------- 16
PCCA STD-101[17] select wireless network +WS46 ----------------------------------------------------------------- 20
2.1.2 Call control commands----------------------------------------------------------------------------------- 21
Select Type of Address +CSTA---------------------------------------------------------------------------------------------21
Call mode +CMOD------------------------------------------------------------------------------------------------------------- 22
Hang up call +CHUP ----------------------------------------------------------------------------------------------------------23
Select bearer service type +CBST-----------------------------------------------------------------------------------------23
Radio link protocol +CRLP---------------------------------------------------------------------------------------------------25
Service reporting control +CR-----------------------------------------------------------------------------------------------26
Extended error report +CEER-----------------------------------------------------------------------------------------------27
Cellular result codes +CRC--------------------------------------------------------------------------------------------------28
Single numbering scheme +CSNS ----------------------------------------------------------------------------------------30
Dial command D----------------------------------------------------------------------------------------------------------------31
2.1.3 Network service related commands------------------------------------------------------------------- 32
Facility Lock AT+CLCK --------------------------------------------------------- ------- ------- ------- -------------------------38
Change password +CPWD ------------------------------------------------------------------ ------- ------- ------- ------- ---- 40
Calling line identification presentation +CLIP --------------------------------------------------------------------------- 41
Call line identification restriction +CLIR----------------------------------------------------------------------------------- 42
Connected line identification presentation +COLP---------------------------------------------------------------------44
Closed user group +CCUG --------------------------------------------------------------------------------------------------45
Call forwarding service +CCFC---------------------------------------------------------------------------------------------47
Call waiting service +CCWA------------------------------------------------------------------------------------------------- 49
Short string procedure AT+CHLD------------------------------------------------------------------------------------------51
Unstructured supplementary service data +CUSD---------------------------------------------------------------------53
Advice of Charge +CAOC---------------------------------------------------------------------------------------------------- 55
Supplementary service notifications +CSSN---------------------------------------------------------------------------- 56
Preferred PLMN list +CPOL -------------------------------------------------------------------------------------------------59
List current calls +CLCC---------------------- ------- ------ ------------------------------------------------------------------- 61
Read operator names +COPN---------------------------------------------------------------------------------------------- 62
Get neighbor cells +GNC----------------------------------------------------------------------------------------------------- 63
Automatic Time Zone Update +CTZU ------------------------------------------------------------------------------------64
2.1.4 Mobile control and status commands----------------------------------------------------------------- 65
Phone activity status +CPAS------------------------------------------------------------------------------------------------ 65
Set phone functionality +CFUN---------------------------------------------------------------------------------------------66
Enter PIN +CPIN ---------------------------------------------------------------------------------------------------------------67
Battery charge +CBC------------------- ------- -------------------------------------------------------------------------------- 69
Signal quality +CSQ ----------------------------------------------------------------------------------------------------------- 69
Restricted SIM access +CRSM ------ ------ ------- ------- ------------------------------------------------------------------- 71
Ringer sound level and ringer type select +CRSL ---------------------------------------------------------------------73
Loudspeaker volume level +CLVL -----------------------------------------------------------------------------------------73
Mute +CMUT -------------------------------------------------------------------------------------------------------------------- 74
Accumulated call meter +CACM -------------------------------------------------------------------------------------------75
Accumulated call meter maximum +CAMM----------------------------------------------------------------------------- 76
Price per unit and currency table +CPUC--------------------------------------------------------------------------------77
Call Meter maximum event +CCWE--------------------------------------------------------------------------------------- 78
Set Voice Mail Number +CSVM --------------------------------------------------------------------------------------------79
List all available AT commands +CLAC ----------------------------------------------------------------------------------80
2.1.5 Commands related with phonebook service-------------------------------------------------------- 81
2.1.6 Commands from TIA IS-101---------------------------------------------------------------------------- 88
Select mode +FCLASS -------------------------------------------------------------------------------------------------------88
DTMF and tone generation +VTS------------------------------------------------------------------------------------------89
Play DTMF tone +WDTMF---------------------------------------------------------------------------------------------------90
Receive gain selection +VGR----------------------------------------------------------------------------------------------- 91
Transmit gain selection +VGT-----------------------------------------------------------------------------------------------91
2.2 Commands related to short message service--------------------------------------------93
2.2.1 General Configuration Commands-------------------------------------------------------------------- 97
Select Message Service +CSMS------------------------------------------------------------------------------------------- 97
Preferred Message Storage +CPMS---------------------------------- ------- ------- ------- ------ -------------------------98
Message Format +CMGF ---------------------------------------------------------------------------------------------------- 99
Service Centre Address +CSCA------------------------------------------------------------------------------------------ 100
Set Text Mode Parameters +CSMP------------------------------------------------------------------------------------- 101
Show Text Mode Parameters +CSDH ---------------------------------------------------------------------------------- 103
Select Cell Broadcast Message Types +CSCB----------------------------------------------------------------------- 104
Save Settings +CSAS------------------------------------------------------------------------------------------------------- 105
Restore Settings +CRES--------------------------------------------------------------------------------------------------- 106
2.2.3 Message Receiving and Reading Commands----------------------------------------------------107
New Message Indications to TE +CNMI-------------------------------------------------------------------------------- 107
List Messages +CMGL------------------------------------------------------------------------------------------------------ 111
Read Message +CMGR ---------------------------------------------------------------------------------------------------- 112
NEW Message Acknowledgement to ME/TA +CNMA ---- ------- ------- ------- ------------------------------------- 114
2.2.4 Message Sending and Writing Commands--------------------------------------------------------115
2.4.3 Service Commands --------------------------------------------------------------------------------------183
Service Class +FCLASS---------------------------------------------------------------------------------------------------- 183
DCE Capabilities Parameter +FCC-------------------------------------------------------------------------------------- 184
Current Session Parameter +FIS----------------------------------------------------------------------------------------- 185
Current Session Result +FCS--------------------------------------------------------------------------------------------- 186
Local Facsimile Station ID String +FLI---------------------------------------------------------------------------------- 186
Local polling ID String +FPI------------------------------------------------------------------------------------------------ 187
Non-Standard Frame FIF Octet String +FNS ------------------------------------------------------------------------- 188
Indicate Document to Poll +FLP ----- ------- ------------------------------------------------------------------------------ 189
In order to communicate each other between TE and MS, we must use AT
commands. Figure 1.1 illustrates the interface. In section 2, we will divide the content into
ten subsections. They are about SIM, list management, mobility management, call control,
supplementary service, short message, cell broadcast, base-band and the other service.
AT COMMAND
TEMS
Figure 1.1
Explanation
ME Mobile equipment
MS Mobile station. Basically, a mobile station is mobile
equipment with a SIM card.
TE Terminal Equipment that is the same as the controller in
this case.
Getting started
For testing AT commands, the MS can be connected to any computer environment,
as long as it has a V.24/V.28 serial interface. The commands can be issued with, for
example, HyperTerminal in Microsoft Windows or other emulator programs.
Syntax description
The section gives a brief description of the syntax used for the command set. The MS
may echo characters received, depending on the setting of the command E. As a default,
echo is enabled, and characters are echoed at the same rate, parity, and format as
received.
The character defined by parameter S5 (default, BS, IRA 8) is interpreted as request from
the TE to delete the previous character.
<CR> Carriage return character, whose value is specified by
command S3, default IRA 13.
<LF> Line feed character, whose value is specified by
command S4, default IRA 10.
<…>
The name enclosed in angle brackets is a syntactical
element. The brackets do not appear in the command
line.
[…]
Strings enclosed in square brackets are optional items
(sub-parameters). The brackets do not appear in the
command line.
Other characters, including ‘?’,’=’, parentheses, etc, appear in commands and
response as written.
AT command syntax
A command line is made up of three elements: the prefix, the body and the
termination character. The command line prefix consists of the characters ‘AT’.
MS supports a set of commands referred to as basic syntax commands, and a set of
extended syntax commands, the latter prefixed with a plus sign (+).
Basic syntax command
The format of basic syntax commands, except for the command D, is as follows:
<name>[<value>]
Example: ATV1<CR> (set text form result codes)
<CR><LF>OK<CR><LF>(response)
Extended syntax command
+<name>[=<value>]
Example: AT+CMUT=0<CR>( the representation of signal strength)
<CR><LF>OK<CR><LF>(response)
Test command syntax
Example: AT+CACM?<CR>(show current accumulated call meter value)
<CR><LF>+CACM: ”0”<CR><LF>(response)
<CR><LF>OK<CR><LF>
If the indicated name is not recognized, an Error code is issued.
AT response syntax
The default response is text mode that is shown below. See the command V for
further details. The format of a response is as follows:
<CR><LF>[<response>]<CR><LF>
The <response> can be:
‧Basic format result code, such as OK.
‧Extended syntax result code, prefixed with a plus sign (+) :
+<name>: <value>
The result codes are separate by commas if it’s included several values. The <value>
followed by the colon is separated by a space. It is also possible that result codes have
no value. Unlike basic format result codes, extended syntax result codes have no
numeric equivalent, and are always issued in alphabetic form.
There are two types of result code responses:
Final result code
A final result code indicates to the TE that execution of the command is completed
and another command may be issued.
If you typed an implemented AT command, you should get the result code OK.
If you typed an AT command that was not implemented, or which had the wrong
parameter or syntax, you will get the result code ERROR or else, for example, +CME
ERROR followed by an error code.
Unsolicited result code
Unsolicited result codes, such as RING, indicate the occurrence of an event not
directly associated with a command being issued from TE.
-Initial the connection port with 115200 bps and none flow control
Initial the MS.
-Put the SIM card into ME and power on the ME.
-Start all of AT Commands with “AT+CFUN=1”
-Camp on the cell with “AT+COPS=0”
1.3 How to Handle SMS messages
This section gives examples of the AT commands for sending and receiving SMS (Short
Messages Service) messages.
Whatever the destination of the SMS message, the message is always sent via a Service
Center (SC). One of the SC’s jobs, among others, is to forward SMS messages to the
destination, or save the SMS until the receiving MS becomes available in the GSM
network. The message can be stored at the SC up to a maximum time period decided by
the sender. Also the message is “time stamped” at the SC and its contents are interpreted
according to choices made by the sender.
The conclusion of this is that an SMS message, along with other information decided upon
by the sender, always contains 2 addresses. First the Service Center Address (SCA), and
then the destination address. Also, other useful information is added at the SC.
Setting Service Center Address (SCA)
The service center address is usually stored on the SIM card, but it can be set manually by
using the AT command AT+CSCA. Note that the SCA must be given in the international
phone number format.
Format of an SMS message
It is important to realize that SMS messages could be sent in two modes: text mode and
PDU mode, which is described in detail in the GSM specifications 3GPP 27.005, 3GPP
23.040 and 3GPP 23.038.
Because text mode is followed the format of input parameters, it is clear to execute the
commands. We now focus on the introduction of PDU mode.
What is PDU mode? First a PDU is a Service Center Address (SCA) followed by a
Transport Protocol Data Unit (TPDU). There are several formats of TPDU, but we now
only use two forms here:
SMS-SUBMIT TPDU Outgoing SMS messages “submitted” to the SM from the
originating MS.
SMS-DELIVER TPDU Incoming SMS mess ages “delivered” by the SC to final
destination MS.
Therefore we have the following general format of an SMS message:
PDU=SCA+TPDU
The TPDU format is a hexadecimal encoded binary format, which means that 2
hexadecimal digits represent a byte or an octet. In general there is a header part of the
TPDU, containing the control information, and the follows user data, which can be any type
of information (default 7-bit GSM alphabet, 8-bit ISO 8859-1 alphabet or even 8-bit data).
Let’s start with some examples of PDU SMS messages using an SMS-SUBMIT type
TPDU. For simplicity’s sake we will send a text message that reads “TEST”, using the
default GSM 7-bit alphabet.
Here is the message written out in full:
0011000B916407861582F50000A704D4E2940A
Equivalently, we could write this as:
07916407058099F911000B916407861582F50000A704D4E2940A
These two have one difference, and that is how we have chosen to describe the SCA. In
the first SMS we use:
00 This is a valid SCA with a length equal to zero. Therefore we are
using the default SCA given by the SIM card, or as given by the
AT command AT+CSCA.
07916407058099F9 Here is the SCA hex encoded binary. The first octet (07) is a
length indicator, in this case there are 7 octets to follow. The
second octet (91) tells us about the numbering plan and type of
number of the coming address. In this case the 91 says that the
address is in international phone number format. Then follows the
actual service center address (6407058099F9). Every pair of
digits is swap, that there is an odd number of digits in the phone
number and therefore, a half byte of fill digits is required at the end
(hence the hexadecimal F9). The exact meaning of all the octets
and fields in the SCA address is described in detail in 3GPP
23.040.
Let’s analyze the message by breaking it down into its component parts:
11 This octet contains many 1-bit and 2-bit fields that are described
in detail in GSM 03.40. These include:
- TP-MTI : message type indicator
- TP-RD : more messages waiting indicator
- TP-VPF : validity period format
- TP-SRR : status report request flag
- TP-UDHI : user data header indicator flag
- TP-RP : reply path setting flag
00 This octet is only associated with the 8-bit field TP-MR and is
basically a message reference number, which can be chosen by
the user. Here we set the message reference number to zero
(00HEX).
0B916407861582F5 This is the destination address (TP-DA). The format of the
address field is given in detail in 3GPP 23.040. It is similar to the
format of the SCA, but now it refers to the phone number of the
receiving MS. The first octet (0B) is a phone number length
indicator. In this case the phone number of the destination MS
consists of 11 digits. The second octet (91) is the numbering
plan and type of number of the coming address. The address is
in international phone number format. Then follows the mobile
number with every pair of digits in reverse order, and because
we have an odd number of digits a half octet of fill bits are
required (hence the F5HEX).
00 This is the protocol ID (TP-PID) which refers to a possible higher
level protocol being used or indicates inter-working with certain
types of telematic devices. This can usually be left set to zero.
00 This is the data coding scheme field (TP-DCS) that is described
in detail in 3GPP 23.038. Basically this octet tells us what kind of
user data is being sent. For instance, if we are using a 7-bit or
8-bit alphabet, or we are sending 8-bit data. It also informs the
receiving MS about the class of the SMS message, which tells it
A7 This is the validity period (TP-VP). The validity period is how
long the SC will store the SMS, waiting for the receiving MS to
come in contact with the GSM network. If the SMS is not
received by the destination MS within this time, then the
message will be discarded. 3GPP 23.040 describes this field in
detail.
04 TP-UDL. This is the length of the user data. It is given in septets,
if TP-DCS describes the message as using the default 7-bit
GSM alphabet, or octets otherwise.
D4E2940A Finally we come to the user data (TP-UD). This is 4-septets
long, defined above in TP-DCS and TP-UDL. The message
reads “TEST”. Note the one character is not represented by one
octet, but by a septet (7-bits), and therefore it can be quite
complicated to decipher a GSM text SMS by looking at the PDU.
3GPP specification 23.038 describes in detail how the 7-bit GSM
alphabet works and how to convert from the hexadecimal to the
characters. You may know that one can send 160 characters in
an SMS message. This is only possible in 140 bytes using a
7-bit alphabet
Before we finish we should also take a look at the TPDU of SMS-DELIVER type. This is
the PDU one would see when reading an SMS that has been sent to the module.
07916407058099F9040B916407861582F500009910702123040004D4E2940A
The TPDU breaks down as follows:
04 TP-MTI, TP-MMS, TP_SRI, TP-UDHI, TP-RP
0B916407861582f5 This is the originating address (TP-OA)
00 TP-PID
00 TP-DCS
99107021230400 This is the service center time stamp. Every pair of digits are
reversed. This time stamp reads, in octets from left to right: the
date 990107 (year, month, day), the time 123240 (hours,
minutes, seconds). Finally the last octet is a reference for the
difference in time between local time and GMT.
04 TP-UDL
D4E2940A TP-UD
The AT command to use is AT+CMGS. Notice that this is the length of the TPDU and not
the PDU, so it does not include the SCA. The length of the message is 4 octets and the
message reads “TEST”.
Example1:
A user would like to send a GSM 7 bit alphabet text “TEST” to number “0910123456”, he
may use
AT+CMGS=17<CR>
>0011000A8190012143650000A704D4E2940A<CTRL-Z>
+CMGS:122 ( depends on the MS)
OK
Reading SMS message from storage
To read SMS messages from storage, the AT commands AT+CMGL and AT+CMGR
should be used.
Example1:
AT+CMGR=1
+CMGR: 1,,23
07916407058099F9040B916407950303F100008921222140140004D4E2940A
OK
Example2:
AT+CMGL=4 The 4 here means “all messages”.
+CMGL: 1,1,23
07916407058099F9040B916407950303F100008921222140140004D4E2940A
+CMGL: 2,1,26
07916407058099F9040B916407950303F10000892122216000000841E190583411E91
+CMGL: 3,1,27
07916407058099F9040B916407950303F10000892122217064000941E19058341E9149
OK
Deleting SMS messages
To delete an SMS message from the selected <mem1>, use the AT+CMGD command.
Once both SM are full, then the module will receive no new messages and SMS messages
will be buffered in the Service Center until the following happens:
z The validity period of the message expires. The validity period is set by TP-VP.
z A message is deleted by using AT+CMGD. An empty memory position becomes
available and the module can receive a new message.
There are other ways to control the storage of SMS messages. In the TPDU field, TP-DCS,
one can set the class of the SMS message. Basically the different SMS classes are as
follows:
Classless SMS (TP-DCS=00hex). This is usually the type sent by a mobile telephone.
They are stored in the available memory.
Class 0 SMS (TP-DCS=F0hex). These are not stored anywhere, but are sent
directly to the telephone display. Since there is no display one can
forward the messages to the TE by means of the AT command
setting AT+CNMI=3,2
Class 1 SMS (TP-DCS=F1hex). These are directed specifically to ME if there is a
memory storage available, otherwise it will be stored in SM.
Class 2 SMS (TP-DCS=F2hex). These are directed specifically to SM.
Class 3 SMS (TP-DCS=F3hex). These messages shall normally be transferred to
the terminal equipment or application, if requested to do so, This is
controlled by the AT command AT+CNMI
For a deeper explanation and more information regarding the different SMS classed and
their use see the 3GPP specification 23.038.
Read serial number identification which determined by ME manufacturer.
Defined values
<sn >: total number of characters shall not exceed 2048 characters.
Informative examples
-Initial the HyperTerminal
-Initial the MS without SIM card
-AT Command
AT+CGSN<CR>
IMEI: 44601919750759-5
IMEISV: 44601919750759-00
OK
Select TE character set +CSCS
Table: +CSCS parameter command syntax
Command Possible response(s)
+CSCS=[<chset>]
+CSCS? +CSCS: <chset>
+CSCS=? +CSCS: (list of supported <chset>s)
Description
Set command informs TA of which character set “<chset>” is used by the TE. TA is then
able to convert character strings correctly between TE and ME character sets.
When TA-TE interface is set to 8-bit operation and used TE alphabet is 7 bit, the highest
bit shall be set to zero.
Read command returns the current setting and test command displays conversion
schemes implemented in the TA.
GSM default alphabet
Character strings consist only of hexadecimal numbers
from 00 to FF;e.g. “032FE6” equals three 8-bit
characters with decimal values 3,47 and 230;no
conversions to the original ME character set shall be
done.
“IRA”
“UCS2”
International reference alphabet
16-bit universal multiple-octet coded character set;
UCS2 character strings are converted to hexadecimal
numbers from 0000 to FFFF. ; e.g. “004100620063”
equals three 16-bit characters with decimal values 65,98
and 99.
“8859-1”
“PCCP437”
“PCDN”
ISO 8859 Latin 1 character set
PC character set Code Page 437
PC Danish/Norwegian character set
Informative examples
-Initial the HyperTerminal
-Initial the MS without SIM card
-AT Command
1.
AT+CSCS=? <CR>
+CSCS: "GSM","IRA","PCCP437","PCDN","8859-1","HEX","UCS2"
OK
2.
AT+CSCS= “GSM”
+CSCS: “GSM”
OK
AT+CSCS? <CR>
+CSCS: “GSM”
OK
+CME ERROR:<err>
t>[,<port_speed>[,<N1>[,
<T1>[,<N2>[,<T2>[,<T3>[,
<k>]]]]]]]]
+CMUX? OK
+CMUX=? +CMUX: (list of supported <mode>s), (list of
supported <subset>s), (list of supported
<port_speed>s), (list of supported <N1>s), (list
of supported <T1>s), (list of supported
<N2>s), (list of supported <T2>s), (list of
supported <T3>s), (list of supported <k>s)
Description
This command is used to enable/disable the GSM 07.10 multiplexing protocol control
channel. Refer to subclause 9.2 for possible <err> values. The AT commands sets
parameters for the Control Channel. If the parameters are left out, the default value is
used.
Read command returns the current mode and the settings.
Test command returns the supported modes and parameters.
It is recommended that the ME/TA/TE should autobaud to the +CMUX command up to
and including an interface speed of 9600 bits/s.
The OK or +CME ERROR: <err> response is returned at the speed of the +CMUX
command prior to entering <mode>.
It is recommended that whenever the multiplexer control channel is released the
ME/TA/TE should assume an interface rate of up to and including 9600 bits/s for auto
baud purposes irrespective of any previous higher speed having been selected.
If a +CMUX command is issued whilst in any multiplexer mode then that +CMUX
command shall be ignored and the ME/TA shall return an +CME ERROR: <err> response.
Defined values
<operation> ( multiplexer Transparency Mechanism)
0 Basic option (not support in current version)
1 Advanced option
<subset>:
This parameter defines the way in which the multiplexer control channel is set up. A
virtual channel may subsequently be set up differently but in the absence of any
negotiation for the setting of a virtual channel, the virtual channel shall be set up according
to the control channel <subset> setting.
0 UIH frames used on l y.
1 UI frames used only.
2 I frames used only.
Default value:0
<N2> (maximum number of re-transmissions):
0-100, where 3 is default
<T2> (response timer for the multiplexer control channel in units of ten milliseconds):
2-255, where 30 is default (300ms)
NOTE: T2 must be longer than T1.
<T3> (wake up response timer in seconds):
1-255, where 10 is default
<k> (window size, for advanced operation with Error Recovery options):
1-7, where 2 is default
Informative examples
-Initial the HyperTerminal
-Initial the M S
-AT Command
AT+CMUX=?
+CMUX: (1),(0),(1-5),(10-100),(1-255),(0-100),(2-255),(1-255),(1-7)
OK