HI i ATTACTHED FINAL WORKING CODE SENDING SMS AND RECEIVE SMS BY USING Q2686 .
IF ANY PROBLEMS PLESASE ASK …
//
/* Appli.c - Copyright Wavecom S.A. © 2002 /
/ /
/ /
/ DISCLAIMER OF WARRANTY /
/ ====================== /
/ This Software is provided free of charge on an ‘as is’ basis. No warranty is given /
/ by Wavecom S.A. in relation to the Software of the uses to which it may be put by you, /
/ the user, or its merchantability, fitness or suitability for any particular purpose /
/ or conditions; and/or that the use of the Software and all documentation relating /
/ thereto by the Licensee will not infringe any third party copyright or other /
/ intellectual property rights. Wavecom S.A. shall furthermore be under no obligation /
/ to provide support of any nature for the Software and the Documentation. /
/ /
/ LIMIT OF LIABILITY /
/ ================== /
/ In no event shall Wavecom S.A. be liable for any loss or damages whatsoever or howsoever /
/ caused arising directly or indirectly in connection with this licence, the Software, /
/ its use or otherwise except to the extent that such liability may not be lawfully /
/ excluded. Notwithstanding the generality of the foregoing, Wavecom S.A. expressly /
/ excludes liability for indirect, special, incidental or consequential loss or damage /
/ which may arise in respect of the Software or its use, or in respect of other equipment /
/ or property, or for loss of profit, business, revenue, goodwill or anticipated savings. /
/ */
//
/************************************************************************/
/ File : Appli.c /
/-------------------------------------------------------------------------/
/ Object : Customer application /
/ /
/ contents : Customer main procedures /
/ /
/ Change : /
/*************************************************************************/
/
$LogWavecom: G:\projet\mmi\pvcsarch\archives\open-mmi\SAMPLES\adl\New_Project\src\appli.c-arc $
-
- Date | Author | Revision | Description
- ----------±-------±---------------±------------------------------------
- 25.10.05 | DPO | 1.1 | * New V4 interface
- ----------±-------±---------------±------------------------------------
- 16.12.02 | dpo | 1.0 | Initial revision.
- ----------±-------±---------------±------------------------------------
*/
#include “adl_global.h”
/***********************************************************************/
/ Mandatory variables /
/-------------------------------------------------------------------------/
/ wm_apmCustomStackSize /
/-------------------------------------------------------------------------/
/***************************************************************************/
const u16 wm_apmCustomStackSize = 1024;
s8 handle;
/**************************************************************************/
/ Local variables /
/**************************************************************************/
void SimHandler(u8 Event);
void SmsCtrlHandler( u8 Event, u16 Nb );
bool SmsHandler( ascii * SmsTel, ascii * SmsTimeOrLength, ascii * SmsText );
/**************************************************************************/
/ Local functions /
/**************************************************************************/
void SimHandler(u8 Event)
{
TRACE((1, " In Sim Handler"));
switch(Event)
{
case ADL_SIM_EVENT_REMOVED:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_REMOVED”);
break;
case ADL_SIM_EVENT_INSERTED:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_INSERTED”);
break;
case ADL_SIM_EVENT_FULL_INIT:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_FULL_INIT”);
adl_smsSend( handle, “9844126494”, “SMS From OpenAT Application”, ADL_SMS_MODE_TEXT );
break;
case ADL_SIM_EVENT_PIN_ERROR:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_PIN_ERROR”);
break;
case ADL_SIM_EVENT_PIN_OK:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_PIN_OK”);
break;
case ADL_SIM_EVENT_PIN_WAIT:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_PIN_WAIT”);
break;
case ADL_SIM_EVENT_PUK_WAIT:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_PUK_WAIT”);
break;
case ADL_SIM_EVENT_PUK_ERROR:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_PUK_ERROR”);
break;
case ADL_SIM_EVENT_FAILURE:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_FAILURE”);
break;
case ADL_SIM_EVENT_NET_LOCK:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SIM_EVENT_NET_LOCK”);
break;
}
}
void SmsCtrlHandler( u8 Event, u16 Nb )
{
TRACE((1, " IN SMS Ctrl handler"));
switch(Event)
{
case ADL_SMS_EVENT_SENDING_OK:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SMS_EVENT_SENDING_OK”);
break;
case ADL_SMS_EVENT_SENDING_ERROR:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SMS_EVENT_SENDING_ERROR”);
break;
case ADL_SMS_EVENT_SENDING_MR:
adl_atSendResponse(ADL_AT_RSP, “\r\nADL_SMS_EVENT_SENDING_MR”);
break;
}
}
bool SmsHandler( ascii * SmsTel, ascii * SmsTimeOrLength, ascii * SmsText )
{
TRACE((1, " IN SMS data handler"));
adl_atSendResponse(ADL_AT_RSP, "\r\nSMS Phone Number: ");
adl_atSendResponse(ADL_AT_RSP, SmsTel);
adl_atSendResponse(ADL_AT_RSP, “\r\n”);
adl_atSendResponse(ADL_AT_RSP, "\r\nSMS Time: ");
adl_atSendResponse(ADL_AT_RSP, SmsTimeOrLength);
adl_atSendResponse(ADL_AT_RSP, “\r\n”);
adl_atSendResponse(ADL_AT_RSP, "\r\nSMS Text: ");
adl_atSendResponse(ADL_AT_RSP, SmsText);
adl_atSendResponse(ADL_AT_RSP, “\r\n”);
return TRUE;
}
/*******************************************************************/
/ Function : adl_main /
/-------------------------------------------------------------------------/
/ Object : Customer application initialisation /
/ /
/-------------------------------------------------------------------------/
/ Variable Name |IN |OUT|GLB| Utilisation /
/--------------------±–±--±–±---------------------------------------/
/ InitType | | | | Application start mode reason /
/--------------------±–±--±–±---------------------------------------/
/***************************************************************************/
void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : Main” ));
// TO DO : Add your initialization code here
adl_simSubscribe((adl_simHdlr_f)SimHandler, NULL);
handle = adl_smsSubscribe((adl_smsHdlr_f)SmsHandler, (adl_smsCtrlHdlr_f)SmsCtrlHandler, ADL_SMS_MODE_TEXT );
}