I used adl to send a SMS to my friend and it successed.
But my friend tell me the content about the SMS was a unkonwn sympol(not the correct content-“abc123” )
It’s just like that the mesage hasn’t been send completely
Another problem is I recevied the “ok” response twice (almost at the same time)for one SMS sending.
How to improve my code?
It is really not the initializing problem,because i have test it already
#include "adl_global.h"
#include "wm_stdio.h"
u32 wm_apmCustomStack[512];
u16 wm_apmCustomStackSize=sizeof(wm_apmCustomStack);
s8 s;
bool smsHandle(ascii *Smstel,ascii *SmsTimeLength,ascii *SmsText)
{
return TRUE;
}
void smsCtrlHandle(u8 Event,u16 Nb)
{
switch(Event)
{
case ADL_SMS_EVENT_SENDING_OK:
case ADL_SMS_EVENT_SENDING_MR:
adl_atSendResponse(ADL_AT_UNS,"SMS_EVENT_SENDING_OK");
break;
case ADL_SMS_EVENT_SENDING_ERROR:
adl_atSendResponse(ADL_AT_UNS,"SMS_EVEMT_SENDING_ERROR");
break;
}
}
void tmrHandle(u8 ID)
{
adl_smsSend(s,"+8613588460198","abc123",ADL_SMS_MODE_TEXT);
}
void adl_main(adl_InitType_e InitType)
{
s=adl_smsSubscribe(smsHandle,smsCtrlHandle,ADL_SMS_MODE_TEXT);
adl_tmrSubscribe(TRUE,200,ADL_TMR_TYPE_100MS,tmrHandle);
}