8.1.1.14.Informative Examples
Setting new message indications:
AT+CNMI=? (query new message unsolicited result code modes) +CNMI:
OK | (send SM and status report indications to TE |
AT+CNMI=2,1,0,1,0 | |
OK | when TA in command mode, otherwise buffer) |
In this example, the TA is set so that it should send an unsolicited result code +CMTI: <mem>,<index> to the TE when a new
+CMTI: "ME",2 | (new message received in index 2) |
AT+CMGR=2 | (read the message) |
+CMGR: "REC UNREAD","+358507654321","Mr. Jones","95/07/03,17:38:15+04" This is the Mr. Jones testing
OK
In the next example all messages of storage <mem1> are listed (text mode with no detailed header information; GSM 7 bit default alphabet used in message bodies):
AT+CMGL="ALL" | (read all SMs) |
+CMGL: 1,"REC READ","+358501234567","Mr. Smith","95/07/03,17:45:03+04" | |
This is the body of the message. | |
+CMGL: 2,"STO UNSENT","+358501234567","Mr. Smith", | |
This is the body of the reply. | |
OK |
|
The next example shows a method to read new CBMs received from the network (text mode; GSM
7 bit default alphabet used in message bodies):
AT+CNMI=2,,2,,0(CBMs will be sent to the TE)
OK
AT+CPMS="BM";+CMGL (select CBM memory for reading; list all unread CBMs)
+CMGL: 1,"REC UNREAD",100,40,1,3 | (first page of three page weather |
information) |
|
Weather in Finland 3rd of July 1995 | (second page of three page weather |
+CMGL: 2,"REC UNREAD",100,40,2,3 |
information)
Helsinki: cloudy, snow storms,
+CMGL: 3,"REC UNREAD",100,40,3,3 (third page of three page weather information)
Tampere: sunny, 40 degrees Celsius, wind 1 m/s SW OK
Message Sending and Writing Commands
8.1.1.15.3G Send Message +CMGS
Execution command sends message from a TE to the network
Extended AT Commands Manual | Page 40 of 70 |