I am writing a simple “send a hello world text” program to run on the FXT009, using the airprime tutorial chapter 22 (sms).
I have a question about the code example provided:
the sms control handler receives the response from the send sms method, but instead of immediately unsubscribing from the service it starts a timer for 1 second and unsubscribes in the timer handler.
Is this because it may expect a response? (although the sms receive handler does nothing with it) or does it need a delay before unsubscribing.
/* sms control handler captures the events received on SMS sending*/
void SmsCtrlHandler(u8 Event,u16 Nb)
{
s8 sRet;
switch(Event)
{
case ADL_SMS_EVENT_SENDING_OK:
adl_atSendResponse(ADL_AT_RSP,"SMS Sent Successfully");
TRACE((1,"Inside ADL_SMS_EVENT_SENDING_OK EVENT"));
/* if the SMS send is successful, subscribe to timer of short duration and in
the timer handler unsubscribe from the SMS service.*/
adl_tmrSubscribe(FALSE, 10, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t) Timerhdl);
TRACE (( 1, "SMS sent successfully, now unsubscribe" ));
break;
case ADL_SMS_EVENT_SENDING_ERROR:
adl_atSendResponse(ADL_AT_RSP,"error sending sms");
sRet = adl_smsSend(smshandle,telno,smstext,ADL_SMS_MODE_TEXT);
...
...