More than one SMS can't be send


#1

Hi,

I used the ode as follows to send SMS continuously to a mobile no, But i got only the first sms " HELLO WORLD!", only the next SMS i was not received?

Is it must to wait for +WIND:4 response

void main_task ( void )
{
	adl_InitType_e adlInitType = adl_InitGetType ();
    /* SMS automaton test application */
    TRACE ( ( SA_TRACE_LEVEL, "SMS automaton sample main" ) );
    TRACE ( ( SA_TRACE_LEVEL, __DATE__ ) );
    TRACE ( ( SA_TRACE_LEVEL, __TIME__ ) );

    TRACE ( ( SA_TRACE_LEVEL, "Start SMS_Automaton application" ) );

    /* Subscribe to the SMS Service */
    SmsAutoHandle = adl_smsSubscribe ( cbSmsAutoHandler, cbSmsAutoCtrlHandler,
                    ADL_SMS_MODE_TEXT );
    TRACE ( ( SA_TRACE_LEVEL, "adl_smsSubscribe : "
            "SmsAutoHandle %d", SmsAutoHandle ) );

    adl_atUnSoSubscribe("+WIND: 4",wind_4_handler);
}
bool wind_4_handler(adl_atUnsolicited_t * paras)
{
s8 sRet=0,var1=0,var2=0;
TRACE((1,"Inside wind 4 handler"));
/* Use adl_smsSend () function to send SMS*/
var1++;
if(var1==1){
sRet = adl_smsSend(SmsAutoHandle, "9092363289", "Hello World!", ADL_SMS_MODE_TEXT);
}
var2++;
if(var2==1){
sRet = adl_smsSend(SmsAutoHandle, "9092363289", "check sms send", ADL_SMS_MODE_TEXT);
}

return (0);
}

Can anyone help me
thanks in advance


#2

You need to wait for the first SMS to be sent before sending the second. You can’t just look at the return value of adl_smsSend, you must look at the SMS control callback function you specified in your subscription to the SMS service. Only once you get a SMS successfully sent in the callback handler can you send the next SMS.

See this thread for a detailed explanatition: [url]https://forum.sierrawireless.com/t/error-sending-more-than-one-sms/3151/1]


#3

Hi,
Based on your reply i implemented the adl wait evenat as follows for that i got watchdog reset,
so can you explain me in my code which place i need to correct?

static u32 l_u32_MyEvent = NULL;
void main_task ( void )
{
	adl_InitType_e adlInitType = adl_InitGetType ();
    /* SMS automaton test application */
    TRACE ( ( SA_TRACE_LEVEL, "SMS automaton sample main" ) );
    TRACE ( ( SA_TRACE_LEVEL, __DATE__ ) );
    TRACE ( ( SA_TRACE_LEVEL, __TIME__ ) );

    TRACE ( ( SA_TRACE_LEVEL, "Start SMS_Automaton application" ) );

    /* Subscribe to the SMS Service */
    SmsAutoHandle = adl_smsSubscribe ( cbSmsAutoHandler, cbSmsAutoCtrlHandler,
                    ADL_SMS_MODE_TEXT );
    TRACE ( ( SA_TRACE_LEVEL, "adl_smsSubscribe : "
            "SmsAutoHandle %d", SmsAutoHandle ) );

    l_u32_MyEvent = adl_eventCreate(0);

    adl_atUnSoSubscribe("+WIND: 4",wind_4_handler);
}

bool wind_4_handler(adl_atUnsolicited_t * paras)
{
s8 sRet=0,var1=0,var2=0;
TRACE((1,"Inside wind 4 handler"));
/* Use adl_smsSend () function to send SMS*/
var1++;
if(var1==1){
TRACE((1,"var1=%d",var1));
sRet = adl_smsSend(SmsAutoHandle, "9092363289", "Hello World!", ADL_SMS_MODE_TEXT);
}

while(1)
{
	adl_eventWait(l_u32_MyEvent,1,NULL,	ADL_EVENT_WAIT_ANY,	ADL_EVENT_NO_TIMEOUT);

	adl_eventClear(l_u32_MyEvent,1,NULL);
}
var2++;
if(var2==1){
TRACE((1,"var2=%d",var2));
sRet = adl_smsSend(SmsAutoHandle, "9092363289", "check sms send", ADL_SMS_MODE_TEXT);
}

return (0);
}

the adl_eventWait calls i referred ADL used guide only

Thanks


#4

I think you didn’t read the whole post that was provided previously. Study that post, and also this one:
[url]https://forum.sierrawireless.com/t/delay-function-not-working-as-desired/6240/1]