AT+CMGL - List Received Messages in PDU Mode
The AT+CMGL command lists messages received on the GSM modem. It can be used to get all received messages, all unread messages or all read messages.
Command | Positive Response |
---|---|
AT+CMGL=<stat><CR> | +CMGL: <index>,<stat>,[<alpha>],<length><CR><LF><pdu><CR><LF> ... OK |
Parameters
<stat>: Status = 0 - unread, 1 - read, 4 - all
<index>: Index number of the message
<alpha>: Originator name (if available in the phonebook)
<length>: The length of the PDU
<pdu>: The received SMS-DELIVER PDU
<CR>: ASCII character 13
<LF>: ASCII character 10
Decode an SMS-DELIVER PDU
Decode the received PDU with the online SMS-DELIVER PDU decoder.
Example
Set the GSM modem to SMS PDU Mode, list all received messages and remove the messages from the 3G modem.
<code>AT+CMGF=0 OK AT+CMGL=4 +CMGL: 1,0,,39 07911326040011F5240B911326880736F40000111081017362401654747A0E4ACF41F4329E0E6A97E7F3F0B90C8A01 +CMGL: 2,0,,39 07911326040011F5240B911326880736F40000111081017323401654747A0E4ACF41F4329E0E6A97E7F3F0B90C9201 OK AT+CMGD=1 OK AT+CMGD=2 OK </code>
See also
AT+CMGF - Set SMS Text Mode or SMS PDU Mode
AT+CMGD - Delete a Received Message