Hi @J_S_Sahoo,
May I ask how’d you compiled the firmware? What was the command you used?
SMS might require VoLTE to work so please try the “VOLTE” build option if you didn’t.
Hi @J_S_Sahoo
The demo code by default reads the SMS message at index 2 (the third message) and will fail if the SIM card doesn’t have a message at that slot.
You can change the second parameter of the read API to 0 and see if you can read the first message.
And of course, make sure there is message to read in the first place.
@J_S_Sahoo
Just want to make sure that you were using the untouched SMS demo at “components\ql-application\sms\sms_demo.c” right? A return value of -1 is kinda odd.
Also, you might want to try the ql_sms_read_msg_ex() API included in the demo and see if that works.
@J_S_Sahoo
A typical way of reading incoming SMS message is to release a message queue to another task that will do the actual reading in the SMS event callback. Reading SMS inside the event callback is not recommended.
@J_S_Sahoo
Here’s a SMS demo I modified: sms_demo.pdf (9.7 KB)
Due to site limitation, I have to change the file extension before uploading. Please change the file extension back to ".c” after downloading or just open the file in a notepad or something. We apologize for the inconvenience.