Westermo GS-01 User Manual

Page 44

Advertising
background image

44

6195-2201

+CMGW – Write Message to Memory

This command stores a message to memory storage (either SMS-SUBMIT or
SMS-DELIVERS). The memory location <index> is returned (no choice possible
as with phonebooks +CPBW).

The entering of text or PDU is done similarly as specified in command Send Message
+CMGS.

Command syntax in text mode:

(<index> is returned in both cases)

AT+CMGW= <oa/da> [,<tooa/toda> [,<stat> ] ] <CR>

enter text <ctrl-Z / ESC>

Command syntax in PDU mode:

AT+CMGW= <length> [,<stat>] <CR>

give PDU <ctrl-Z / ESC>

Response syntax:

+CMGW: <index>

or +CMS ERROR: <err> if writing fails

Parameter Definition:

<oa/da>: Originating or Destination Address Value in string format.

<tooa/toda>: Type of Originating / Destination Address.

<stat>: Integer type in PDU mode (default 2 for +CMGW), or string type in text mode
(default ”STO UNSENT” for +CMGW). It indicates the status of message in memory.
If <stat> is omitted , the stored message is considered like a message to be send.

Defined <stat> values:

PDU mode

Text mode

0

”REC UNREAD”

1

”REC READ”

2

”STO UNSENT”

3

”STO SENT”

<length>: The length of the actual data unit in octets

Example:

Application to GSM

AT+CMGW=”+33146290800”<CR>

Write a message in

Hello, how are you?<ctrl-Z>

text mode

GSM to application

+CMGW: 4

Message stored in

OK

index 4

Application to GSM

AT+CMGW=<length><CR>

Write a message in

<pdu><ctrl-Z>

PDU mode

GSM to application

+CMGW: <index>

Message stored in

OK

<index>

Advertising