SMS Notifier Problem When Application Not Run | developer.brewmp.com SMS Notifier Problem When Application Not Run | developer.brewmp.com

Developer

SMS Notifier Problem When Application Not Run

Forums:

Hello,

I have question about SMS Notifier. I register SMS notifier (in init function) in my application that will listen specific SMS message that come to device. My application can receive EVT_NOTIFY properly, when application is still run. But when application is exit or stop and then i try to send sms to device using other handset, actually EVT_NOTIFY is received also in my application, but device suddenly become hang. I don't know why it happen.

My application can detect sms sender and sms message get from EVT_NOTIFY when application still run. 

Please help me to solve this issue.

case EVT_NOTIFY:

{

int nSize = 0;

int tanda = 0;

AEENotify * pNotify = (AEENotify *)dwParam;

 

if(ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_APPLETCTL, (void **)&pMe->pIAppletctl) !=SUCCESS)

{

pMe->pIAppletctl = NULL;

return FALSE;

}

 

if (ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_SMS, (void**)&pMe->pISms) != SUCCESS)

{

return FALSE;

}

 

if (pNotify->cls == AEECLSID_SMSNOTIFIER)

{

if(((AEESMS_TYPE_TEXT << 16) | NMASK_SMS_TYPE) == pNotify->dwMask)

{

SMSMsgOpt pwo;

int payloadEnc;

const char *number;

const char *messg;

 

ISMS_ReceiveMsg(pMe->pISms, (uint32)pNotify->pData, &pMe->pISMSMsg);

ISMSMSG_GetOpt(pMe->pISMSMsg, MSGOPT_FROM_DEVICE_SZ, &pwo);

number = pwo.pVal;

ISMSMSG_GetOpt(pMe->pISMSMsg, MSGOPT_PAYLOAD_ENCODING, &pwo);

payloadEnc = (int) pwo.pVal;

 

switch(payloadEnc) {

case AEE_ENC_ISOLATIN1:

ISMSMSG_GetOpt(pMe->pISMSMsg, MSGOPT_PAYLOAD_SZ, &pwo);

messg = pwo.pVal;

//SendMessage(pMe,messg);

// Handle Message

break;

case AEE_ENC_UNICODE:

ISMSMSG_GetOpt(pMe->pISMSMsg, MSGOPT_PAYLOAD_WSZ, &pwo);

// Handle Message

messg = pwo.pVal;

//SendMessage(pMe,messg);

break;

default:

messg = "encoding error";

//SendMessage(pMe,messg);

// Handle other encodings

break;

}

if (pMe->pISMSMsg) {

ISMSMSG_Release(pMe->pISMSMsg);

pMe->pISMSMsg = NULL;

}

 

if(STRCMP("you can say anything here",messg) == 0)

{

}

}

}

}

return TRUE;