Specifications
TC35i AT Command Set
Confidential / Released
TC35i_ATC_V01.05 Page 165 of 278 04.08.2003
5.7 AT+CMGW Write SMS message to memory
Test command
AT+CMGW=?
Response
OK
Execute command
AT+CMGW<CR>
text is entered
<ctrl-Z/ESC>
<ESC> aborts message.
Write command
1) If text mode (+CMGF=1):
AT+CMGW=<oa/da>
[,tooa/toda>[,stat>]]<CR>
text is entered
<ctrl-Z/ESC>
<ESC> aborts message.
2) If PDU mode
(+CMGF=0):
AT+CMGW=<length>
[,stat]<CR>
PDU is given <ctrl-Z/ESC>
<ESC> aborts message.
Response
The write / execute command serves to transmit SMS (either SMS-
DELIVER or SMS-SUBMIT) from TE to memory storage <mem2>.
Memory location <index> of the stored message is returned. Message
status will be set to ‘stored unsent’ unless otherwise given in parame-
ter <stat>.
Note: SMS-COMMANDs and SMS-STATUS-REPORTs cannot be
stored in text mode.
If writing is successful:
+CMGW: <index> OK
If writing fails, the error code depends on the current setting of the pa-
rameter <m> specified with AT^SM20 (see Chapter 7.17):
· If AT^SM20=x,1 (factory default):
When writing fails due to timeout: +CMS ERROR: Unknown error.
Otherwise (for example, if a message is too long or contains an in-
valid character): OK
Users should be aware that, in these cases, the message will not
be written to the selected SMS storage.
· If AT^SM20=x,0:
Failure to write a message is always followed by
+CMS ERROR: <err>
For example, if a message was too long <err> code 305 (“Invalid
text mode parameter”) is returned.
Parameter
<oa> GSM 03.40 TP-Originating-Address Address value field in
string format; BCD numbers (or GSM default alphabet char-
acters) are converted into characters; type of address given
by <tooa>
<da> GSM 03.40 TP-Destination-Address Address-Value field in
string format; BCD numbers (or GSM default alphabet char-
acters) are converted into characters; type of address given
by <toda>
<tooa> GSM 04.11 TP-Originating-Address Type-of-Address octet
in integer format (default refer <toda>)
<toda> GSM 04.11 TP-Destination-Address Type-of-Address octet
in integer format (when first character of <da> is + (IRA 43)
default is 145, otherwise default is 129)
<length> integer type value indicating in PDU mode (+CMGF=0), the
length of the actual TP data unit in octets (i.e. the RP layer
SMSC address octets are not counted in the length).
<stat> integer type in PDU mode (default 2), or string type in text
mode (default “STO UNSENT“); indicates the status of
message in memory; defined values: