SMS Command

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

U10

Quectel Cellular Engine

U10 SMS
Application Note
U10_SMS_Application_Note_V1.0
U10 SMS Application Note

Document Title: U10 SMS Application Note

Revision: 1.0

Date: 2012-04-13

Status: Released

Document Control ID: U10_SMS_Application_Note_V1.0

General Notes

t e l
c l
Quectel offers this information as a service to its customers, to support application and

a
engineering efforts that use the products designed by Quectel. The information provided is

e i
based upon requirements specifically provided for Quectel by the customers. Quectel has not

u t
undertaken any independent search for additional relevant information, including any

n
information that may be in the customer’s possession. Furthermore, system validation of this
product designed by Quectel within a larger electronic system remains the responsibility of

Q ide
the customer or the customer’s system integrator. All specifications supplied herein are
subject to change.

f
Copyright

n
This document contains proprietary technical information which is the property of Quectel
Limited. The copying of this document, distribution to others, and communication of the

o
contents thereof, are forbidden without express authority. Offenders are liable to the payment
of damages. All rights are reserved in the event of a patent grant or registration of a utility

C
model or design. All specification supplied herein are subject to change without notice at any
time.

Copyright © Quectel Wireless Solutions Co. Ltd. 2012

U10_SMS_Application_Note_V1.0 -1-
U10 SMS Application Note

Contents

Contents ............................................................................................................................................ 2
Table Index........................................................................................................................................ 4
0. Revision history ............................................................................................................................ 6
1. Introduction ................................................................................................................................... 7
1.1. Reference ..................................................................................................................................... 7
1.2. Overview ...................................................................................................................................... 9

l
1.2.1.Select SMS Message Format (+CMGF) ............................................................................ 10

e
1.2.2. Select TE Character Set (+CSCS) ..................................................................................... 10

t
1.2.3. Set service center address (+CSCA) ................................................................................. 11

l
1.2.4. Set preferred message storage (+CPMS) .......................................................................... 12

c
2. SMS in text mode ........................................................................................................................ 13

e i a
2.1. Write and send short message ................................................................................................... 13

t
2.1.1. Set text mode parameter (+CSMP) ................................................................................... 13

u
2.1.2. Send message directly from terminal (+CMGS) .............................................................. 14

n
2.1.3. Write short message to storage (+CMGW) ...................................................................... 14

Q ide
2.1.4. Send short message from storage (+CMSS) ..................................................................... 15
2.2. Receive and read short message ............................................................................................... 15
2.2.1. Show text mode parameters (+CSDH) ............................................................................. 16

f
2.2.2. New message indication (+CNMI) ................................................................................... 16
2.2.3. Read short message (+CMGR).......................................................................................... 18

n
2.2.4. List short messages from preferred storage (+CMGL) .................................................... 19

o
2.3. Status report ............................................................................................................................... 20
2.4. Delete short messages ............................................................................................................... 21

C
2.4.1. Delete One or all Short Message (+CMGD) .................................................................... 21
2.4.2. Delete all short messages (+QMGDA) ............................................................................. 21
2.5. Examples in text mode .............................................................................................................. 22
2.5.1. Send English short message(GSM coding) and not require status report ...................... 22
2.5.2. Send Chinese short message(UCS2 coding) and require status report ........................... 25
3. SMS in PDU mode ...................................................................................................................... 27
3.1. Write and Send Short Message ................................................................................................. 27
3.1.1. Send Message direct from Terminal (+CMGS)................................................................ 27
3.1.2. Write short message to storage (+CMGW) ...................................................................... 27
3.2. Receive and read short message ............................................................................................... 28
3.2.1. Read Short Messages (+CMGR) ....................................................................................... 28
3.2.2. List short messages from preferred storage (+CMGL) .................................................... 28
3.3. Status report ............................................................................................................................... 29
3.4. Delete short messages ............................................................................................................... 29
3.5. Basic elements of the PDU ....................................................................................................... 29
3.5.1. SMS-Submit PDU packet (MO)........................................................................................ 30
3.5.2. SMS-Deliver PDU packet (MT)........................................................................................ 30
3.5.3. SMS-Status Report Packet ................................................................................................. 30
3.5.4. Element descriptions .......................................................................................................... 30
U10_SMS_Application_Note_V1.0 -2-
U10 SMS Application Notes

3.6. Examples in PDU mode ............................................................................................................ 36


3.6.1. Send English short message(GSM coding) and not require status report ...................... 37
3.6.2. Send Chinese short message(UCS2 coding) and require status report ........................... 39
4. Other Commands with SMS ....................................................................................................... 43
4.1. Save and restore SMS settings .................................................................................................. 43
4.1.1. Save SMS settings (+CSAS) ............................................................................................. 43
4.1.2. Restore SMS Settings (+CRES) ........................................................................................ 43
4.1.3. Save other settings.............................................................................................................. 43
4.2. Store Class 0 SMS to <mem3> when received Class 0 SMS (+QCLASS0)......................... 44

l
4.3. Notify SMS is full (+QEXTUNSOL) ...................................................................................... 45
5. Appendix ..................................................................................................................................... 47

e
5.1. Message service send and write procedures ............................................................................ 47

t
5.2. Message receiving procedures .................................................................................................. 48

c l
5.3. Default GSM alphabet............................................................................................................... 48

u e t i a
Q ide n
n f
C o

U10_SMS_Application_Note_V1.0 -3-
U10 SMS Application Notes

Table Index

TABLE 1: REFERENCE................................................................................................................... 7
TABLE 2: RELATED AT COMMANDS .......................................................................................... 7
TABLE 3: TERMS AND ABBREVIATIONS................................................................................... 8
TABLE 4:TYPES OF AT COMMANDS AND RESPONSES .......................................................... 9
TABLE 5: AT+CMGF SYNTAX .................................................................................................... 10
TABLE 6: AT+CSCS SYNTAX ...................................................................................................... 10

l
TABLE 7: AT+CSCA SYNTAX...................................................................................................... 11

e
TABLE 8: AT+CPMS SYNTAX ..................................................................................................... 12

t
TABLE 9: AT+CSMP SYNTAX IN TEXT MODE ......................................................................... 13

l
TABLE 10: AT+CMGS SYNTAX IN TEXT MODE ...................................................................... 14

c
TABLE 11: AT+CMGW SYNTAX IN TEXT MODE..................................................................... 14

e i a
TABLE 13: AT+CSDH SYNTAX IN TEXT MODE....................................................................... 16

t
TABLE 14: AT+CNMI SYNTAX ................................................................................................... 16

u
TABLE 15: AT+CMGR SYNTAX IN TEXT MODE ..................................................................... 18

n
TABLE 16:: AT+CMGL SYNTAX IN TEXT MODE ..................................................................... 19

Q ide
TABLE 17: AT+CMGD SYNTAX.................................................................................................. 21
TABLE 18: AT+QMGDA SYNTAX IN TEXT MODE .................................................................. 21
TABLE 19: AT+CMGS SYNTAX IN PDU MODE ........................................................................ 27

f
TABLE 20: AT+CMGW SYNTAX IN PDU MODE....................................................................... 27
TABLE 21: AT+CMGR SYNTAX IN PDU MODE........................................................................ 28

n
TABLE 22: AT+CMGL SYNTAX IN PDU MODE ........................................................................ 28

o
TABLE 23: SMS-SUBMIT PACKET ............................................................................................. 30
TABLE 24: SMS-DELIVER PACKET ........................................................................................... 30

C
TABLE 25: STATUS-REPORT PACKET ....................................................................................... 30
TABLE 26: <TOA> ......................................................................................................................... 30
TABLE 27: <SCA> ......................................................................................................................... 31
TABLE 28: <OA>/<DA>/<RA>..................................................................................................... 31
TABLE 29: <FO> ELEMENTS ...................................................................................................... 32
TABLE 30: <PID> .......................................................................................................................... 33
TABLE 31:<DCS> .......................................................................................................................... 33
TABLE 32: <VP> RELATIVE FORMAT ....................................................................................... 35
TABLE 33: <SCTS> ....................................................................................................................... 35
TABLE 34: AT+CSAS SYNTAX .................................................................................................... 43
TABLE 35: AT+CRES SYNTAX .................................................................................................... 43
TABLE 36: AT+QCLASS0 SYNTAX............................................................................................. 44

U10_SMS_Application_Note_V1.0 -4-
U10 SMS Application Notes

Figure Index

FIGURE 1: <MODE> PARAMETER ............................................................................................. 17


FIGURE 2: MESSAGE SERVICE SEND AND WRITE PROCEDURES ..................................... 47
FIGURE 3: MESSAGE RECEIVING PROCEDURES .................................................................. 48
FIGURE 4: DEFAULT GSM ALPHABET ..................................................................................... 49

t e l
e c i al
u n t
Q ide
n f
C o

U10_SMS_Application_Note_V1.0 -5-
U10 SMS Application Notes

0. Revision history

Revision Date Author Description


1.0 2012-03-23 Joanna Li Initial

t e l
e c i al
u n t
Q ide
n f
C o

U10_SMS_Application_Note_V1.0 -6-
U10 SMS Application Note

1. Introduction

This document describes how to use Point to Point Short Message Service (SMS) through Hyper
Terminal by AT commands which Quectel’s module provides. The Cell Broadcast Service (CBS)
is not included in this document.

1.1. Reference

l
Table 1: Reference

e
SN Document name Remark

t
[1] U10_ATC U10 AT Commands Set

c l
[2] 3GPP TS 27.005 (GSM 07.05) Equipment interface for SMS and CBS

a
[3] 3GPP TS 23.038 (GSM 03.38) Alphabets and language-specific information

e i
[4] 3GPP TS 23.040 (GSM 03.40) Technical realization of the Short Message Service

u t
[5] 3GPP TS 27.007 (GSM 07.07) AT commands set for WCDMA Mobile Equipment

n
(ME)

Q ide
[6] 3GPP TS 24.011 (GSM 04.11) PP SMS support on mobile radio interface
[7] 3GPP TS 24.008 (GSM 04.08) Mobile radio interface Layer 3 specification; Core
network protocols; Stage 3

n f
Table 2: Related AT commands

o
AT command Description Reference
AT+CMGF SELECT SMS MESSAGE FORMAT 3GPP TS 27.005

C
AT+CSCS SELECT TE CHARACTER SET 3GPP TS 27.007
AT+CSCA SMS SERVICE CENTER ADDRESS 3GPP TS 27.005
AT+CSMP SET SMS TEXT MODE PARAMETERS 3GPP TS 27.005
AT+CNMI NEW SMS MESSAGE INDICATIONS 3GPP TS 27.005
AT+CMGW WRITE SMS MESSAGE TO MEMORY 3GPP TS 27.005
AT+CMSS SEND SMS MESSAGE FROM STORAGE 3GPP TS 27.005
AT+CMGS SEND SMS MESSAGE 3GPP TS 27.005
AT+CMGR READ SMS MESSAGE 3GPP TS 27.005
LIST SMS MESSAGES FROM PREFERRED 3GPP TS 27.005
AT+CMGL
STORE
AT+CMGD DELETE SMS MESSAGE 3GPP TS 27.005
AT+QMGDA DELETE ALL SMS MESSAGES Quectel defined
AT+CSDH SHOW SMS TEXT MODE PARAMETERS 3GPP TS 27.005
AT+CSAS SAVE SMS SETTINGS 3GPP TS 27.005
AT+CRES RESTORE SMS SETTINGS 3GPP TS 27.005
AT+CPMS PREFERRED SMS MESSAGE STORAGE 3GPP TS 27.005
STORE CLASS 0 SMS TO SIM WHEN Quectel defined
AT+QCLASS0
RECEIVED CLASS 0 SMS

U10_SMS_Application_Note_V1.0 -7-
U10 SMS Application Notes

ENABLE/DISABLE PROPRIETARY Quectel defined


AT+QEXTUNSOL
UNSOLICITED INDICATIONS

Table 3: Terms and abbreviations

Abbreviation Description
SMS Short Message Service
SME Short Message Entity
SMSC/SC Short Message Service Center

l
MO Mobile Originated

e
MT Mobile Terminated

t
ME Mobile Equipment

c l
MS Mobile Station, Mobile Equipment plus a SIM card

a
TE Terminal Equipment

e i
TA Terminal Adaptor

u t
PDU Protocol Data Unit

n
TP Transfer Layer Protocol

Q ide
URC Unsolicited Result Code
TOA Type of Address
TON Type of Number

f
NPI Numbering Plan Identification
FO First Octet

n
MR Message Reference

o
OA Originator Address
DA Destination Address

C
RA Recipient Address
PID Protocol Identifier
DCS Data Coding Scheme. Refer to [3]3GPP TS 23.038 (GSM 03.38)
SCTS Service Center Time Stamp
DT Discharge Time
VP Validity Period
VPF Validity Period Format
UDL User Data Length
UD User Data
UDHI User Data Header Indicator
RP Reply Path
SRI Status Report Indication
SRR Status Report Request
SRQ Status Report Qualifier
RD Reject Duplicate
ST Status
PI Parameter Identifier
MTI Message Type Indicator

U10_SMS_Application_Note_V1.0 -8-
U10 SMS Application Notes

MMS More Messages to Send


&b Binary Format
&h Hexadecimal Format
&d Decimal Format

1.2. Overview

The SMS provides a way to transfer short messages between Mobile Stations (MS) via a Service

l
Center (SC). The SMS service comprises three basic services:
 SMS-Submit (SM-Mobile Originated): the module sends a SM to the SC.

e
 SMS-Deliver (SM-Mobile Terminated): the module receives a SM from the SC.

t
 SMS Status Report: the message which indicates whether a MO message is received by

c l
destination address correctly.

e t i a
Note:

u
Preparation before using Hyper Terminal:

Q ide n
1. Connect the EVB of the module to PC through a serial cable.
2. Start the Hyper Terminal procedure on the computer, and set the same baud rate as the
module’s. (Default is autobauding for module).
3. Make sure the Quectel module and the SIM card are assembled on EVB, then power on the

f
module.

n
Table 4:Types of AT Commands and responses

o
Test Command AT+<x>=? This command returns the list of parameters and

C
value ranges set with the corresponding Write
Command or by internal processes.
Read Command AT+<x>? This command returns the currently set value of the
parameter or parameters.
Write Command AT+<x>=<…> This command sets the user-definable parameter
values.

 AT commands are case-insensitive, but the parameters may be case-sensitive. And press
Enter (<CR>) to execute command.
 In the examples of this document, the blue text are the commands or parameters which user
should input in Hyper Terminal, and text after “//” are descriptions, others are responses for
your input or URC.
 Possible response maybe ERROR, +CME ERROR: <err>, or +CMS ERROR: <err>.
Please refer to the document [1] Uxx_ATC document for the meaning of error code <err>.

U10_SMS_Application_Note_V1.0 -9-
U10 SMS Application Notes

1.2.1. Select SMS Message Format (+CMGF)

There are two modes when using AT commands to send, receive, list, read and write message: text
mode and PDU mode. In text mode, you can write your message as text and set parameters for
sending and receiving by some AT commands. In PDU mode, you must write your messages in
fixed hexadecimal format, of which parameters are included in the PDU package.

The mode sets by command AT+CMGF. See table below.

Table 5: AT+CMGF Syntax

l
Command Possible Response Example Comment

t e
+CMGF: (list of supported
AT+CMGF=? +CMGF: (0,1) List of supported modes

l
<mode>s)

c
AT+CMGF? +CMGF: <mode> +CMGF: 0 Return current mode

e i a
AT+CMGF=< AT+CMGF=0 Set PDU mode. It is default.
OK

t
mode> AT+CMGF=1 Set Text mode

u n
Section 2 introduces how to send and read SM and status report in text mode. Section 3 introduces

Q ide
AT commands in PDU mode. Section 4 introduces other AT commands related with SM.

f
1.2.2. Select TE Character Set (+CSCS)

n
AT+CSCS sets character set <chset> used by the TE. The TA can then convert character strings
correctly between the TE and ME. The character set will affect transmission and reception of

o
SMS.

C
Table 1: AT+CSCS Syntax

Command Possible Response Example


+CSCS:
+CSCS: (list of
AT+CSCS=? ("GSM","HEX","IRA","PCCP437","UCS2","
supported <chset>s)
8859-1")
AT+CSCS? +CSCS: <chset> +CSCS: "GSM" (default)
AT+CSCS="GSM"
AT+CSCS=<chset> OK
OK

Parameter <chset>
GSM default alphabet, 7-bit coded ([3]3GPP TS 23.038 (GSM 03.38) subclause
"GSM"
6.2.1, or Appendix 5.3 in this document).
"HEX" Character strings consist only of hexadecimal numbers from 00 to FF.
"IRA" International reference alphabet (ITU-T T.50)
"PCCP437" PC character set Code
UCS2 alphabet. 16-bit universal multiple-octet coded character set (ISO/IEC
"UCS2"
10646)

U10_SMS_Application_Note_V1.0 - 10 -
U10 SMS Application Notes

"8859-1" ISO 8859 Latin 1 character set

Note:
 For English message, recommended to select “GSM” in most cases. And for other
languages, it’s better to select “UCS2”. Unicode of characters can be found easily by some
tools, for example, Windows charmap.exe, or Excel Symbol dialog. Please go to unicode.org
for more information about Unicode and UCS2. Also you can find mappings from
GSM/PCCP437/8859-1 to unicode.

l
1.2.3. Set service center address (+CSCA)

t e
Service Center (SC) is responsible for the relaying and store-and-forwarding of a short message.

c l
To use the SMS function, you have to declare the number of the SMSC in the MS (Mobile
Station). However, SMSC is provided by network provider, and saved in SIM card as factory

e i a
setting. It is highly recommended that you do NOT change it at any time. And it’s better to

t
check it before sending short message.

Command
u
Q ide
AT+CSCA=?
n
Table 2: AT+CSCA Syntax

Possible Response
OK

f
AT+CSCA? +CSCA: <sca>,<tosca>

n
AT+CSCA=<sca>[,<tosca>] OK

o
Parameters:

C
<sca> SC Address in string format
<tosca> Type of SCA in integer format

<tosca> uses <TOA> (Type of Address) decimal format (see [4] 3GPP TS 23.040 (GSM 03.40)
sub clause 9.1.2.5).

Example:
AT+CSCS?
+CSCS: "GSM"

OK
AT+CSCA?
+CSCA: "+8613010314500",145

OK
AT+CSCS="UCS2"
OK
AT+CSCA?
+CSCA: "002B0038003600310033003000310030003300310034003500300030",145
U10_SMS_Application_Note_V1.0 - 11 -
U10 SMS Application Notes

OK

Note:
 Recommended to store every address in International numbering format to avoid problems
while roaming.
 Ask your local network provider for the right SMSC number.
 It is highly recommended that you do NOT change it at any time. And it’s better to check it
before sending short message.

e l
1.2.4. Set preferred message storage (+CPMS)

c t l
AT+CPMS selects memory storages used for reading, writing, receiving and etc.

e t i a
Table 3: AT+CPMS Syntax

u
Command Possible Response Example

n
+CPMS: (list of supported <mem1>s),(list +CPMS: ("SM", "ME", "MT"),

Q ide
AT+CPMS=
of supported <mem2>s) ,(list of supported ("SM", "ME", "MT"), ("SM",
?
<mem3>s) "ME", "MT")
+CPMS: +CPMS:

f
AT+CPMS? <mem1>,<used1>,<total1>,<mem2>,<use "SM",10,50,"SM",10,50,"SM",10

n
d2>,<total2>,<mem3>,<used3>,<total3> ,50
AT+CPMS=

o
+CPMS:
<mem1>[,<
<used1>,<total1>,<used2>,<total2>,<used
mem2>[,<me
3>,<total3>

C
m3>]]

Parameters
<mem1>/<mem2>/<mem3> Memory storage <memx>:
Messages to be read and deleted from <mem1>.
Messages will be written and sent to <mem2>.
Received messages will be placed in <mem3> if routing to PC is
not set (see +CNMI)
<memx>'s value can be storage of “SM” (SIM), “ME”, or
“MT”(SM+ME).
<used1>/<used2>/<used3> Number of messages currently stored in <memx> in integer
format
<total1>/<total2>/<total4> Maximum number of messages that can be stored in <memx> in
integer format

Note:
 The maximum number of short messages is 650, and the maximum number in SIM card is
200, and the number in the module is 450.

U10_SMS_Application_Note_V1.0 - 12 -
U10 SMS Application Notes

2. SMS in text mode

2.1. Write and send short message

Two methods can be used to send a short message. The first method is to send message directly by
+CMGS, the second is to write message to storage (+CMGW), then forward it to destination by
+CMSS. Before sending short message, some parameters should be set by AT command +CSMP.

e l
2.1.1. Set text mode parameter (+CSMP)

c t l l
AT+CSMP sets SMS parameters for text mode.

e t e i al
t
Table 4: AT+CSMP Syntax in text mode

u c i a
n
Command Possible Response Example

AT+CSMP=?

e
QQ iddeen
u t
+CSMP: (list of supported <fo>s),(list of
supported <vp>s),(list of supported
<pid>s),(list of supported <dcs>s)
+CSMP:
(17,49),(0-255),(0-255),(0-
255)

f
AT+CSMP? +CSMP: <fo>,<vp>,<pid>,<dcs> +CSMP: 17,71,0,0

n i
AT+CSMP=[<fo>[,

o f
<vp>[,pid>[,<dcs>]] OK

n
]]

C o
Recommended <+CSCS> and <dcs> in text mode:

C
Store message

Immediately display
message and DO not
English
+CSCS="GSM"
<dcs>=0

+CSCS="GSM"
<dcs>=240
other language
+CSCS="UCS2"
<dcs>=25

+CSCS="UCS2"
<dcs>=24
store message

Note:
 When writing message, +CSCS and <dcs> should match each other. For example, if you
select UCS2 character set by +CSCS, but set 7-bit coding schema in <dcs>, then messy code
may be gotten by SMS receiver.
 The meaning of parameter <fo>,<vp>,<pid>,<dcs> is the same as which is in the PDU
mode. Their value and meaning are listed in the following section 3.5:Basic elements of the
PDU. And the difference is that decimal format is used in the parameters of +CSMP in text
mode while hexadecimal format is used in PDU mode.

U10_SMS_Application_Note_V1.0 - 13 -
U10 SMS Application Notes

2.1.2. Send message directly from terminal (+CMGS)

Table 5: AT+CMGS Syntax in text mode

Command Possible Response Example


AT+CMGS=? OK
Send English characters “TEST” to
13795403834:
AT+CSCS=”GSM”

l
AT+CMGS=”13795403834”
AT+CMGS=<da>[,<tod >TEST <Ctrl+Z>

e
+CMGS: <mr>
a>]<CR> Send Chinese characters “ 测 试 ” to

t
or +CMS ERROR:
>text is entered 13795403834:

l
<err>

c
<ctrl-Z/ESC> AT+CSCS=”UCS2”

a
AT+CMGS=”

e i
003100330037003900350034003000330038

u t
00330034”

n
>6D4B8BD5 <Ctrl+Z>

Q ide
Parameters:
<da> [4] 3GPP TS 23.040 (GSM 03.40) TP-Destination-Address in string format

f
<toda> Type of <da> in integer format, see Type Of Address

n
<mr> See below section 3.5 Basic elements of the PDU

o
<Ctrl+Z> (Press Ctrl and Z simultaneously) is used to finish the inputting and begin to send short
message. Esc is used to cancel the operation.

C
Note:
 If +CSCS=”UCS2”, <da> should be input in UCS2 format.

2.1.3. Write short message to storage (+CMGW)

Table 6: AT+CMGW Syntax in text mode

Command Possible Response


AT+CMGW=? OK
AT+CMGW=<oa/da>[,<tooa/toda>[,<stat>]]<CR>
+CMGW: <index>
> <text is entered >
or +CMS ERROR: <err>
<ctrl-Z/ESC>

Parameters:
 <da> <toda> and message text are the same as the AT command +CMGS.
 <stat>: By default message status will be set to “STO UNSENT”, but parameter <stat>
allows “STO SENT” to be given.
U10_SMS_Application_Note_V1.0 - 14 -
U10 SMS Application Notes

The message written by +CMGW will be stored in <mem2> (see +CPMS). The correct write
command will return the index in <mem2>, and then this message can be sent by AT command
+CMSS as below.

2.1.4. Send short message from storage (+CMSS)

Table 7: AT+CMSS Syntax in text mode

Command Possible Response

l
AT+CMSS=? OK
+CMSS: <mr>

t e
AT+CMSS=<index>[,<da>[,<toda>]] OK

l
or +CMS ERROR: <err>

e c i a
Example:

t
AT+CMGW="15021012496"

u
> test <Ctrl+Z>

n
+CMGW: 54 //Write message successfully and the index is 54

Q ide
OK
AT+CMSS=54 //Send message to <da> "15021012496" which is set in CMGW

f
+CMSS: 122

n
OK

o
AT+CMSS=54,"13795403834" //Send message to new <da> "13795403834" instead of the
one stored with the message

C
+CMSS: 123

OK

Note:
 If <da> is given in this command, it shall be used instead of the one stored with the message,
that is, the message will be sent to <da> in this command.
 No difference in PDU mode and text mode for +CMSS.

2.2. Receive and read short message

When short message is received, how to handle it (how to display URC, where to save) will be
decided by AT command +CNMI and message class type defined in <dcs>. User can read message
content from URC or +CMGR/+CMGL if saved. +CSDH will decide which information will be
displayed in text mode.

U10_SMS_Application_Note_V1.0 - 15 -
U10 SMS Application Notes

2.2.1. Show text mode parameters (+CSDH)

Table 8: AT+CSDH Syntax in text mode

Command Possible Response Example


AT+CSDH=? +CSDH: (list of supported <show>s) +CSDH: (0, 1)
AT+CSDH? +CSDH: <show> +CSDH: 0
AT+CSDH=[<show>] OK

l
Parameter <show> value
0 not show (default)

t e
1 show

c l
<show> defines whether to show header values defined in AT commands +CSCA and +CSMP

e i a
(<sca>, <tosca>, <fo>, <vp>, <pid> and <dcs>) nor <length>, <toda> or <tooa> in +CMT,

t
+CMGL, +CMGR result codes for SMS-DELIVERs and SMS-SUBMITs in text mode

u n
Note:

Q ide
 This command only affects text mode.

2.2.2. New message indication (+CNMI)

n f
Table 9: AT+CNMI Syntax

o
Command Possible Response Example
AT+CNMI=? +CNMI: (list of supported <mode>s),(list of +CNMI:

C
supported <mt>s),(list of supported <bm>s),(list of (0-3), (0-3),
supported <ds>s),(list of supported <bfr>s) (0,2,3),
(0,1), (0,1)
AT+CNMI? +CNMI: <mode>,<mt>,<bm>,<ds>,<bfr> +CNMI:
2,1,0,0,0
(default)
AT+CNMI=[<mode>[,< OK
mt>[,<bm> or
[,<ds>[,<bfr>]]]]] ERROR

TA selects the procedure for how the receiving of new messages from the network is indicated to
the TE when TE is active, e.g. DTR signal is ON. If TE is inactive (e.g. DTR signal is OFF),
message receiving should be done as specified in 3GPP TS 23.038.

<mode> controls the processing of URC specified within this command.

<mode> values: refer to the figure below ([2]3GPP TS 27.005 (GSM 07.05) Section 3 Figure 2)

U10_SMS_Application_Note_V1.0 - 16 -
U10 SMS Application Notes

0 Buffer unsolicited result codes in the TA. If TA result code buffer is full, indications can
be buffered in some other place or the oldest indications may be discarded and replaced
with the new received indications.
1 Discard indication and reject new received message unsolicited result codes when
TA-TE link is reserved (e.g. in on-line data mode). Otherwise forward them directly to
the TE.
2 Buffer unsolicited result codes in the TA when TA-TE link is reserved (e.g. in on-line
data mode) and flush them to the TE after reservation. Otherwise forward them directly
to the TE. (Recommended, default)

l
3 Forward unsolicited result codes directly to the TE. TA-TE link specific inband

e
technique used to embed result codes and data when TA is in on-line data mode.

t l
ME

c
received messages and indications <mode> value

e i a
0

t
COMMAND DATA MODE

u
MODE
1

n
TA

Q ide
2

Buffer
3
+CMTI, +CMT, +CBMI, +CBM, +CDSI, +CDS unsolicited result codes

f
TE

n
Figure 1: <mode> parameter

o
<mt> values:

C
The rules for storing received SMs depend on <dcs>, preferred memory storage <mem3> setting
(+CPMS) and this value.

0 No SMS-DELIVER indications are routed to the TE.


1 If SMS-DELIVER is stored into ME/TA, indication of the memory location is routed to
the TE using unsolicited result code: +CMTI: <mem>,<index>
2 SMS-DELIVERs (except class 2) are routed directly to the TE using unsolicited result
code: +CMT: [<alpha>],<length><CR><LF><pdu> (PDU mode enabled)
or
+CMT: <oa>, [<alpha>],<scts>
[,<tooa>,<fo>,<pid>,<dcs>,<sca>,<tosca>,<length>]<CR><LF><data>
(text mode enabled; about parameters in italics, refer to Command Show Text Mode
Parameters +CSDH).
Class 2 messages result in indication as defined in <mt>=1: +CMTI
3 Class 3 SMS-DELIVERs are routed directly to TE using unsolicited result codes defined
in <mt>=2: +CMT
Messages of other classes result in indication as defined in <mt>=1: +CMTI

<bm> value affects CBMs and so it is ignored in this document.


U10_SMS_Application_Note_V1.0 - 17 -
U10 SMS Application Notes

<ds> value sets whether to route SMS-STATUS-REPORT or not


0 No SMS-STATUS-REPORTs are routed to the TE.
1 SMS-STATUS-REPORTs are routed to the TE using unsolicited result code:
+CDS: <length><CR><LF><pdu> (PDU mode enabled)
or
+CDS: <fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st> (Text mode enabled)

<bfr> values:
0 TA buffer of unsolicited result codes defined within this command is flushed to the TE

l
when <mode> 1...3 is entered (OK response shall be given before flushing the codes).
1 TA buffer of unsolicited result codes defined within this command is cleared when

t e
<mode> 1...3 is entered

c l
Note:

e a
 It’s strongly recommended to set <mode> as 2, in this way, the message indication will not

t i
be lost. It’s the default setting.

u
 As to <mt>, if user wants to store the message, set it as 1 (AT+CNMI=2,1 default), then get

n
URC +CMTI: <mem>,<index> and read the message AT+CMGR=<index>. If user wants

Q ide
to read the message directly, set it as 2 (AT+CNMI=2,2), then get the message content from
URC +CMT.
 Please refer to [2]3GPP TS 27.005 (GSM 07.05) Clause 3 Figure 3 or appendix 5.2 in this

f
document for message receiving procedures.

n
2.2.3. Read short message (+CMGR)

o
Table 10: AT+CMGR Syntax in text mode

C
Command Possible Response in Text Mode
AT+CMGR=? OK
AT+CMGR=<in For SMS-DELIVER in Text Mode:
dex>[,<mode>] +CMGR:
<stat>,<oa>,[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<dcs>,<sca>,<tosca>,<l
ength>]<CR><LF><data>
For SMS-SUBMIT in Text Mode:
+CMGR:
<stat>,<da>,[<alpha>][,<toda>,<fo>,<pid>,<dcs>,[<vp>],<sca>,<tosca>,<l
ength>]<CR><LF><data>

TA returns short message with location value <index> from message storage <mem1> (+CPMS)
to the TE.

Integer type; value in the range of location numbers supported by the associated
<index>
memory
Normal. If status of the message is 'received unread', status in the storage
<mode> 0
changes to 'received read'.
U10_SMS_Application_Note_V1.0 - 18 -
U10 SMS Application Notes

1 Not change status of the specified SMS record

Example:
AT+CSDH=0 AT+CSDH=1
Write and read
AT+CMGR=6 AT+CMGR=6
SM:
+CMGR: "STO +CMGR: "STO
AT+CMGW
UNSENT","","" UNSENT","","",0,49,0,0,71,"",0,4
> test<CTRL+Z>
test test
+CMGW: 6

l
OK OK
OK

t e
+CMTI: "SM",3
+CMTI: "SM",4

l
AT+CMGR=3

c
AT+CMGR=4
+CMGR: "REC

a
Receive and read +CMGR: "REC

e
UNREAD","+86150210124

i
SM: UNREAD","+8615021012496","","201

t
96","","2010/08/18

u
AT+CNMI=2,1,0,0, 0/08/18
17:29:12+32"

n
0 17:37:23+32",145,4,0,241,"+86130103
test
14500",145,4

Q ide
test
OK
+CMT:
Receive and display +CMT:

f
"+8615021012496",,"2010/08/18
SM directly: "+8615021012496",,"2010/0
17:26:52+32",145,4,0,0,"+8613010314

n
AT+CNMI=2,2,0,0, 8/18 17:32:02+32"
500",145,4
0 test

o
test

C
Note:
 The difference of text mode and PDU mode: only the response format.

2.2.4. List short messages from preferred storage (+CMGL)

Table 11: AT+CMGL Syntax in text mode

Command Possible Response


OK
AT+CMGL=?
or +CMS ERROR: <err>

for SMS-SUBMITs and/or SMS-DELIVERs:


+CMGL:
<index>,<stat>,<oa/da>,[<alpha>],[<scts>][,<tooa/toda>,<length>]<CR>
AT+CMGL=<sta
<LF><data>[<CR><LF>
t>[,<mode>]
+CMGL:
<index>,<stat>,<da/oa>,[<alpha>],[<scts>][,<tooa/toda>,<length>]<CR>
<LF><data>[...]]

U10_SMS_Application_Note_V1.0 - 19 -
U10 SMS Application Notes

The execution command AT+CMGL returns messages with status value <stat> from preferred
message storage <mem1> to the TE.

Parameters:
Text value PDU value Description

"REC UNREAD" 0 Received unread messages (default)

"REC READ" 1 Received read messages


<state>
"STO UNSENT" 2 Stored unsent messages

l
"STO SENT" 3 Stored sent messages
"ALL" 4 All messages

t e
0 0 Normal
<mode>

l
1 1 Not change status of the specified SMS record

e c a
Example:

t i
AT+CSDH=0 AT+CSDH=1

u
OK OK

n
AT+CMGL="ALL" AT+CMGL="ALL"

Q ide
+CMGL: 1,"STO +CMGL: 1,"STO
UNSENT","15021012496","", UNSENT","15021012496","",,129,4
test test

f
+CMGL: 2,"STO +CMGL: 2,"STO

n
SENT","15021012496","", SENT","15021012496","",,129,4
test test

o
+CMGL: 3,"REC +CMGL: 3,"REC

C
READ","+8615021012496","","2010/08/18 READ","+8615021012496","","2010/08/18
17:29:12+32" 17:29:12+32",145,4
test test

+CMGL: 4,"REC +CMGL: 4,"REC


READ","+8615021012496","","2010/08/18 READ","+8615021012496","","2010/08/18
17:37:23+32" 17:37:23+32",145,4
test test

OK OK

Note:
 The difference of text mode and PDU mode: the parameter <state> value and response
format.

2.3. Status report

Status report can be used to get information whether a short message is received by the target
U10_SMS_Application_Note_V1.0 - 20 -
U10 SMS Application Notes

address after it is sent. If status report is needed, two parameters should be set in text mode:

1) AT+CNMI=2,1,0,1,0 // The forth parameter <ds> must be equals to 1


2) AT+CSMP=49,167,0,241 // The first parameter <fo> must be equals to 49

When the message is received, sender will get URC in text mode as below:
+CDS: <fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st>
Please refer to section 2.5 for the example.

l
2.4. Delete short messages

t e
2.4.1. Delete One or all Short Message (+CMGD)

c al
Table 12: AT+CMGD Syntax

e t i
Command Possible Response Example

u
+CMGD:(Range of SMS on

n
+CMGD: (1-50)
AT+CMGD=? preferred storage <mem1>

Q ide
can be deleted)

OK
AT+CMGD=<index>[,<delflag>]
+CMS ERROR:<err>

n f
TA deletes message(s) from preferred message storage <mem1> (+CPMS). If <delflag> is omitted
or equals to 0, it will delete message of location <index>. If <delflag> is present and not set to 0,

o
<index> is ignored and TA deletes all messages of one or more types. See table below.

C
Parameter <delflag>:
0 or omitted Delete the message specified in <index>
1 Delete all read messages
2 Delete all read and sent messages
3 Delete all read, sent, and unsent messages
4 Delete all messages

Note:
 No difference for text mode and PDU mode.

2.4.2. Delete all short messages (+QMGDA)

Table 13: AT+QMGDA Syntax in text mode

Command Possible Response Example

U10_SMS_Application_Note_V1.0 - 21 -
U10 SMS Application Notes

Text mode:
+QMGDA:("DEL READ","DEL
+QMGDA: (listed of UNREAD","DEL SENT","DEL
AT+QMGDA=? supported <type>s) UNSENT","DEL INBOX","DEL ALL")
+CMS ERROR: <err>
PDU mode:
+QMGDA:(1-6)
OK
AT+QMGDA=<type> ERROR

l
+CMS ERROR:<err>

t e
TA deletes all messages with type value <type> from preferred message storage <mem1>

l
(+CPMS).

e c a
<type> parameters:

t i
Text mode PDU mode Description

u
"DEL READ" 1 Delete all read messages

n
"DEL UNREAD" 2 Delete all unread messages

Q ide
"DEL SENT" 3 Delete all sent SMS
"DEL UNSENT" 4 Delete all unsent SMS
"DEL INBOX" 5 Delete all received SMS

f
"DEL ALL" 6 Delete all SMS

n
Note:

o
 The difference of text mode and PDU mode is the parameter <type> value.

C
2.5. Examples in text mode

User can send the short message in TEXT mode as follows.

2.5.1. Send English short message(GSM coding) and not require status report

For example: send “Hello” to +18621176031


Sender: +8618621090849 Receiver: +8618621176031
Step 1: Check service center address Step 1: Check service center address (same
AT+CSCS=“GSM” //Set the character as step 1 of sender)
mode as GSM mode. AT+CSCS="GSM"
OK OK
AT+CSCA? //Check the address of short AT+CSCA?
message service center. For +CSCA: "+8613010314500",145
china unicom in Shanghai, the
CSA is "+8613010314500". If OK
this address is wrong, the short
message can NOT be sent
U10_SMS_Application_Note_V1.0 - 22 -
U10 SMS Application Notes

successfully. And so this


address should be set to the
correct one by
AT+CSCA=<sca> and save it
by AT+CSAS.1
+CSCA: "+8613010314500",145

OK
Step 2: Set for sending English short Step 2: Set for receiving English short

l
message in text mode message in text mode
AT+CMGF=1 // Set the short message AT+CMGF=1 // Set the short message

e
mode as TEXT mode: mode as TEXT mode:

t l
OK OK

c
AT+CSCS=“GSM” // (Optional because it AT+CSCS=“GSM” //Set the character mode

e a
has been set in above as GSM mode. If it

t i
step 1). Set the sets as “UCS2”, the

u
character mode as message content will be

n
GSM mode. displayed in UCS2

Q ide
OK format.
AT+CSMP=17,167,0,0 // Set the related OK
parameters for sending short AT+CNMI=2,1,0,0,0 // Set parameters for
message in text mode: FO, VP, PID new message

f
and DCS2. DCS and +CSCS should indication. 1 – get

n
match each other. To send indication +CMTI
English message, set +CSCS as OK

o
“GSM” and <dcs> as GSM 7-bit AT+CPMS? //Check if short message
coding. storage is full. If it has

C
OK been full, delete some
AT+CNMI=2,1,0,0,0 // Not require status messages by AT
report: <FO> of command +CMGD or
+CSMP = 17 or <ds> +QMGDA.
of +CNMI =0 +CPMS: "SM",0,50,"SM",0,50,"SM",0,50
OK
OK
AT+CSDH=1 //More information will
be displayed if it equals 1.
OK
Step 3: Send English short message
AT+CMGS="18621176031" // Send SMS:
Enter the mobile phone number
directly. Enter message content
after “>” and end the input by
pressing Ctrl and “Z”
simultaneously.
>Hello<Ctrl+Z>

U10_SMS_Application_Note_V1.0 - 23 -
U10 SMS Application Notes

+CMGS: 140

OK
Step 3: Receive and read short message
+CMTI: "SM",1
AT+CMGR=1
+CMGR: "REC
UNREAD","+8618621090849","","2010/09/0
1

l
11:11:47+32",145,4,0,241,"+8613010314500"
,145,5

e
Hello

c t
e l l
OK

e al
AT+CSCS="UCS2" //if set character set as

t t i
“UCS2”, the content

u c a
of message will be

e n i
displayed in UCS2

QQ iddeen t
format.

u
OK
AT+CMGR=1
+CMGR: "REC

f
READ","002B0038003600310038003600320

n i
031003000390030003800340039","","2010/0
9/01

o f
11:11:47+32",145,4,0,241,"002B0038003600

n
3100330030003100300033003100340035003

C o
00030",145,5

C
00480065006C006C006F

OK

Note 1:
The short message service center is provided by network provider, and saved in SIM card as
factory setting. It is highly recommended that you do not change it at any time. And it’s better to
check it before sending short message.

Note 2:
The meaning represented by them is the same as the PDU mode parameters. The difference is that
the parameter must be input in decimal mode. The parameter 0 means that the short message
content is default in GSM coding and sent to <mem3> to store. If changed into 240, means that
the short message content is in GSM coding and sent to the destination terminal directly.

U10_SMS_Application_Note_V1.0 - 24 -
U10 SMS Application Notes

2.5.2. Send Chinese short message(UCS2 coding) and require status report

For example: send “您好” (UCS2 coding “60A8597D”) to 18621176031


Sender: 18621090849 Receiver: 18621176031
Step 1: Check service center address Step 1: Check service center address
AT+CSCS="GSM" AT+CSCS="GSM"
OK OK
AT+CSCA? AT+CSCA?
+CSCA: "+8613010314500",145 +CSCA: "+8613010314500",145

l
OK OK

t e
Step 2: Set for sending Chinese short Step 2: Set for receiving Chinese short

l l
message in text mode message in text mode

c e
AT+CMGF=1 // Set the short message AT+CMGF=1 // Set the short message

e i al
mode as TEXT mode: mode as TEXT mode:

t t a
OK OK

u c
AT+CSCS=“UCS2” //Set the character mode AT+CNMI=2,2,0,0,0 // Set parameters for

e n i
as UCS2 mode. new message

QQ iddeen
u t
OK indication. When the
second parameter is
AT+CSMP=49,167,0,25 // Set the related set as 2 , get

f
parameters for sending short indication +CMT
message in text mode: FO, VP, PID with message content

n i
and DCS1.DCS and +CSCS should OK

f
match each other. To send Chinese

o
AT+CPMS? // Check if short message
message, set +CSCS as “UCS2” storage is full. If it has been

n
and <dcs> as UCS2 coding. full, delete some messages by

C o
OK AT command +CMGD or

C
AT+CNMI=2,1,0,1,0 // Require status report: +QMGDA.
<FO> of +CSMP = 49, <ds> of +CPMS: "SM",1,50,"SM",1,50,"SM",1,50
+CNMI = 1
OK OK
AT+CSDH=0 // Less information will be
displayed when it equals 0.
OK
Step 3: Send Chinese short message
AT+CMGS="0031003800360032003100310
0370036003000330031" //
Send SMS: Enter the mobile phone
number in UCS2 coding as set in
+CSCS. Enter message content in
UCS2 format after “>” and end the
input by pressing Ctrl and “Z”
simultaneously.
> 60A8597D <Ctrl+Z>

U10_SMS_Application_Note_V1.0 - 25 -
U10 SMS Application Notes

+CMGS: 141

OK
Step 3: Receive and read short message
+CMT: "+8618621090849",,"2010/09/01
11:14:52+32"
60A8597D
AT+CPMS? //The short message is not
saved

l
+CPMS: "SM",1,50,"SM",1,50,"SM",1,50

e
OK

t l
Step4: Get status report

c
+CDS:

e a
6,141,"+8618621176031",145,"2010/09/01

t i
11:25:55+32","2010/09/01 11:25:55+32",0

u n
Note:

Q ide
The meaning represented by them is the same as the PDU mode parameters. And the difference is
that the parameters must be input in decimal mode. The parameter 25 means that the content of
the short message is UCS2 coding and sends to <mem3> to store. If changed into 24, means that

f
the short message content is UCS2 coding and sends to destination terminal directly.

o n
C

U10_SMS_Application_Note_V1.0 - 26 -
U10 SMS Application Notes

3. SMS in PDU mode

3.1. Write and Send Short Message

3.1.1. Send Message direct from Terminal (+CMGS)

Table 14: AT+CMGS Syntax in PDU mode

l
Command Possible Response Example

e
AT+CMGS=? OK

t
Send English characters “TEST” to

c l
13795403834:

a
AT+CMGS=19

e i
>

t
AT+CMGS=<length>

u
+CMGS: <mr> 0011000D91683197453038F400F10104D4E29
<CR>

n
or +CMS ERROR: 40A<Ctrl+Z>
PDU is given

Q ide
<err> Send Chinese characters “测试” to
<ctrl-Z/ESC>
13795403834:
AT+CMGS=19
>0011000D91683197453038F4000801046D4B

f
8BD5 <Ctrl+Z>

n
Note:

o
 <pdu> includes all parameters for sending a message, such as the target address, type of
address, message content and settings of <+CSMP> in text mode. The structure of <pdu> is

C
represented in section 3.5.1SMS-Submit PDU Packet (MO)
 <length> must match the actual length of <pdu>.
 <length> equals to the number of octets of <pdu> excluding <SCA>. See section 3.5.1
Submit PDU packet.

3.1.2. Write short message to storage (+CMGW)

Table 15: AT+CMGW Syntax in PDU mode

Command Possible Response


AT+CMGW=? OK
AT+CMGW=<length>[,<stat>]<CR> +CMGW: <index>
PDU is given <ctrl-Z/ESC> +CMS ERROR: <err>

The parameter and <pdu> content are the same as above command <+CMGS>, but the message
will be saved to storage <mem2> (+CPMS) and not be sent.

The stored message can be sent by AT command +CMSS. There is no difference between PDU

U10_SMS_Application_Note_V1.0 - 27 -
U10 SMS Application Notes

mode and text mode.

3.2. Receive and read short message

For PDU mode, the command syntax of +CNMI and +CMGR are the same as text mode. The
difference is response format of URC +CMTI, +CMT, +CDS, +CMGR.

The AT command +CSDH is invalid for pdu mode because these text mode parameters will be
included in <pdu>. Refer to section 3.5.2 SMS-Deliver PDU Packet (MT) for <pdu> structure and
meaning.

t e l
3.2.1. Read Short Messages (+CMGR)

c l
Table 16: AT+CMGR Syntax in PDU mode

e i a
Command Possible Response Example

u t
AT+CMGR=<index>[, +CMGR: AT+CMGR=5

n
<mode>] <stat>,[<alpha>],<length +CMGR: 0,,24
><CR><LF><pdu> 0891683108200105F0040D916851200

Q ide
12194F600F10180817144302304F4F2
9C0E

f
OK

n
See next AT command +CMGL for <stat> and <mode> value and meaning in PDU mode.

C
Command
o
3.2.2. List short messages from preferred storage (+CMGL)

Table 17: AT+CMGL Syntax in PDU mode

AT+CMGL=?
Possible Response
OK
Or +CMS ERROR: <err>

AT+CMGL=<sta +CMGL:<index>,<stat>,[<alpha>],<length><CR><LF><pdu><CR><LF>
t>[,<mode>] +CMGL: <index>,<stat>,[alpha],<length><CR><LF><pdu>[...]]

The execution command +CMGL returns messages with status value <stat> from preferred
message storage <mem1> to the TE.

Parameters:
Text value PDU value Description

"REC UNREAD" 0 Received unread messages (default)


<state>
"REC READ" 1 Received read messages
U10_SMS_Application_Note_V1.0 - 28 -
U10 SMS Application Notes

"STO UNSENT" 2 Stored unsent messages


"STO SENT" 3 Stored sent messages
"ALL" 4 All messages
0 0 Normal
<mode>
1 1 Not change status of the specified SMS record

Example:
AT+CMGL=4
+CMGL: 1,2,,18

l
0011FF0B815120012194F600004704F4F29C0E

t e
+CMGL: 2,3,,18

l
00117E0B815120012194F600004704F4F29C0E

e c i a
+CMGL: 3,1,,24

t
0891683108200105F0040D91685120012194F600F10180817192212304F4F29C0E

u n
+CMGL: 4,1,,24

Q ide
0891683108200105F0040D91685120012194F600F10180817173322304F4F29C0E

OK

f
3.3. Status report

o n
If status report is needed, two parameters should be set:

C
1) AT+CNMI=2,1,0,1,0 //The forth parameter <ds> must be equals to 1
2) <SRR> in <FO> field of PDU package must be set as 1.

When the message is received, sender will get URC in PDU mode as below:
+CDS:<length><CR><LF><pdu>
Please refer to section 3.6 for the example.

3.4. Delete short messages

Same as text mode, user can delete one or more short messages by AT command +CMGD, or
delete all short messages with <type> by AT command +QMGDA. The difference is <type> value
in command +QMGDA, see above section 2.4.

3.5. Basic elements of the PDU

Please refer to the document [4] 3GPP TS 23.040 (GSM 03.40) subclause 9 for details except
element <DCS><UDL><UD> which are defined in [3] 3GPP TS 23.038 (GSM 03.38).

U10_SMS_Application_Note_V1.0 - 29 -
U10 SMS Application Notes

&b/&h/&d is appended to the digital number to stand for binary/hexadecimal/decimal format in


this document.

3.5.1. SMS-Submit PDU packet (MO)

Table 18: SMS-SUBMIT packet

number of octets 1-12 1 1 2-12 1 1 0,1 or 7 1 0-140


Element SCA FO MR DA PID DCS VP UDL UD

l
3.5.2. SMS-Deliver PDU packet (MT)

t e
Table 19: SMS-DELIVER Packet

c l
number of octets 1-12 1 2-12 1 1 7 1 0-140

e i a
Element SCA FO OA PID DCS SCTS UDL UD

u n t
3.5.3. SMS-Status Report Packet

Q ide
Table 20: Status-Report packet

number 0-
1-12 1 1 2-12 7 7 1 1 1 1 1

f
of octets 140
SC DC UD

n
Element SCA FO MR RA DT ST PI PID UD
TS S L

o
The last elements from PI to UD are optional.

C
3.5.4. Element descriptions

3.5.4.1. Type of Address <TOA>

Table 21: <TOA>

&b
&h &d Description
1 TON NPI
1 000 0001 81 129 Unknown
International number, beginning with “+”continued
1 001 0001 91 145
with the country code.
1 010 0001 A1 161 National number
Please refer to the document [7] 3GPP TS 24.008 (GSM 04.08) subclause 10.5.4.7 Called party
BCD number for details of TON (Type of Number) and NPI (Numbering plan identification).

U10_SMS_Application_Note_V1.0 - 30 -
U10 SMS Application Notes

3.5.4.2. Service Center Address <SCA>

Table 22: <SCA>

Element SCA length TOA SCA


Example(&h) 08 91 683108200105F0

Above example shows <sca> address “+8613010314500” (SCA of China Unicom in Shanghai).

l
Parameters:
SCA length = 8 = 1 (octets length of TOA) + 7 (octets length of SCA)

e
TOA = 91: The address is international number (Begin with “+”).

t
SCA = 683108200105F0: Service Center Address. Number formatting rule:

c l
1) One octet includes two BCD-digit Fields.

a
2) If the digits number is odd, the last digit shall be filled with“F&h”.

e i
3) Switch every two digits from beginning.

u n t
Original number 86 13 01 03 14 50 0(F)

Q ide
after formatting 68 31 10 30 41 05 F0

Note:
 When sending message (SMS-Submit), if <SCA> sets as “00”, the address of AT command

f
<+CSCA> will be used. It is highly recommended that you do NOT change it at any time.

n
And it’s better to check it before sending short message.

o
3.5.4.3. Originator/Destination/Recipient Address <OA>/<DA>/<RA>

C
Table 23: <OA>/<DA>/<RA>

Element Address length TOA OA/DA/RA


Example(&h) 0D 91 683197453038F4

Parameters:
Address length = 0D&h = 13&d = number of digits of <OA>/<DA>/<RA> (8613795403834)
<OA>/<DA>/<RA>: the address format is the same as above field <SCA>

Note:
 If TOA does not match with address, short message sending maybe fail.
 Recommended to store every address in International numbering format to avoid problems
while roaming.

3.5.4.4. First Octet <FO>


First Octet includes some properties of the message, for example, the message type (MTI) , which
is a SMS Submit, SMS Deliver or SMS Status report; request status report or not (SRR) when
send a message; present VP (Validity Period) or not and its format(VPF), etc.
U10_SMS_Application_Note_V1.0 - 31 -
U10 SMS Application Notes

Table 24: <FO> elements

Bit 7 6 5 4 3 2 1 0
SMS-Submit RP UDHI SRR VPF RD MTI
SMS-Deliver RP UDHI SRI - MMS MTI
SMS-Status
RP UDHI SRQ - MMS MTI
Report

<FO> parameters
Value

l
Parameter Meaning
(bit)

e
0 Reply Path is not set

t
RP Reply Path
1 Reply Path is set

c l
The UD (User Data) field contains only the short
User Data 0

a
message

e i
UDHI Header
The beginning of the UD field contains a Header in

t
Indicator 1

u
addition to the short message

n
Status Report 0 A status report will not be returned to the SME
SRI

Q ide
Indication 1 A status report will be returned to the SME
Status Report 0 A status report is not requested
SRR
Request 1 A status report is requested
0 The SMS-Status-Report is the result of a SMS-Submit

f
Status Report
SRQ The SMS-Status-Report is the result of a
Qualifier 1

n
SMS-Command, e.g. an Enquiry
00 VP field is not present

o
01 Enhanced VP format
Validity Period
VPF Relative VP format, VP comprises 1 octet, an integer

C
Format 10
represented
11 Absolute VP format, VP comprises 7 octets
More Messages 0 More messages are waiting for the MS in this SC
MMS
to Send 1 No more messages are waiting for the MS in this SC
Instruct the SC to accept a SMS-SUBMIT for an SM
still held in the SC which has the same TP-MR and the
0
same TP-DA as a previously submitted SM from the
same OA.
Reject
RD Instruct the SC to reject an SMS-SUBMIT for an SM
Duplicates
still held in the SC which has the same MR and the same
1 DA as the previously submitted SM from the same OA.
In this case, an appropriate FCS value will be returned in
the SMS-SUBMIT-REPORT.
00 SMS-Deliver (in the direction SC to MS)
Message Type 01 SMS-Submit (in the direction MS to SC)
MTI
Indicator 10 SMS-Status Report (in the direction SC to MS)
10 SMS-Command (in the direction MS to SC)

U10_SMS_Application_Note_V1.0 - 32 -
U10 SMS Application Notes

Example of <FO> for SMS-Submit:

When sending short message in text mode, we should set <fo> as 17 or 49 in AT command
+CSMP. The following table shows their meanings:

Bit 7 6 5 4 3 2 1 0
&b &h &d
RP UDHI SRR VPF RD MTI
0 0 0 10 0 01
00010001 11 17 No header not request VP relative
SMS-Submit

l
in UD status report format
0 0 1 10 0 01

t e
00110001 31 49 No header request VP relative
SMS-Submit

l
in UD status report format

e c i a
3.5.4.5. Message Reference <MR>

u t
MR is an integer (0..255) for representing a reference number of the SMS-submit submitted to the

n
SMSC by the MS, used to identify whether the received SMS is duplicated or not.

Q ide
3.5.4.6. Protocol Identifier <PID>

The PID is the information element by which the transport layer either refers to the higher layer

f
protocol being used, or indicates interworking with a certain type of telematic device.

n
Table 25: <PID>

o
<PID> value
Protocol
&h &d

C
00 0 The SMS has to be treat as a short message
01 1 The SMS has to be treat as a telex

3.5.4.7. Data Coding Scheme <DCS>


<DCS> identifies the coding scheme within the User Data (UD). It comprises one octet and may
indicate the message class, alphabet, etc. Please refer to [3] 3GPP TS 23.038 (GSM 03.38) for
details.

Table 26:<DCS>

bit7-4 5 4 3 2 1 0 Meanings

0 The text is uncompressed


00xx The text is compressed using the GSM standard
1
( general data compression algorithm
coding 0 Bit 1,0 are reserved and have no message class
indication) 1 Bit 1,0 have a message class meaning
0 0 Default alphabet

U10_SMS_Application_Note_V1.0 - 33 -
U10 SMS Application Notes

0 1 8 bit alphabet
1 0 UCS2 (16 bit)
1 1 Reserved
0 0 Class 0 immediate display
0 1 Class 1 default meaning: ME specific
1 0 Class 2 SIM specific message
1 1 Class 3 default meaning: TE specific
0 Reserved
0 Default alphabet

l
1111 1 8-bit data

e
(data coding 0 0 Class 0 immediate display

t
message class) 0 1 Class 1 default meaning: ME specific

l
1 0 Class 2 SIM specific message

c
1 1 Class 3 default meaning: TE specific

e t i a
Message Class indicates how to store message when it is received. Class 0 message is displayed

u
directly in the destination terminal, not stored. If you want to store it in SIM, you can use AT

n
command +QCLASS0.

Q ide
Default alphabet indicates the user data is coded from the 7-bit alphabet.

f
Example
&b &h &d Character Coding Message Class

n
00000000 00 0 7-bit No class

o
00001000 08 8 UCS2 No class
00011000 18 24 UCS2 Class 0 (immediate display)

C
00011001 19 25 UCS2 Class 1 (ME-specific)
11110000 F0 240 7-bit Class 0 (immediate display)
11110001 F1 241 7-bit Class 1 (ME-specific)

In text mode, module uses relative decimal format in +CSMP.

3.5.4.8. Validity Period <VP>

<VP> identifies the time period for which the short message is valid in the SMSC. Its format is
defined in <VPF> of <FO> field.

When <VPF> is relative format (<VPF>=10&b), <VP> comprises 1 octet, which illustrates the
period between the time when SC receives the SM and SC discards the SM.

U10_SMS_Application_Note_V1.0 - 34 -
U10 SMS Application Notes

Table 27: <VP> relative format

<VP> value
Validity period value
&h &d
00 to 8F 0 to 143 (VP+1)*5 minutes 5 minutes to 12 hours
90 to A7 144 to 167 12 hours + (VP-143)*30 minutes 12.5 hours to 24 hours
A8 to C4 168 to 196 (VP-166)*1 day 2 days to 30 days
C5 to FF 197 to 255 (VP-192)*1 week 5 weeks to 63 weeks

l
In text mode, module uses relative decimal format in +CSMP.

e
When <VPF> is absolute format (<VPF>=11&b), <VP> comprises 7 octets, it defines the absolute

t
expire time when SC discards the SM. The representation is identical to the representation of the

c l
TP-SCTS (Service Center Time Stamp).

e t i a
3.5.4.9. Service Centre Time Stamp <SCTS>

u n
<SCTS> indicates time when the SMSC received the message. It’s given in semi-octet
representation in the following way.

Q ide
Table 28: <SCTS>

Year Month Day Hour Minute Second Time Zone

f
Digits(Semi-octets) 2 2 2 2 2 2 2

n
Example 01 80 12 41 14 80 23

o
The Time Zone expressed in quarters of an hour, between the local time and GMT. The above
example shows time 10-08-21 14:41:08+32, GMT +08.

C
3.5.4.10. Discharge Time <DT>
The TP-Discharge-Time field indicates the time at which the previously submitted SMS-SUBMIT
was successfully delivered to or attempted to deliver to the recipient SME or disposed of by the
SC.

3.5.4.11. Length of User Data <UDL>

UDL indicates the length of UD. It is related with the alphabet defined in <DCS>.
bits per SMS UDL
<dcs> character table
character meaning
Number of
Default(GSM 7-bit) 7 see [3]3GPP TS 23.038 (GSM 03.38)
characters
8-bit data 8 Number of octets user specific
ISO/IEC10646 “Universal
UCS2 16 Number of octets Multiple-Octet Coded Character Set
(UCS)”

U10_SMS_Application_Note_V1.0 - 35 -
U10 SMS Application Notes

Note:
For GSM 7-bit coding, UDL equals to the number of characters, it does NOT equal to the number
of octets.

3.5.4.12. User Data <UD>

If <UDHI> equals 0 (no header in <UD>) and message is not compressed, the maximum
individual Short Message sizes of 160 7-bit characters, 140 8-bit characters, or 70 16-bit
characters (1120 bits = 160*7 = 140*8 = 70*16).

l
General characters in English can be found in GSM alphabet table ([3]3GPP TS 23.038 (GSM

e
03.38) subclause 6.2.1. Default alphabet or appendix 5.3 in this document), and so can be encoded

t
using GSM 7-bit encoding. Characters in languages such as Arabic, Chinese, Korean, Japanese or

c l
Cyrillic alphabet languages (e.g. Russian, Serbian, Bulgarian, etc) must be encoded using the

a
16-bit UTF-16 character encoding.

u e t i
Please refer to the document [3] 3GPP TS 23.038 (GSM 03.38) subclause 6.1.2.1.1 for SMS

n
point-to-point packing of 7-bit characters.

Q ide
Example: SMS point-to-point packing of 7-bit characters
User data: 12345678
Character 1 2 3 4 5 6 7 8

f
GSM coding(hex) 31 32 33 34 35 36 37 38

n
0110 0110 0110 0110 0110 0110 0110 0111
GSM coding(bit)
001 010 011 100 101 110 111 000

o
Transfer last bits to 0011 1101 1000 0101 1011 1101 0111
previous character 0001 1001 1100 0110 0011 1101 0000

C
Result in hex format 31 D9 8C 56 B3 DD 70

So for string “12345678”, UD = “31D98C56B3DD70” and UDL=8 (note it is the number of


characters, not number of octets).

3.5.4.13. Status <ST>

ST indicates the status of the previously submitted SMS-SUBMIT when a status report has been
requested. It consists of one octet. If it equals to “00”&h, which means short message has been
received.

3.6. Examples in PDU mode

User can send the English and Chinese short message in PDU mode as follows.

U10_SMS_Application_Note_V1.0 - 36 -
U10 SMS Application Notes

3.6.1. Send English short message(GSM coding) and not require status report

For example: send “Hello” to +8613795403834


Sender: +8613651979176 Receiver: +8613795403834
Step 1: Check service center address Step 1: Check service center address
AT+CSCS=“GSM” //Set the character (same as step 1 of sender)
mode as GSM mode. AT+CSCS="GSM"
OK OK
AT+CSCA? //Check the address AT+CSCA?

l
of short message service center. For +CSCA: "+8613800210500",145
china mobile in Shanghai, the CSA is

t e
"+8613800210500". If this address is OK

l
wrong, the short message can NOT

c
be sent successfully. And so this

e a
address should be set to the correct

t i
one by AT+CSCA=<sca> and save it

u
by AT+CSAS.

n
+CSCA: "+8613800210500",145

Q ide
OK
Step 2: Set PDU mode Step 2: Set PDU mode and parameters for

f
AT+CMGF=0 // Set the short message receiving messages
mode as PDU mode. AT+CMGF=0 // Set the short message

n
OK mode as PDU mode.

o
OK
AT+CNMI=2,1,0,0,0 // Set parameters
for new message indication. When

C
the second parameter is set as 1,
get indication +CMTI.
OK
AT+CPMS? //Check if short message
storage is full. If it has been full,
delete some messages by AT
command +CMGD or +QMGDA.
+CPMS: "SM",1,50,"SM",1,50,"SM",1,50

OK
Step 3: Send English short message
AT+CMGS=20
>
0011000D91683197453038F400000105C8329
BFD06 <Ctrl+Z>
+CMGS: 146

OK //See below Note 1 for descriptions

U10_SMS_Application_Note_V1.0 - 37 -
U10 SMS Application Notes

Step 3: Receive and read short message


+CMTI: "SM",2
AT+CMGR=2
+CMGR: 0,,25
0891683108200105F0040D9168315691977
1F600000190102191252305C8329BFD06

OK //See below Note 2 for descriptions

l
Note 1: Descriptions for SMS-SUBMIT PDU:
AT+CMGS=20

e
> 0011000D91683197453038F400000105C8329BFD06 <Ctrl+Z>

c t l
SMS-SUBMIT PDU:

e a
Number of 0,1 or

i
1-12 1 1 2-12 1 1 1 0-140

t
octets 7

u
Element SCA FO MR DA PID DCS VP UDL UD

n
0D91683197 C8329
Example 00 11 00 00 00 01 05

Q ide
453038F4 BFD06

20 = octets of (<pdu>-<sca> = 11000D91683197453038F400000105C8329BFD06)

f
SCA = 00: Service center address is defined in AT command +CSCA.
FO = 11&h = 17&d:

n
Bit 7 6 5 4 3 2 1 0
&b &h &d

o
RP UDHI SRR VPF RD MTI
0 0 0 10 0 01

C
00010001 11 17 No header not request VP relative SMS-Sub
in UD status report format mit

SRR = 0: A status report is not requested


VPF = 10, VP = 01: validity period is (VP+1)*5 = 10 minutes
DA = 0D91683197453038F4: Receiver is +8613795403834
DCS = 00: GSM 7-bit coding.
UDL = 05: length of characters “Hello”
UD = C8329BFD06:
Character H e l l o
GSM coding(hex) 48 65 6C 6C 6F
GSM coding(bit) 1001000 1100101 1101100 1101100 1101111
Transfer last bits to previous
11001000 00110010 10011011 11111101 00000110
character
Result in hex format C8 32 9B FD 06

Note 2: Descriptions for SMS-Deliver PDU


AT+CMGR=2
+CMGR: 0,,25
U10_SMS_Application_Note_V1.0 - 38 -
U10 SMS Application Notes

0891683108200105F0040D91683156919771F600000190102191252305C8329BFD06
OK

SMS-DELIVER PDU:
number of
1-12 1 2-12 1 1 7 1 0-140
octets
Element SCA FO OA PID DCS SCTS UDL UD
C832
0891683108 0D9168315 0190102
Example 04 00 00 05 9BFD
200105F0 6919771F6 1912523

l
06

t e
SCA = 0891683108200105F0: Service center address is +8613800210500

l l
OA = 0D91683156919771F6: Sender is +8613651979176

e c e al
FO = 04:

t t ia
Bit 7 6 5 4 3 2 1 0

u c
SMS-Deliver RP UDHI SRI - MMS MTI

e n i
Example 0 0 0 00 01 00

QQ iddeen
u t
UDHI = 0: No header in UD
MMS = 1: No more messages are waiting for the MS in this SC

n f
i
3.6.2. Send Chinese short message(UCS2 coding) and require status report

o f
For example: send “您好” (UCS2 coding “60A8597D”) to 13795403834

n
Sender: +8613651979176 Receiver: +8613795403834

C o
Step 1: Check service center address Step 1: Check service center address
AT+CSCS="GSM" AT+CSCS="GSM"

C
OK OK
AT+CSCA? AT+CSCA?
+CSCA: "+8613800210500",145 +CSCA: "+8613800210500",145

OK OK
Step 2: Set PDU mode Step 2: Set PDU mode and parameters for
AT+CMGF=0 // Set the short message receiving messages
mode as PDU mode. AT+CMGF=0 // Set the short message
OK mode as PDU mode.
AT+CNMI=2,1,0,1,0 // Require status OK
report: <SRR> in <FO> field of pdu AT+CNMI=2,2,0,0,0 // Set parameters for
package must be set as 1 and <ds> new message indication. 2 – get
of +CNMI = 1 indication +CMT with message
OK content
OK
AT+CPMS? //Check if short message

U10_SMS_Application_Note_V1.0 - 39 -
U10 SMS Application Notes

storage is full. If it has been full,


delete some messages by AT
command +CMGD or +QMGDA.
+CPMS: "SM",2,50,"SM",2,50,"SM",2,50

OK
Step 3: Send Chinese short message
AT+CMGS=19
>

l
0031000D91683197453038F40008010460A8
597D <Ctrl+Z>

e
+CMGS: 147

c t l
OK //See below Note 1 for descriptions

e a
Step 3: Receive and read short message

t i
+CMT: ,24

u
0891683108200105F0240D91683156919771

n
F60008019010314241230460A8597D

Q ide
//See below Note 2 for descriptions
AT+CPMS? //The short message is not
saved

f
+CPMS: "SM",2,50,"SM",2,50,"SM",2,50

n
OK
Step4: Get status report

o
+CDS: 26
0891683108200105F006930D916831974530

C
38F4019010314291230190103142912300
//See below Note 3 for descriptions

Note 1: Descriptions for SMS-SUBMIT PDU:


AT+CMGS=19
> 0031000D91683197453038F40008010460A8597D <Ctrl+Z>

SMS-SUBMIT PDU:
number of 0,1 or
1-12 1 1 2-12 1 1 1 0-140
octets 7
M
Element SCA FO DA PID DCS VP UDL UD
R
0D916831974 60A8597
Example 00 31 00 00 08 01 04
53038F4 D

19 = octets number of (<pdu>-<sca> = 31000D91683197453038F40008010460A8597D)


SCA = 00: Service center address is defined in AT command +CSCA.
FO = 31&h = 49&d:

U10_SMS_Application_Note_V1.0 - 40 -
U10 SMS Application Notes

Bit 7 6 5 4 3 2 1 0
&b &h &d
RP UDHI SRR VPF RD MTI
0 0 1 10 0 01
No request
00110001 31 49 VP relative
header status SMS-Submit
format
in UD report

SRR = 1: A status report is requested

l
VPF = 10, VP = 01: validity period is (VP+1)*5 = 10 minutes
DA = 0D91683197453038F4: Receiver is +8613795403834

t e
DCS = 08: UCS2 coding.

l
UDL = 04: Number of UD octets “60A8597D”

c
UD = 60A8597D: UCS2 coding for “您好”

e t i a
Note 2: Descriptions for SMS-Deliver PDU

u
+CMT: ,24

n
0891683108200105F0240D91683156919771F60008019010314241230460A8597D

Q ide
SMS-DELIVER PDU:
number of
1-12 1 2-12 1 1 7 1 0-140

f
octets
DC UD

n
Element SCA FO OA PID SCTS UD
S L

o
08916831082 0D9168315 0190103 60A859
Example 24 00 08 04
00105F0 6919771F6 1424123 7D

C
24 = Octets number of <pdu> - <SCA>
(240D91683156919771F60008019010314241230460A8597D)
SCA = 0891683108200105F0: Service center address is +8613800210500
OA = 0D91683156919771F6: Sender is +8613651979176
FO = 24:
Bit 7 6 5 4 3 2 1 0
SMS-Deliver RP UDHI SRI - MMS MTI
Example 0 0 1 00 01 00

UDHI = 0: No header in UD
SRI = 1: A status report will be returned to the SME
MMS = 1: No more messages are waiting for the MS in this SC

Note 3: Descriptions for SMS-Status Report PDU


+CDS: 26
0891683108200105F006930D91683197453038F4019010314291230190103142912300

U10_SMS_Application_Note_V1.0 - 41 -
U10 SMS Application Notes

SMS-Status Report PDU:


number of
1-12 1 1 2-12 7 7 1
octets
Element SCA FO MR RA SCTS DT ST
0891683108 0D9168319745 01901031 01901031
Example 06 93 00
200105F0 3038F4 429123 429123

26= octets number of <pdu> - <SCA>

l
(06930D91683197453038F4019010314291230190103142912300)
SCA = 0891683108200105F0: Service center address is +8613800210500

t e
MR = 93 &h = 147: same as response <MR> of AT command +CMGS

l
RA = 0D91683197453038F4: Receiver is +8613795403834

c
ST = 0: short message has been received.

e a
FO = 06:

t i
Bit 7 6 5 4 3 2 1 0

u
SMS-Status

n
RP UDHI SRQ - MMS MTI
report

Q ide
Example 0 0 0 00 01 10
UDHI = 0: No header in UD
SRQ = 0: The SMS-Status-Report is the result of a SMS-Submit

f
MMS = 1: No more messages are waiting for the MS in this SC

o n
C

U10_SMS_Application_Note_V1.0 - 42 -
U10 SMS Application Notes

4. Other Commands with SMS

4.1. Save and restore SMS settings

The settings of +CSCA and +CSMP can be saved to SIM card by AT command +CSAS and
restored by AT command +CRES. Other commands are described in section 4.1.3.

l
4.1.1. Save SMS settings (+CSAS)

t e
Table 29: AT+CSAS syntax

c l
Command Possible Response Example

e i a
AT+CSAS=? +CSAS: (list of supported <profile>s) +CSAS: (0-3)

t
OK

u
AT+CSAS=[<profile>]
ERROR

Q ide n
Parameter:
<profile> 0-3 Manufacturer specific profile number where settings are to be saved

f
Execution command saves active message service settings to a non-volatile memory. A TA can
contain several profiles of settings. Settings specified in AT commands Service Centre Address

n
+CSCA and Set Message Parameters +CSMP are saved.

o
4.1.2. Restore SMS Settings (+CRES)

C
Table 30: AT+CRES syntax

Command Possible Response Example


AT+CRES=? +CRES: (list of supported <profile>s) +CRES: (0-3)
OK
AT+CRES=[<profile>]
ERROR

TA restores SMS settings from non-volatile memory to active memory.

4.1.3. Save other settings

The setting of +CPMS is saved automatically.


The setting of +QCLASS0 is not able to be saved.

The following settings can be saved by command AT&W, restored by command ATZ, and return
to manufacturer defaults by command AT&F.
 +CMGF

U10_SMS_Application_Note_V1.0 - 43 -
U10 SMS Application Notes

 +CNMI
 +CSDH
 +CSCS

4.2. Store Class 0 SMS to <mem3> when received Class 0 SMS (+QCLASS0)

As normal class0 message (set in <dcs>) will be displayed immediately in the terminal. Using AT
command +QCLASS0, Quectel module can store this kind of message.

l
Table 31: AT+QCLASS0 syntax

e
Command Possible Response

t l
AT+QCLASS0=? +QCLASS0: (0, 1)

c e l
AT+QCLASS0? +QCLASS0: <mode>

e t i al
OK

t
AT+QCLASS0=[<mode>]

a
ERROR

u e c
Parameter <mode>

n ti
QQ iddeen
u
0 Disable to store Class 0 SMS to <mem3> when received Class 0 SMS (default)
1 Enable to store Class 0 SMS to <mem3> when received Class 0 SMS

f
Example:

n i
//Send class 0 message
AT+CMGF=1 // Set the short message mode as TEXT mode

o f
OK

n
AT+CSCS=“GSM” // Set the character mode as GSM mode.

C o
OK

C
AT+CSMP=17,167,0,240 // Set parameters for sending short message in text mode.
<DCS>=240 stands for a class0 message
OK
AT+CMGS=”13795403834”
>TEST CLASS0 MESSAGE<Ctrl+Z>
+CMGS: 160

OK

//Receive Class0 message when QCLASS0=0


AT+QCLASS0?
+QCLASS0: 0

OK
AT+CMGF=1
OK
AT+CNMI?
+CNMI: 2,1,0,0,0
U10_SMS_Application_Note_V1.0 - 44 -
U10 SMS Application Notes

OK

+CMT: "+8613651979176",,"2010/09/01 15:35:34+32"


TEST CLASS0 MESSAGE //Message is displayed directly and not stored

//Receive Class0 message when QCLASS0=1 (Send the same message as above)
AT+QCLASS0=1
OK

l
+CMTI: "SM",3 //Message is stored.

e
AT+CMGR=3

t
+CMGR: "REC UNREAD","+8613651979176","","2010/09/01 15:37:56+32"

c l
TEST CLASS0 MESSAGE

e t i a
OK

u n
4.3. Notify SMS is full (+QEXTUNSOL)

Q ide
+QEXTUNSOL is provided to enable/disable proprietary unsolicited indications. User can use this
command to get the notification for SMS full as the following format.

f
AT+QEXTUNSOL=”SM” ,<mode>

n
<SM> stands for additional SMS Information and displays additional information about SMS

o
events in the form of Unsolicited messages of the following format.
+TSMSINFO: <CMS error info>

C
where <CMS error info> is a standard CMS error in the format defined by the AT+CMEE
command i.e. either a number or a string.

<mode> parameter
0 Disable (default)
1 Enable
2 Query

Example:
AT+QEXTUNSOL=”SM”,1
OK
AT+CPMS?
+CPMS: "SM",49,50,"SM",49,50,"SM",49,50

OK

+CMTI: "SM",50
//Short messages are full, get below URC:

U10_SMS_Application_Note_V1.0 - 45 -
U10 SMS Application Notes

+TSMSINFO: 322 // Memory full

//Restart module
+TSMSINFO: 322 // Memory full

+TSMSINFO: 3513 // Unread records on SIM

t e l
e c i al
u n t
Q ide
n f
C o

U10_SMS_Application_Note_V1.0 - 46 -
U10 SMS Application Notes

5. Appendix

5.1. Message service send and write procedures

Refer to the document [2] 3GPP TS 27.005 (GSM 07.05) clause 3 Figure 4.

l
SMS-SUBMIT send from storage +CMSS

SM STORAGES

t e
volatile memory

l
text mode send +CMGS

c
write +CMGW add text mode
SMS-SUBMIT and write +CMGW
parameters (+CSMP)

a
and SMSC address
PDU mode send +CMGS

e
write +CMGW

i
SMS-SUBMIT (optionally add and write +CMGW

t
SMSC address)

u
in text mode, send command +CMGC
SMS-COMMAND add SMSC address

n
(optional in PDU mode)

ME TA TE

Q ide
Figure 2: Message service send and write procedures

n f
C o

U10_SMS_Application_Note_V1.0 - 47 -
U10 SMS Application Note

5.2. Message receiving procedures

Refer to the document [2] 3GPP TS 27.005 (GSM 07.05) Clause 3 Figure 3.

<ds>=2 new status report indication +CDSI

SM STORAGES <mt>=1 or
<mt>=2 (class 2) or
<mt>=3 (class not 3) new MT SM indication +CMTI

l
<mt>=0 or <mt>=1 or
<mt>=2 (class 2) or <mt>=2 (class not 2) or
SMS-DELIVER <mt>=3 (class not 3) <mt>=3 (class 3) new MT SM +CMT

e
<ds>=0 or BUFFER

t
<ds>=2
SMS-STATUS-REPORT <ds>=1 status report +CDS

c al
CBM with allowed message identifier <bm>=2 or

e
and data coding scheme (refer +CSCB) <bm>=3 (class 3) new CBM +CBM

t i
<bm>=0 or <bm>=1 or
<bm>=3 (class not 3)

u
<bm>=1 or
<bm>=3 (class not 3) new CBM indication +CBMI

n
CBM STORAGES

Q ide
ME TA TE

f
Figure 3: Message receiving procedures

n
5.3. Default GSM alphabet

o
Refer to the document [3] 3GPP TS 23.038 (GSM 03.38) subclause 6.2.1 GSM 7 bit Default

C
Alphabet.
b7 0 0 0 0 1 1 1 1
b6 0 0 1 1 0 0 1 1
b5 0 1 0 1 0 1 0 1
b4 b3 b2 b1 0 1 2 3 4 5 6 7
0 0 0 0 0 @  SP 0 ¡ P ¿ p
0 0 0 1 1 £ _ ! 1 A Q a q
0 0 1 0 2 $  " 2 B R b r
0 0 1 1 3 ¥  # 3 C S c s
0 1 0 0 4 è  ¤ 4 D T d t
0 1 0 1 5 é  % 5 E U e u
0 1 1 0 6 ù  & 6 F V f v
0 1 1 1 7 ì  ' 7 G W g w
1 0 0 0 8 ò  ( 8 H X h x
1 0 0 1 9 Ç  ) 9 I Y i y
U10_SMS_AN_V1.0 - 48 -
U10 SMS Application Notes

1 0 1 0 10 LF  * : J Z j z
1 0 1 1 11 Ø 1) + ; K Ä k ä
1 1 0 0 12 ø Æ , < L Ö l ö
1 1 0 1 13 CR æ - = M Ñ m ñ
1 1 1 0 14 Å ß . > N Ü n ü
1 1 1 1 15 å É / ? O § o à

l
Figure 4: Default GSM alphabet

c t e l
u e t i a
Q ide n
n f
C o

U10_SMS_Application_Note_V1.0 - 49 -
U10 SMS Application Notes

Quectel Wireless Solutions Co., Ltd.


Room 501, Building13, No.99, Tianzhou Road, Shanghai, China 200233
Tel: +86 21 51086236
Mail: [email protected]

U10_SMS_Application_Note_V1.0 - 50 -

You might also like