Home · All Classes · Grouped Classes · Annotated · Functions

[Previous: Modem Emulator - GPRS] [Next: Modem Emulator - Ignored Commands]

Modem Emulator - Short Message Service

The AT commands in this section are used for accessing the Short Message Service (SMS) subsystem.

AT+CMGD Delete Message

The AT+CMGD command allows deletion of messages from the message store.

CommandPossible Responses
AT+CMGD=<index>[,<delflag>]+CMS ERROR: <err>
AT+CMGD=?+CMGD:(list of supported <index>s)[, (list of supported <delflag>s)]

If the <delflag> parameter is present and non-zero, the <index> is ignored. Otherwise, the message at the location <index> is deleted.

Possible values for <delflag> are as follows:

0 (or omitted)Delete the message at specified <index>
1Delete all "REC READ" messages from the store
2Delete all "REC READ" and "STO SENT" messages from the store
3Delete all "REC READ", "STO SENT" and "STO UNSENT" messages from the store
4Delete all messages from the store

Conforms with 3GPP TS 27.005.

AT+CMGF Message Format

The AT+CMGF command can be used to set the SMS message format to PDU (0) or text (1). The default is PDU.

CommandPossible Responses
AT+CMGF=<mode>
  • OK
  • +CME ERROR: <err>
AT+CMGF?+CMGF: <mode>
AT+CMGF=?+CMGF: (0,1)

Conforms with: 3GPP TS 27.005.

AT+CMGL List Messages

The AT+CMGL command returns messages with status <stat> from the message store to the TE. If the status of a message listed is "REC UNREAD", status of that message should change to "REC READ".

CommandPossible Responses
AT+CMGL[=<stat>]
  • if text mode (+CMGF=1): +CMGL: <index>,<stat>,<address>,[<alpha>],[<scts>] [,<address_type>,<body_length>]<CR><LF><data> [<CR><LF>+CMGL: <index>,<stat>,<address>,[<alpha>],[<scts>] [,<address_type>,<body_length>]<CR><LF><data> [...]]
  • otherwise: +CMS ERROR: <err>
AT+CMGL=?+CMGL:(list of supported <stat>s)

Note that <scts> is only shown if the message is incoming, and <alpha> is shown if the <address> has a corresponding entry in the PhoneBook. <address_type> and <body_length> are shown if AT+CSDH=1.

Does not conform entirely with 3GPP TS 27.005, since only text mode (AT+CMGF=1) command is supported.

AT+CMGR Read From Storage Area

This command is used to read an SMS message from a certain location of the message storage area.

CommandPossible Responses
AT+CMGR=<index>
  • +CMGR: <message_status>,<address>,[<address_text>],<service_centre_timestamp>[,<address_type>,<TPDU_first_octet>,<protocol_identifier>,<data_coding_scheme>,<service_centre_address>,<service_centre_address_type>,<sms_message_body_length>]<CR><LF><sms_message_body>
  • +CMGR: <message_status>,<address>,[<address_text>][,<address_type>,<TPDU_first_octet>,<protocol_identifier>,<data_coding_scheme>,[<validity_period>],<service_centre_address>,<service_centre_address_type>,<sms_message_body_length>]<CR><LF><sms_message_body>
AT+CMGR=?+CMGR:(list of valid <index>s)

Note that the response to the set command depends on whether the message stored at the given index is a message that was received by the MT or one that is to be (or has been) sent by the MT.

In the first case, it will contain a <service_centre_timestamp>, and if the second, it may contain a <validity_period>.

The <address> field will contain the sender's address if the message stored at the given index is a message that was received by the MT, and the recipient's address if the message stored at the given index is a message that is to be (or has been) sent by the MT.

The fields <address_type>, <TPDU_first_octet>, <protocol_identifier>, <data_coding_scheme>, <service_centre_address>, <service_centre_address_type>, <sms_message_body_length> and <validity_period> are optional, and enabled by the AT+CSDH command.

The <address_text> field is optional and contains the string associated with the <address> in the address book of the MT.

The <message_status> field can have the following values:

REC UNREADA received, incoming message that is unread
REC READA received, incoming message that has been read
STO UNSENTA stored, outgoing message that is yet to be sent
STO SENTA stored, outgoing message that has been sent

Does not conform completely with 3GPP TS 27.005; this implementation only allows reading of SMS messages in text mode (AT+CMGF=1).

AT+CMGS Send Message

The AT+CMGS command can be used to send SMS messages in either PDU (AT+CMGF=0) or text (AT+CMGF=1) mode.

CommandPossible Responses
AT+CMGS=<da>[,<toda>]<CR>message<ctrl-Z/ESC>+CMGS: <mr>, +CME ERROR: <err> - if in text mode.
AT+CMGS=<length><CR>pdu<ctrl-Z/ESC>+CMGS: <mr>, +CME ERROR: <err> - if in pdu mode.
AT+CMGS=?OK

Execution command sends the message to the network. The message reference value <mr> is returned to the TE upon successful message delivery.

Conforms with: 3GPP TS 27.005.

AT+CMGW Write Message to Memory

The AT+CMGW command stores a message to memory storage. The memory location <index> of the stored message is returned. By default, the message status will be set to "REC UNREAD", however other status values may be given.

CommandPossible Responses
if text mode (AT+CGMF=1): AT+CMGW=[=<address>[,<address_type>[,<stat>]]]<CR> text is enteredctrl-z/ESC
  • +CMGW: <index>
  • +CME ERROR: <err>
AT+CMGW=?

Does not conform completely with 3GPP TS 27.005; in this implementation, SMS message may only be written in text mode.

AT+CMMS More Messages to Send

The AT+CMMS command can be used to inform the modem that several SMS messages will be sent in quick succession, and the link should be held open for more efficient transmission.

CommandPossible Responses
AT+CMMS? \c{+CMMS: 0}
AT+CMGS=?+CMMS: (0-2)

This implementation does not do anything special for this command. The underlying modem will hold the link open when it judges that it would be advantageous to do so.

Conforms with: 3GPP TS 27.005.

AT+CNMI New Message Indications to TE

The AT+CNMI command is used to select the procedure for how receiving new messages from the network is indicated to the TE when the TE is active.

When the TE is inactive, message receiving is done as specified in 3GPP TS 23.038.

CommandPossible Responses
AT+CNMI=[<mode>[,<mt>[,<bm>[,<ds>[,<bfr]]]]]+CME ERROR: <err>
AT+CNMI?+CNMI: <mode>,<mt>,<bm>,<ds>,<bfr>
AT+CNMI=?+CNMI:(list of supported <mode>s), (list of supported <mt>s), (list of supported <bm>s), (list of supported <ds>s), (list of supported <bfr>s)

This implementation is currently a dummy implementation; it does nothing, and always returns error.

Conforms with: 3GPP TS 27.005.

AT+CPMS Preferred Message Storage

The AT+CPMS command can be used to set the preferred message storage for reading and writing SMS messages. The only message storage that is supported by this implementation is SM.

CommandPossible Responses
AT+CPMS=<mem1>[,<mem2>[,<mem3>]]+CPMS: <mem1>,<used1>,<total1>,<mem2>,<used2>,<total2>,<mem3>,<used3>,<total3> or +CME ERROR: <err>
AT+CPMS?+CPMS: <mem1>,<used1>,<total1>,<mem2>,<used2>,<total2>,<mem3>,<used3>,<total3>
AT+CPMS=?+CPMS: ((list of supported <mem1>s),(list of supported <mem2>s),(list of supported <mem3>s))

Conforms with: 3GPP TS 27.007.

AT+CRES Restore Settings

The AT+CRES command restores SMS settings from EEPROM. This is not supported in this implementation.

CommandPossible Responses
AT+CRES[=<profile>]OK
AT+CRES=?OK

This implementation does not conform with 3GPP TS 27.005.

AT+CSAS Save Settings

The AT+CSAS command saved SMS settings to EEPROM. This is not supported in this implementation.

CommandPossible Responses
AT+CSAS[=<profile>]OK
AT+CSAS=?OK

This implementation does not conform with 3GPP TS 27.005.

AT+CSCA Service Center Address

The AT+CSCA command reads or modifies the SMS service center address on the SIM.

CommandPossible Responses
AT+CSCA=<sca>[,<tosca>]OK
AT+CSCA?+CSCA: <sca>,<tosca>
AT+CSCA=?OK

Set command updates the SMS service center address on the SIM. Read command reports the current SMS service center address on the SIM.

Conforms with 3GPP TS 27.005.

AT+CSDH Show Text Mode Parameters

The AT+CSDH command controls whether extended text mode parameters are shown in response to AT+CMGL and AT+CMGR commands in text mode.

CommandPossible Responses
AT+CSDH=<show>
  • OK
  • +CME ERROR: <err>
AT+CSDH?+CSDH: <show>
AT+CSDH=?+CSDH: (0,1)

Conforms with 3GPP TS 27.005.

AT+CSMP Set Text Mode Parameters

The AT+CSMP command sets the additional parameters that are passed in the header of an SMS message when sending messages in text mode (AT+CMGF=1).

CommandPossible Responses
AT+CSMP=[<fo>[,<vp>[,<pid>[,<dcs>]]]]OK
AT+CSMP?+CSMP: 1,167,0,0
AT+CSMP=?OK

This implementation always sends SMS messages with the default GSM values, irrespective of what is set with AT+CSMP. Applications should use PDU mode for sending messages with specific header values.

Conforms with 3GPP TS 27.005.

AT+CSMS Select Message Service

The AT+CSMS command selects the short message service to use.

CommandPossible Responses
AT+CSMS=<service>+CSMS: <mt>,<mo>,<bm>
AT+CSMS?+CSMS: <service>,<mt>,<mo>,<bm>
AT+CSMS=?+CSMS: (list of supported <service>s)

This implementation says that it supports service 0 and 1, mobile-terminated messages, mobile-originated messages, and cell broadcast messages, irrespective of the underlying modem's message support. The underlying modem will select the correct service automatically.

Conforms with 3GPP TS 27.005.

[Previous: Modem Emulator - GPRS] [Next: Modem Emulator - Ignored Commands]


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3