WP7702 sms receive is unstable

I have a Legato app running on WP7702 which can receive sms from cell phones, but it doesn’t work consistently. I had it working this afternoon, but now it stops decode incoming sms, the log displays the following:

Jun 1 22:23:08 swi-mdm9x28-wp user.info Legato: INFO | modemDaemon[1199]/modemDaemon T=main | smsPdu.c DecodeUserDataField() 1071 | messageLen 24, pos 29, size 24
Jun 1 22:23:08 swi-mdm9x28-wp user.info Legato: INFO | avcDaemon[1149]/avcDaemon T=main | avcServer.c ProcessWakeupSms() 4359 | SMS is too short or doesn’t start with prefix ‘LWM2M’, ignoring

Can anyone help?

suggest you stopping your application and try CM tool first to monitor incoming SMS:

cm sms monitor &

I suspect it might because the sim on WP7702 is a French number(I locate in Canada though). Despite it had no problem to receive in the past, there is a terrible delay on SMS transmission…
Is it possible I insert a local sim card on WP7702?


I might be wrong, I tried with cm sms monitor, it received instantly, but the app didn’t get it… because it didn’t print on the log

Then seems your app has problem

Where can I find the sample code to receive sms?

Thank you!!
However, what is the difference if I wrote it in this way:

static void RxMessageHandler

(

le_sms_MsgRef_t msgRef,

void*            contextPtr

)

{

le_result_t  res;

char text[LE_SMS_TEXT_MAX_BYTES] = {0};

if(!textReceived) {

    textReceived = true;

    LE_INFO("A New SMS message is received with ref.%p", msgRef);

    if (le_sms_GetFormat(msgRef) == LE_SMS_FORMAT_TEXT)

    {

        //get sender number

        res = le_sms_GetSenderTel(msgRef, tel, sizeof(tel));

        if(res != LE_OK)

        {

            LE_ERROR("le_sms_GetSenderTel has failed (res.%d)!", res);

        }

        else

        {

            LE_INFO("Message is received from %s.", tel);

        }

        //get text content

        res = le_sms_GetText(msgRef, text, sizeof(text));

        if(res != LE_OK)

        {

            LE_ERROR("le_sms_GetText has failed (res.%d)!", res);

        }

        else

        {

            res = le_sms_DeleteFromStorage(msgRef);

            if(res != LE_OK)

            {

                LE_ERROR("le_sms_DeleteFromStorage has failed (res.%d)!", res);

            }

            else

            {

                LE_INFO("the message has been successfully deleted from storage.");

            }

            le_sms_Delete(msgRef);

            LE_INFO("message object deleted from memory.");

            LE_INFO("Message content: \"%s\"", text);
        }
    }

}

le_result_t sms_Receiver

(

void

)

{

RxHdlrRef = le_sms_AddRxMessageHandler(RxMessageHandler, NULL);

if (!RxHdlrRef)

{

    LE_ERROR("le_sms_AddRxMessageHandler has failed!");

    return LE_FAULT;

}

else

{

    return LE_OK;

}

}

does it work if you use the code in CM tool?

It works, but not constantly stable. I pointed out in the previous reply, an incoming sms can be detected by cm sms monitor, but not always by the code

I looked at the sample code you posted, I’m wondering how can I reset smsType and format on WP7702, I think by default they are LE_SMS_TYPE_RX and LE_SMS_FORMAT_TEXT

do you mean you have ported the CM sample code to your application already, but it is not always working, and “cm sms monitor” is always working fine?