I want to build an application that automaticly reply to SMS begining with keyword: “getdata”. For the first version i just want to answer something like: “DATA from Wavecom supreme”, next version will read data from external datalogger.
I have designed my application based on sample project sms_automaton. As I understand the use of multi_app this is used to controll the application from the computer, so I have not used this. Trying to run the application on Wavecom supreme I am not reciveing any of the TRACE print outs, and application does not function. I am unexperienced in use of ADL and Wavecom software, so I might be on a dead end here?? Any advice? THANKS!!
void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));
TRACE (( AUTO_TRACE_LEVEL, “Start SMS_Automaton application” ));
while(1){
// Subscribe to the SMS Service
sms_automaton_Handle_txt = adl_smsSubscribe(SMS_AUTO_Handler, SMS_AUTO_ctrl_Handler, ADL_SMS_MODE_TEXT);
adl_smsSend(sms_automaton_Handle_txt, *SmsTel_send, *data_txt, ADL_SMS_MODE_TEXT);
}
}
bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText)
{
u16 pos_sms = 0;
bool sms_tobe_fwd = TRUE;
ascii * reply_text = “DATA from Wavecom Supreme”;
ascii Keyword_comp[wm_strlen(smsreply_keyword)];
while ( (pos_sms+1) < wm_strlen(smsreply_keyword) )
{
TRACE (( AUTO_TRACE_LEVEL, "SMS searching "));
//read begining of SmsText for keyword
SmsText[pos_sms]=Keyword_comp[pos_sms];
pos_sms++;
}
//SMS contains Keyword(getdata)?
if(Keyword_comp==smsreply_keyword)
{
TRACE (( AUTO_TRACE_LEVEL, "Keyword match"));
*SmsTel=SmsTel_send;
}
else
{
TRACE (( AUTO_TRACE_LEVEL, "Keyword no match "));
sms_tobe_fwd=FALSE;
}
return sms_tobe_fwd;
}