PDU message. Some good examples of these sites are
http://smstools3.kekekasvi.com/topic.php?id=288
, and
http://rednaxela.net/pdu.php
.
Deleting a Text Message from Memory
When you store an SMS message on your SIM card, the modem can be set to present
you with the storage location of the message. For example, a text message that is
received and stored in memory location 3 of your SIM card would send the following
unsolicited command to your application.
+CMTI: “SM”, 3
After you have read this message using the
AT+CMGR=3
command, you can then
delete the message using the
+CMGD
command. For example, to delete the message
from location 3 enter the following command.
+CMGD=3
If you set the modem not to notify you of incoming messages or if you prefer to delete
the incoming messages all at once, you can use the
AT+CMGL
command to list all the
messages stored on the SIM.
For example enter the command
AT+CMGL=”all”
The modem returns a list of read,
unread, sent and unsent messages that are stored on the modem.
+CMGL: 2, “REC
READ”,
“15551234567”..
“16/05/05,
14:12:22+08”
Test
message
+CMGL: 3, “REC
UNREAD”,
“16174234455”..
“16/05/05,
15:17:29+08”
Next
message
+CMGL: 4, “STO
SENT”, “16174234455”.. “16/05/05, 15:17:29+08”
Last
message
To delete one of the messages, enter
AT+CMGD=<index>
For example to delete the
2
nd
message enter
AT+CMGD=2
.
To delete all the read messages enter
AT+CMGD=1,1
This will delete message 2
since it has already been read, and will leave messages 3 and 4 in storage.
36