HUAWEI MG323 GSM M2M Module
AT Command Interface Specification Commands for Short Messages
Issue 02 (2010-11-23) Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd. 164
11.5 AT+CMGS - Command for Sending Short Messages
The AT+C MGS command sends short messages in two steps:
In PDU mode (AT+C MGF =0):
First, send +CMGS=<length> that ends with (CR).
Then, upon receiving > that is returned by the MT, the TE sends a PDU data packet
that ends with <ctrl-Z>(IRA 26).

11.5.1 Testing Whether the Command for Sending Short

Messages Exists

Test
command
AT+CMGS=?
Function Tests whether the command for sending short messages exists.
Response z In case of successful execution: <CR><LF>OK<CR><LF>
z In case of an error during command execution:
<CR><LF>ERROR<CR><LF>
z In case of an error related to the MS: <CR><LF>+CMS ERROR:
<err><CR><LF>

11.5.2 Sending Short Messages

This command sends short messages in PDU mode (+CMGF=0).
Write command AT+CMGS=<length><CR>PDU is given <Ctrl-Z/Esc>
Function Sends short messages.
Response z In case of successful execution:
<CR><LF>+CMGS: <mr>[,<ackpdu>] <CR><LF>
<CR><LF>OK<CR><LF>
z In case of an error during command execution:
<CR><LF>ERROR<CR><LF>
z In case of an error related to the MS: <CR><LF>+CMS
ERROR: <err><CR><LF>
Parameter description
<mr>: identifier of short messages, which is a decimal number consisting of digits 0–
9. Value range: 0–65535. For details, see 3GPP TS 23.040[3]
TP-Message-Reference integer format.
<length>: number of characters of the actually sent TPDU / 2; a decimal number
consisting of digits 0–9; GSM 7-bit coding; the maximum length is 160 characters; for
Chinese characters in UCS2 coding, the maximum length is 70 characters; otherwise,
ERROR is returned.