Receive SMS
There are two ways to receive incoming SMS: polling terminal; using events
polling terminals can be used on a regular basis The at+cmgl=0 instruction reads the unread fetch instruction. The method is simple, but many times do not work hard, inefficient, generally not recommended. The following is the main explanation of event law:
Instructions:
At+cnmi=<mode>,<mt>,<bm>,<ds>,<brf>
Parameters:
Mode:
0--cache in terminal
1--Send directly to TE
Mt:
0--Receive new SMS does not return event
1--if the received SMS is stored in ME, the returned
+cmti:<mem>,<index>
2--In addition to Class2 SMS, the new SMS is sent directly to the terminal, which returns:
+cmt:<length><cr><lf><pdu>
3--CLASS3 SMS is returned using the mt=2 method, and other types are returned using the Mt=1 method.
BM:
0--cell broadcast does not notify
2--new cell broadcast notification, return
+cbm:<length><cr><lf><pdu>
3-- cell broadcast notification in CLASS3 format, using bm=2 format
DS:
0--Status report not notified
1--New status report notification, return:
+cds:<length><cr><lf><pdu>
2--returns if the new status report is stored to ME:
+cdsi:<mem>,<index>
BRF:
1--Always 1
Cases:
generally we use at+cnmi=1,1,0,2,1
When a new SMS message is received, the terminal returns:
+cmti:me,5
New status Report:
+cdsi:me,6
The program can determine the return value and use the At+cmgr instruction returns new to SMS.
Transfer from bbs.sendsms.cn
Send and receive SMS via RS232 (iii)