AT command interface
Version 8 dated 15.03.00
101
Siemens Information and Communication Products
AT+CMGW
Write SMS message to memory
Test command
AT+CMGW=?
Response
OK
Parameter
Execute command
1) If text mode
(+CMGF=1):
+CMGW[=<oa/
da>[,<tooa/to-
da>[,stat>]]]
<CR> text is en-
tered ctrl-Z/ESC>
<ESC> quits wit-
hout sending
2) If PDU mode
(+CMGF=0):
+CMGW=<length
>[,stat]<CR>
PDU is given <ctrl-
Z/ESC>
Response
TA transmits SMS message (either SMS-DELIVER or SMS-SUBMIT) from TE to memory stora-
ge <mem2>. Memory location <index> of the stored message is returned. Message status will be
set to ’stored unsent’ unless otherwise given in <stat>.
Note:
SMS-COMMANDs and SMS-STATUS-REPORTs can not be stored in text mode.
If writing is successful:
+CMGW: <index> OK
If error is related to ME functionality:
+CMS ERROR: <err>
Parameter
<oa>
GSM 03.40 TP-Originating-Address Address-Value field in string format; BCD
numbers (or GSM default alphabet characters) 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 characters) are converted into characters; type of
address given by <toda>
<tooa>
GSM 04.11 TP-Originating-Address Type-of-Address octet in integer format (de-
fault 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 the text mode (+CMGF=1) the length of the message
body <data> (or <cdata>) in characters; or 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>
0
"REC UNREAD"
Received unread messages (default)
1
"REC READ"
Received read messages
2
"STO UNSENT"
Stored unsent messages
3
"STO SENT"
Stored sent messages
4
"ALL"
All messages
<pdu>
In the case of SMS: GSM 04.11 SC address followed by GSM 03.40 TPDU in he-
xadecimal format: ME/TA converts each octet of TP data unit into hexadecimal
numbers containing two IRA characters (e.g. octet with integer value 42 is presented
to TE as two characters 2A (IRA 50 and 65)). In the case of CBS: GSM 03.41 TPDU
in hexadecimal format.
<index>
Index of message in selected storage <mem2>
Reference
GSM 07.05
Note
ctrl-Z sends/writes message, Returns OK
ESC aborts input, message NOT sent/written. Returns OK
Sending e-mails via SMS: Note that some providers do not recognise @ symbol. Possible alterna-
tive "!" for "@"