http://www.cellular.co.za/hayesat.htm#SMS%20Command%20Set
AT+CMGF: Message Format:
Command Possible response(s)
+CMGF=[<mode>]
+CMGF?
+CMGF: <mode>
+CMGF=?
+CMGF: (list of supported <mode>s)
<mode>: 0: PDU mode;1: text mode;
In our case, we initialize message format as 1
AT+CSCA: Service Center Address:
Command Possible response(s)
+CSCA=<sca>[,<tosca>]
+CSCA?
+CSCA: <sca>,<tosca>
+CSCA=?
<sca> = service center address;
SCA should contain the country code number. Sending an SMS will not work when the SCA number is not entered
AT+CMGL: List Messages:
Command Possible response(s)
+CMGL[=<stat>]
+CMGL: message...
+CMGL=?
+CMGL: (list of supported <stat>s)
<stat>: status of messages to be read.
defined values:
0: received unread
1: received read;
2: stored unsent;
3: stored sent;
4: all;
can also represent the number with these: (eg:AT+CMGL="ALL")
"REC UNREAD": received unread
"REC READ" : received read;
"STO UNSENT": stored unsent;
"STO SENT" : stored sent;
"ALL" : all;
AT+CMGR: Read Message:
Command Possible response(s)
+CMGR=<index>
+CMGR: message... +CMGR=?
AT+CMGS: Send Message:
Command Possible response(s)
+CMGS=<da>[,<toda>]
+CMGS: <mr> +CMGS=?
<da> = Destination Address;
AT+CMGD: Delete Message:
Command Possible response(s)
+CMGD=<index>
+CMGD=?
Important ERROR messages:CMS Errors:
300: ME Failure;
302: Operation not allowed;
303: Operation not supported;
304: Invalid PDU mode parameter;
305: Invalid text mode parameter;
320: memory failure;
321: invalid memory index;
322: memory full;
330: SCA unknown;
500: Unknown error
I think this is useful but yet to be tested
AT+CNMI: New Message indication to TE
Command Possible response(s) +CNMI=[<mode>[,<mt>[,<bm>[,<ds>[,<bfr>]]]]]
+CNMI?
+CNMI: <mode>,<mt>,<bm>,<ds>,<bfr>
+CNMI=?+CSCB: (list of supported <mode>s,<mt>s,<bm>s,<ds>s,<bfr>s)
<mode>: 0: buffer in TA;
1: discard indication and reject new SMs when TE-TA link is reserved; otherwise forward directly;
2: buffer new Sms when TE-TA link is reserved and flush them to TE after reservation; otherwise forward directly to the TE;
3: forward directly to TE;<mt>: 0: no SMS-DELIVER are routed to TE;
1: +CMTI: <mem>,<index> routed to TE;
2: for all SMS_DELIVERs except class 2: +CMT: .... routed to TE; class 2 is indicated as in <mt>=1;
3: Class 3: as in <mt>=2;
other classes: As in <mt>=1;
<bm>: same as <mt>, but for CBMs;
<ds>: 0: No SMS-STATUS-REPORT are routed to TE;
1: SMS-STATUS-REPORTs are routed to TE, using +CDS: ...
<bfr>: 0: TA buffer is flushed to TE (if <mode>=1..3);
1: TA buffer is cleared (if <mode>=1..3);
---> Only when <mt> is different from 0, you will get a message that a new SMS has been received.