beautypg.com

Westermo GD-01 User Manual

Page 58

background image

58

6196-2220

+CMGF – Preferred Message Format

Description:

The message formats supported are text mode and PDU mode. In PDU mode, a com-
plete SMS Message including all header information is given as a binary string (in hexa-
decimal 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 or 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.

Syntax:

AT+CMGF

Command example

Possible responses

Note

AT+CMGF ?

+CMGF: 1

Current message format:

OK

Text mode

AT+CMGF=?

+CMGF: (0-1)

Possible message format:
Text or PDU OK
modes are available

Example, sending an SMS Message in PDU mode

Command example

Possible responses

Note

AT+CMGF=0

OK

Set PDU mode

AT+CMGS=14 +CMGS: 4

000103069121436500

Send complete MSG in

0004C9E9340B

OK

PDU mode, no SC
address

Defined values:

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 octets of the TPDU buffer is 14, coded as GSM 03.40. In this case
the TPDU is: 0x01 0x03 0x06 0x91 0x21 0x43 0x65 0x00 0x00 0x04 0xC9 0xE9 0x34
0x0B, which means regarding 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. octet
with hexadecimal value 0x2A is presented to the ME as two characters ‘2’ (ASCII 50) and
‘A’ (ASCII 65).

B A C K