> 2.11.2 | Writing SMS

> This section comprises the subsections Description, Used AT Commands, Flow Chart, Hints and Example. To move to these subsections please use the Navigation Frame or the appropriate buttons on the toolbar.

> 2.11.2.1 | Description

> This chapter describes all the steps required to write a short message to the memory. You can do this by using text mode, or by using PDU mode. If you want to write your short message in text mode, first use AT+CSMP to set some parameters. When using PDU mode you have to create the PDU by an external tool or your application first.

> 2.11.2.2 | Used AT commands

> Command | Explanation
> AT+CMGF | Select SMS message format
> AT^SMGO | Set or query SMS overflow presentation mode or query SMS overflow
> AT+CSMP | Set SMS text mode parameters
> AT+CMGW | Write SMS message to memory

> For further details about the commands see [2].

> 2.11.2.3 | Flow chart

> Figure 77: Writing SMS (text mode)
> Figure 78: Writing SMS (PDU mode)

> 2.11.2.4 | Hints

> • | Tools to decode and encode PDUs can be found in the Internet.

> 2.11.2.5 | Example

> Example 1:
> ***************************************
> Comment: Writing SMS (text mode)
> ***************************************
> ***************************************
> Comment: Write SMS in text mode to memory
> ***************************************
> Subscr 1 Send: AT+CMGW=+491797782631
> Subscr 1 Receive: AT+CMGW=+491797782631
> Subscr 1 Receive: >
> Subscr 1 Send: Hello, how are you?
> Subscr 1 Receive: Hello, how are you?'26'
> Subscr 1 Receive: +CMGW: 30
> Subscr 1 Receive:
> Subscr 1 Receive: OK
> ***************************************
> Comment: Attempt to write SMS in text mode to memory if memory is full
> ***************************************
> Subscr 1 Send: AT+CMGW=+491797782631
> Subscr 1 Receive: AT+CMGW=+491797782631
> Subscr 1 Receive: +CMS ERROR: memory full
> Example 2:
> ***************************************
> Comment: Writing SMS (PDU mode)
> ***************************************
> ***************************************
> Comment: Try to write SMS in PDU mode with wrong length to memory
> ***************************************
> Subscr 1 Send: AT+CMGW=50
> Subscr 1 Receive: AT+CMGW=50
> Subscr 1 Receive: >
> Subscr 1 Send: 0011000A9171798762130000A713C8329BFD6681D0EF3B282C2F83F2EFFA0F
> Subscr 1 Receive: 0011000A9171798762130000A713C8329BFD6681D0EF3B282C2F83F2EFFA0F'26'
> Subscr 1 Receive:
> Subscr 1 Receive: OK
> ***************************************
> Comment: Write SMS in PDU mode to memory
> ***************************************
> Subscr 1 Send: AT+CMGW=30
> Subscr 1 Receive: AT+CMGW=30
> Subscr 1 Receive: >
> Subscr 1 Send: 0011000A9171798762130000A713C8329BFD6681D0EF3B282C2F83F2EFFA0F
> Subscr 1 Receive: 0011000A9171798762130000A713C8329BFD6681D0EF3B282C2F83F2EFFA0F'26'
> Subscr 1 Receive: +CMGW: 30
> Subscr 1 Receive:
> Subscr 1 Receive: OK
> ***************************************
> Comment: Attempt to write SMS in PDU mode to memory if memory is full
> ***************************************
> Subscr 1 Send: AT+CMGW=30
> Subscr 1 Receive: AT+CMGW=30
> Subscr 1 Receive: +CMS ERROR: memory full