I’m using the SMS APIs. I find that if a SMS is sent to the modem (SL6087) before it boots up, once the Modem boots up and receives the message, the SMS handler returns an empty string for the number and the text.
The basic code…
adl_smsSubscribe(SMSHandler, SMSCtrlHandler, ADL_SMS_MODE_TEXT);
bool SMSHandler (ascii * SmsTel, ascii * SmsTimeLength, ascii * SmsText)
memset((void *) message, 0, sizeof(message));
sprintf(message, “Number: %s, Msg Received: %s”, SmsTel, SmsText);
The trace shows “Number: (null), Msg Received: (null)”
This sms handler works fine except under this particular condition.
This only happens when using the APIs and if I read the message using AT commands it works fine.
Any suggestions as to why this is happening?
I am not able to replicate. I am using Firmware version 7.47.0 and OpenAT version 2.37.0. What are you using?
Running this on the same as you. The SMS APIs are simple to use, so I’m a little lost for what could be going wrong.
I will strip the code down to just the SMS module and will post back if it’s still happening.
May you can use the PDU mode,you can have a try!
Update on what I’ve found here.
In this situation where I get NULL pointers passed back to the callback, I have found that if I send AT+CPMS=“SM”, the callback from adl_smssubscribe() works properly again for subsequent SMSs, although I do need to use AT+CMPL to retrieve the SMS I missed. This seems a little odd though because no where in the application does it change the SMS storage.
Anyway, that is a workaround if anyone else encounters this.