20.2. Selecting the
Operating Mode (AT+CMGF)
AT command +CMGF (command name in text: Message Format) is used to
select the operating mode of the GSM/GPRS modem or mobile phone. It
takes one parameter. The value of the parameter can either be 0 or 1.
The values 0 and 1 refer to SMS PDU mode and SMS text mode
respectively. SMS PDU mode is the default mode if it is implemented
on the mobile device.
find out the operating mode(s) supported by a GSM/GPRS modem or
mobile phone, perform a test operation with the +CMGF AT command.
Below shows the response returned from my Nokia 6021 mobile phone
after the execution of the command line "AT+CMGF=?":
information response "+CMGF: (0,1)" indicates Nokia 6021
supports both PDU mode and text mode.
change the operating mode of a GSM/GPRS modem or mobile phone,
perform a set operation with the +CMGF AT command. The following
example demonstrates how to set the operating mode to SMS text mode:
the operating mode specified is not supported by the GSM/GPRS modem
or mobile phone, the final result code "ERROR" will be
find out the operating mode currently used by a GSM/GPRS modem or
mobile phone, perform a read operation with the +CMGF AT command.
Here is an example:
response above indicates the GSM/GPRS modem or mobile phone is using
SMS PDU mode.
Feedback Form (ExpandCollapse)