I am trying to write a code that sends automatically a sms. But I don’t know what i am doing wrong. Can anyone help me?
#include "adl_global.h"
#include "generated.h"
void SimHdlr(u8 Event)
{
switch(Event)
{
case ADL_SIM_EVENT_INSERTED:
{
adl_atSendResponse(ADL_AT_RSP, "Sim Inserted");
break;
}
case ADL_SIM_EVENT_REMOVED:
{
adl_atSendResponse(ADL_AT_RSP, "Sim Removed");
break;
}
case ADL_SIM_EVENT_FULL_INIT:
{
adl_atSendResponse(ADL_AT_RSP, "Sim Initialized");
break;
}
}
}
s32 SmsHdlr(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText)
{
s32 sms_tobe_fwd = ADL_SMS_FORWARD_INDICATION_AND_STORE;
TRACE (( 1, "In SMS_Handler - 1 more SMS received" ));
return sms_tobe_fwd;
}
void SmsCtrlHdlr(u8 Event, u16 Nb)
{
switch (Event)
{
case ADL_SMS_EVENT_SENDING_OK:
{
adl_atSendResponse(ADL_AT_RSP, "Msg Send");
break;
}
case ADL_SMS_EVENT_SENDING_ERROR:
adl_atSendResponse(ADL_AT_RSP, "Msg Send Err");
break;
}
TRACE (( 1, "In SMS_ctrl_Handler" ));
}
void main_task(void)
{
adl_InitType_e init=adl_InitGetType();
adl_simSubscribe(SimHdlr, NULL);
u8 a=adl_smsSubscribeExt(SmsHdlr, SmsCtrlHdlr, ADL_SMS_MODE_TEXT);
adl_smsSend(a, "**********", "Test", ADL_SMS_MODE_TEXT);
}