Preferred Message Format +Cmgf - Multitech MMCModem GPRS (MTMMC-G) Reference Manual

Wireless gsm/gprs modems at commands reference guide
Table of Contents

Advertisement

Command Syntax: AT+CPMS=<mem1>,[<mem2>],[<mem3>] continued
Command
AT+CPMS= "SM"
Note: Selecting SM for reading,
writing and storing has not
changed
AT+CPMS?

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:
In Text mode, all commands and responses are in ASCII characters.
The format selected is stored in EEPROM by the +CSAS command.
Values:
<mode> PDU or Text Mode
<fo>
<mr> (TP-MR)
<da> (TP-DA)
<pid> (TP-PID)
<dcs> (TP-DCS)
<length> (TP-UDL)
TP-UD
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<mode>
Command
AT+CMGF ?
Note: Current message format
AT+CMGF=?
Note: Possible message format
Example: Sending an SMS Message in PDU mode:
Command
AT+CMGF=0
Note: Set PDU mode
AT+CMGS=14<CR>
0001030691214365000004C9E9340B
Note: Send complete MSG in PDU mode, no
SC address
Multi-Tech Systems, Inc. Wireless GSM/GPRS AT Commands (Document Number S000293I)
{'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).
0
PDU mode
1
Text mode
The <pdu> 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)
0x03 (Message Reference)
0x06 0x91 0x21 0x43 0x65 (destination address +123456)
0x00 (Protocol Identifier)
0x00 (Data Coding Scheme: 7 bits alphabet)
0x04 (User Data Length, 4 characters of text)
0xC9 0xE9 0x34 0x0B (User Data: ISSY)
Chapter 9 – Short Messages Commands
Possible responses
+CPMS: "4,10,4,99,4,99
OK
+CPMS: "SM",4,10,"ME",4,99,"ME",4,99
OK
Note: Read SMS from SIM. Write and store SMS from/to flash
Possible responses
+CMGF: 1
OK
Note: Text mode
+CMGF: (0,1)
OK
Note: Text or PDU modes are available
Possible responses
OK
Note: PDU mode valid
+CMGS: 4
OK
Note: MSG correctly sent, <mr> is returned
64

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents