Before I start explaining, you must be sure that your handset supports SMS read functionality using an AT command.
How can I test whether my handset supports or not?
Answer is pretty simple, try executing AT+CMGR=? AT Command. If it returns ”\r\nOK\r\n” then congratulation your handset modem supports Read SMS functionality.
Reading an SMS from memory location is always a big headache J. I waste lot of time just to read an SMS using AT command.
If you know SMS memory location then task will be simpler.
- First of all set memory type. Use AT+CPMS=”ME” command to set memory from which you are going to read SMS.
- After that execute AT+CMGR=”messageID” to read message.
Tip : Whenever you execute AT command never forget quotation mark (“), Carriage Return etc.
You will get message text directly if you are working under TEXT mode. In case of PDU mode you need to convert PDU into Original Message Text by writing some algorithms.
If you want indication for incoming SMS in your application then you need to enable this functionality.
Try “AT+CNMI=?” Command to test whether new message indication functionality is available in your handset or not.
If result does not contain any error and will return some parameters then congratulation again J
Now, use “AT+CNMI=2,1,0,1” AT command to enable new message indication to TE (terminal equipment).
Last but not the least, don’t forget to use “AT+CSMS=0” AT command set ISO 8859-1 character set.