Hi
I have a FXT009 and want to try the SMS functionality.
The code I use is taken from “AirPrime - Open AT Tutorial”
/* sample code implementing the SMS send functionality */
#include "adl_global.h"
#include "adl_sms.h"
const u16 wm_apmCustomStackSize = 4096;
// Local variables
u8 Event;
u16 Nb;
s8 smshandle;
ascii telno[]="0046703565444";
ascii *smstimelnth;
ascii *smstext="The text for sms goes here";
s8 sendhandle;
s8 unshandle;
//Local Functions
bool SmsHandler(ascii *telno, ascii *smstimelnth,ascii *smstext) {
adl_atSendResponse(ADL_AT_UNS,"inside sms handler");
return (0);
}
void Timerhdl(u8 id) {
TRACE (( 1, "Unsubscribing the SMS" ));
adl_smsUnsubscribe(smshandle);
}
/* sms control handler captures the events received on SMS sending*/
void SmsCtrlHandler(u8 Event,u16 Nb){
/*TRACE((1,"INSIDE SMSCTRL HANDLER, telno="));
TRACE((1,telno));
TRACE((1,smstext));*/
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);
TRACE (( 1, "error sending sms, try again" ));
break;
case ADL_SMS_EVENT_SENDING_MR:
TRACE (( 1, "sms send successful" ));
TRACE((1,"Inside ADL_SMS_EVENT_SENDING_MR EVENT"));
break;
default:
adl_atSendResponse(ADL_AT_UNS,"Inside default");
break;
}
}
bool wind_4_handler(adl_atUnsolicited_t * paras) {
s8 sRet=0;
TRACE((1,"Inside wind 4 handler"));
sRet = adl_smsSend(smshandle,telno,smstext,ADL_SMS_MODE_TEXT);
return (0);
}
// Main function
void adl_main ( adl_InitType_e InitType ) {
TRACE (( 1, "Embedded Application: Main " ));
smshandle=adl_smsSubscribe((adl_smsHdlr_f)SmsHandler,(adl_smsCtrlHdlr_f)SmsCtrlHandler,ADL_SMS_MODE_TEXT);
adl_atUnSoSubscribe("+WIND: 4",wind_4_handler);
}
And the TRACES I get are these:
2013/05/17;13:32:31:241;002;ADL;1;Binary header at 002A0000
2013/05/17;13:32:31:242;001;ADL;16;[ADL PORT] subs (002A3759) : 0
2013/05/17;13:32:31:243;001;ADL;16;[ADL PORT] subs (002A537F) : 1
2013/05/17;13:32:31:244;001;ADL;22;[ADL] flash subs 2 : 0
2013/05/17;13:32:31:244;002;ADL;22;Flh Obj 0000 Len : 0
2013/05/17;13:32:31:245;001;ADL;16;[ADL PORT] event : 0 (port 80 ; state 0)
2013/05/17;13:32:31:246;001;ADL;16;[ADL PORT] event : 0 (port 01 ; state 0)
2013/05/17;13:32:31:247;001;ADL;22;Flh Obj 0000 Len : 0
2013/05/17;13:32:31:247;002;ADL;22;Write Flh Obj 0000 (4) : 0 ; 393192
2013/05/17;13:32:31:248;002;ADL;16;[ADL PORT] unsubs (1) : 0
2013/05/17;13:32:31:357;001;ADL;1;Embedded Application: Main
2013/05/17;13:32:31:358;001;ADL;26;SMS subs : 0
2013/05/17;13:32:31:473;001;ADL;16;[ADL PORT] event : 0 (port 03 ; state 0)
2013/05/17;13:32:45:006;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:007;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:008;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:009;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:010;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:016;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:018;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:021;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:022;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:023;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:024;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:029;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:031;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:033;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:034;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:037;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:042;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:044;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:044;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:046;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:047;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:049;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:049;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:049;004;ADL;26;SMS send : 0
2013/05/17;13:32:45:049;005;ADL;1;error sending sms, try again
2013/05/17;13:32:45:049;007;ADL;26;SMS send : 0
2013/05/17;13:32:45:065;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:099;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:100;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:101;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:102;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:103;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:104;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:107;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:108;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:110;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:111;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:112;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:113;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:114;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:115;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:116;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:117;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:118;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:119;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:120;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:120;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:121;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:122;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:182;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:183;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:184;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:185;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:186;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:190;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:191;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:194;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:196;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:197;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:198;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:198;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:200;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:201;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:202;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:202;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:203;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:204;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:205;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:206;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:207;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:208;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:208;003;ADL;26;SMS send : 0
2013/05/17;13:32:45:209;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:210;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:211;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:212;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:212;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:213;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:214;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:217;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:218;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:219;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:219;002;ADL;1;error sending sms, try again
2013/05/17;13:32:45:220;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:221;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:222;002;ADL;26;SMS send : 0
2013/05/17;13:32:45:223;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:224;001;ADL;26;SMS send : 0
2013/05/17;13:32:45:225;001;ADL;1;error sending sms, try again
2013/05/17;13:32:45:230;001;ADL;1;Binary header at 002A0000
2013/05/17;13:32:45:231;001;ADL;16;[ADL PORT] subs (002A3759) : 0
2013/05/17;13:32:45:231;002;ADL;16;[ADL PORT] subs (002A537F) : 1
2013/05/17;13:32:45:232;001;ADL;22;[ADL] flash subs 2 : -4
2013/05/17;13:32:45:233;001;ADL;22;Flh Obj 0000 Len : 4
2013/05/17;13:32:45:234;001;ADL;22;Read Flh Obj 0000 (4) : 0
2013/05/17;13:32:45:236;001;ADL;16;[ADL PORT] event : 0 (port 80 ; state 0)
2013/05/17;13:32:45:237;001;ADL;16;[ADL PORT] event : 0 (port 01 ; state 0)
2013/05/17;13:32:45:238;001;ADL;22;Flh Obj 0000 Len : 4
2013/05/17;13:32:45:239;001;ADL;16;[ADL PORT] unsubs (1) : 0
2013/05/17;13:32:45:245;001;ADL;1;Embedded Application: Main
2013/05/17;13:32:45:246;001;ADL;26;SMS subs : 0
2013/05/17;13:32:45:248;001;SYS;1;OAT Task index : 1
2013/05/17;13:32:45:250;002;SYS;1;Watch dog reset. Tsk 31
2013/05/17;13:32:45:285;001;ADL;16;[ADL PORT] event : 0 (port 03 ; state 0)
I assume that the sample code from the tutorial is bullet proof, so maybe I am doing something wrong.
BR