hi ,
the following is my code . working in Q2687 . My code can able to receive the message but after the timer the message sending to the number is not performed . I have tried many a times can anyone reply what is the problem.
#include “adl_global.h”
const u16 wm_apmCustomStackSize = 1024*3;
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeLength, ascii *SmsText);
void SMS_AUTO_ctrl_Handler(u8 Event, u16 nb);
void envoi_sms(u8 ID, void * Context);
char Bufferdebug[ 200 ];
char Buffer[ 300 ];
s32 sms_automaton_Handle_txt;
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeLength, ascii *SmsText)
{
adl_atSendResponse(1, " IN SMS data handler");
adl_atSendResponse(ADL_AT_RSP, "\r\nSMS Phone Number: ");
adl_atSendResponse(ADL_AT_RSP, SmsTel);
adl_atSendResponse(ADL_AT_RSP, "\r\n");
adl_atSendResponse(ADL_AT_RSP, "\r\nSMS Time: ");
adl_atSendResponse(ADL_AT_RSP, SmsTimeLength);
adl_atSendResponse(ADL_AT_RSP, "\r\n");
adl_atSendResponse(ADL_AT_RSP, "\r\nSMS Text: ");
adl_atSendResponse(ADL_AT_RSP, SmsText);
//wm_strcpy(Buffer,SmsText);
adl_atSendResponse(ADL_AT_RSP, "\r\n");
return TRUE;
}
void SMS_AUTO_ctrl_Handler(u8 Event, u16 nb)
{
return ;
}
void envoi_sms(u8 ID, void * Context)
{
static int compte = 0;
int a;
wm_sprintf ( Buffer, "Sms n°%d: \r\n", compte );
a = adl_smsSend(sms_automaton_Handle_txt, "recepient number", Buffer, ADL_SMS_MODE_TEXT);
wm_sprintf ( Buffer," smsSend = %d: \r\n", a );
printf("Value: %s",Buffer);
adl_atSendResponse ( ADL_AT_UNS, Bufferdebug );
}
void adl_main ( adl_InitType_e InitType )
{
adl_atSendResponse( 1, "Embedded : Appli Init" );
adl_atSendResponse ( ADL_AT_UNS, "\r\nApp Begin\r\n" );
sms_automaton_Handle_txt = adl_smsSubscribe(SMS_AUTO_Handler, SMS_AUTO_ctrl_Handler, ADL_SMS_MODE_TEXT);
adl_tmrSubscribe ( TRUE, 100, ADL_TMR_TYPE_100MS, envoi_sms );
}