beautypg.com

Preferred message format +cmgf – Multi-Tech Systems MMCModem GPRS (MTMMC-G) User Manual

Page 64

background image

Chapter 9 – Short Messages Commands

Multi-Tech Systems, Inc. Wireless GSM/GPRS AT Commands (Document Number S000293I)

64


Command Syntax: AT+CPMS=,[],[] continued

Command

Possible responses

AT+CPMS= “SM”
Note: Selecting SM for reading,
writing and storing has not
changed

+CPMS: “4,10,4,99,4,99
OK

AT+CPMS? +CPMS:

“SM”,4,10,”ME”,4,99,”ME”,4,99

OK
Note: Read SMS from SIM. Write and store SMS from/to flash

Preferred Message Format +CMGF

Description:

The message formats supported are text mode and PDU mode.

In PDU mode, a complete SMS Message including all header information is given as a binary string (in
hexadecimal format). Therefore, only the following set of characters is allowed:

{‘0’,’1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’, ‘A’, ‘B’,’C’,’D’,’E’,’F’}. Each pair of characters is

converted to a byte (e.g., ‘41’ is converted to the ASCII character ‘A’, whose ASCII
code is 0x41 or 65).

In Text mode, all commands and responses are in ASCII characters.

The format selected is stored in EEPROM by the +CSAS command.

Values:

PDU or Text Mode

0 PDU

mode

1 Text

mode

The message is composed of the SC address (00 means no SC address given, use default
SC address, read with +CSCA command) and the TPDU message.

In this example, the length of

bytes of the TPDU buffer is 14, coded according to GSM Technical

Specification 03.40.

In this case, the TPDU is: 0x01 0x03 0x06 0x91 0x21 0x43 0x65 0x00 0x00 0x04 0xC9 0xE9 0x34
0x0B, which is GSM 03.40:

0x01 (SMS-SUBMIT, no validity period)

(TP-MR)

0x03 (Message Reference)

(TP-DA)

0x06 0x91 0x21 0x43 0x65 (destination address +123456)

(TP-PID)

0x00 (Protocol Identifier)

(TP-DCS)

0x00 (Data Coding Scheme: 7 bits alphabet)

(TP-UDL) 0x04 (User Data Length, 4 characters of text)

TP-UD

0xC9 0xE9 0x34 0x0B (User Data: ISSY)

TPDU in hexadecimal format must be converted into two ASCII characters; e.g., an byte with
hexadecimal value 0x2A is presented to the ME as two characters ‘2’ (ASCII 50) and ‘A’ (ASCII 65).

Syntax:

Command Syntax: AT+CMGF

Command

Possible responses

AT+CMGF ?

Note: Current message format

+CMGF: 1
OK
Note: Text mode

AT+CMGF=?

Note: Possible message format

+CMGF: (0,1)
OK
Note: Text or PDU modes are available

Example: Sending an SMS Message in PDU mode:

Command

Possible responses

AT+CMGF=0
Note: Set PDU mode

OK
Note: PDU mode valid

AT+CMGS=14
0001030691214365000004C9E9340B
Note: Send complete MSG in PDU mode, no
SC address

+CMGS: 4
OK
Note: MSG correctly sent, is returned

This manual is related to the following products: