Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hello,

I need to send a simple SMS text message from a BREW 3.1 device.
Please send a short example for ISMS.
I am starting to believe that I should use Add Reference (ISMS_AddRef) instead of QueryInterface for the ISMS interface pointer.
Also, I'm not sure of the relative merits of chosing ISMS_SendMsg over ITAPI_SendSMS. I have a short example for ITAPI without the interface pointer initialization:
ITAPI_SendSMS(pITapi, "8885551212", "Hello World", 0, MOSMSNotify, pThis);
void MOSMSNotify(void *p, int result)
{
if(result == AEEMOSMS_ERR_NO_ERR)
DBGPRINTF("Success!");
else
DBGPRINTF("Failure &d", result);

Should I use ISMS or ITAPI? Example?

- Thanks for your help, David Manpearl

Following code for your information:
/*************************************************************************/
SMSMsgOpt pwo;
char SendText[200] = "Sending Msg...";
AECHAR SendTextShow[200];
ISMS *m_pISMS = NULL;
ISMSMsg *m_pISMSMsg = NULL;
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,
AEECLSID_SMSMSG,
(void**)&m_pISMSMsg);
// Make a new SMS service
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,
AEECLSID_SMS,
(void**)&m_pISMS);
pwo.nId = MSGOPT_COPYOPTS;
pwo.pVal = (void*)TRUE;
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_TO_DEVICE_SZ;
pwo.pVal = (void*)"1234567890";
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_MOSMS_ENCODING;
pwo.pVal = (void*)AEESMS_ENC_ASCII;
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_PAYLOAD_SZ;
pwo.pVal = (void*)"Hello! ^_^ ";
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_PAYLOAD_ENCODING;
pwo.pVal = (void *)AEE_ENC_ISOLATIN1;
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
//Get Send result by system callback
CALLBACK_Init(&pMe->m_sSendMessageCallback, MySMS_SendCallBack, pMe);
ISMS_SendMsg(m_pISMS,
m_pISMSMsg,
&pMe->m_sSendMessageCallback,
&pMe->m_dwSMSSendResult);
**************************************************************************/
hope that helpful to you.

Following code for your information:
/*************************************************************************/
SMSMsgOpt pwo;
char SendText[200] = "Sending Msg...";
AECHAR SendTextShow[200];
ISMS *m_pISMS = NULL;
ISMSMsg *m_pISMSMsg = NULL;
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,
AEECLSID_SMSMSG,
(void**)&m_pISMSMsg);
// Make a new SMS service
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,
AEECLSID_SMS,
(void**)&m_pISMS);
pwo.nId = MSGOPT_COPYOPTS;
pwo.pVal = (void*)TRUE;
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_TO_DEVICE_SZ;
pwo.pVal = (void*)"1234567890";
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_MOSMS_ENCODING;
pwo.pVal = (void*)AEESMS_ENC_ASCII;
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_PAYLOAD_SZ;
pwo.pVal = (void*)"Hello! ^_^ ";
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
pwo.nId = MSGOPT_PAYLOAD_ENCODING;
pwo.pVal = (void *)AEE_ENC_ISOLATIN1;
ISMSMSG_AddOpt(m_pISMSMsg,&pwo);
//Get Send result by system callback
CALLBACK_Init(&pMe->m_sSendMessageCallback, MySMS_SendCallBack, pMe);
ISMS_SendMsg(m_pISMS,
m_pISMSMsg,
&pMe->m_sSendMessageCallback,
&pMe->m_dwSMSSendResult);
**************************************************************************/
hope that helpful to you.