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

Developer

Forums

Forums:

Is it neccessary to install the brew application to actual device for using the ISMS interface. or we can use it on the emulator.
seeking your help.....
Thanks
Regards
Anil

The emulator supports ISMS.
-Erik

The emulator supports ISMS.
-Erik

ebrowne wrote:The emulator supports ISMS.
-Erik
Hi
Thanks
I 've copied the following code for sending sms.
void BookMyShow4_SendSMS(BookMyShow4 *pMe)
{
boolean nResult;
//IWebOpts sOpts;
SMSMsgOpt sOpts[2];
TAPIStatus pStatus;
pMe->pISMS = NULL;
pMe->pISMSMsg = NULL;
pMe->pITAPI = NULL;
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMSMSG,(void**)&(pMe->pISMSMsg));
// Make a new SMS service
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMS,(void**)&(pMe->pISMS));
// Configure our options buffer. Options will be added
// "one at a time"
sOpts[1].nId = MSGOPT_END;
sOpts[1].pVal = NULL;
// We need to instruct the ISMSMessage to copy options that
// are passed
sOpts[0].nId = MSGOPT_COPYOPTS;
sOpts[0].pVal = (void *)TRUE;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// Set the destination address on our outbound sms message
sOpts[0].nId = MSGOPT_TO_DEVICE_SZ;
//This is the phone no.
sOpts[0].pVal = (void *)"+919910152405";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// priority
sOpts[0].nId = MSGOPT_PRIORITY;
sOpts[0].pVal = (void *)AEESMS_PRIORITY_NORMAL;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// sender address (from). We get the sender's MDN from ITAPI
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_TAPI,(void **)&pMe->pITAPI);
ITAPI_GetStatus(pMe->pITAPI,&pStatus);
ITAPI_Release(pMe->pITAPI);
sOpts[0].nId = MSGOPT_FROM_DEVICE_SZ;
sOpts[0].pVal = (void *)&pStatus.szMobileID[5];
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_MOSMS_ENCODING;
sOpts[0].pVal = (void *)AEESMS_ENC_ASCII;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_SZ;
sOpts[0].pVal = (void *)"Hello World";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_ENCODING;
sOpts[0].pVal = (void *)AEE_ENC_ISOLATIN1;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
CALLBACK_Init(&pMe->m_sSendMessageCallback,SMSSendCB,pMe);
ISMS_SendMsg(pMe->pISMS,pMe->pISMSMsg,&pMe->m_sSendMessageCallback,&pMe->m_dwSMSSendResult);
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_NORMAL,L"Message sent",-1,30,30,NULL,IDF_ALIGN_MIDDLE);
IDISPLAY_Update(pMe->a.m_pIDisplay);

The code is displaying "Message sent" . but nothing is sent to the phone in real. What could be the reason?

ebrowne wrote:The emulator supports ISMS.
-Erik
Hi
Thanks
I 've copied the following code for sending sms.
void BookMyShow4_SendSMS(BookMyShow4 *pMe)
{
boolean nResult;
//IWebOpts sOpts;
SMSMsgOpt sOpts[2];
TAPIStatus pStatus;
pMe->pISMS = NULL;
pMe->pISMSMsg = NULL;
pMe->pITAPI = NULL;
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMSMSG,(void**)&(pMe->pISMSMsg));
// Make a new SMS service
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_SMS,(void**)&(pMe->pISMS));
// Configure our options buffer. Options will be added
// "one at a time"
sOpts[1].nId = MSGOPT_END;
sOpts[1].pVal = NULL;
// We need to instruct the ISMSMessage to copy options that
// are passed
sOpts[0].nId = MSGOPT_COPYOPTS;
sOpts[0].pVal = (void *)TRUE;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// Set the destination address on our outbound sms message
sOpts[0].nId = MSGOPT_TO_DEVICE_SZ;
//This is the phone no.
sOpts[0].pVal = (void *)"+919910152405";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// priority
sOpts[0].nId = MSGOPT_PRIORITY;
sOpts[0].pVal = (void *)AEESMS_PRIORITY_NORMAL;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
// sender address (from). We get the sender's MDN from ITAPI
nResult = ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_TAPI,(void **)&pMe->pITAPI);
ITAPI_GetStatus(pMe->pITAPI,&pStatus);
ITAPI_Release(pMe->pITAPI);
sOpts[0].nId = MSGOPT_FROM_DEVICE_SZ;
sOpts[0].pVal = (void *)&pStatus.szMobileID[5];
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_MOSMS_ENCODING;
sOpts[0].pVal = (void *)AEESMS_ENC_ASCII;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_SZ;
sOpts[0].pVal = (void *)"Hello World";
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
sOpts[0].nId = MSGOPT_PAYLOAD_ENCODING;
sOpts[0].pVal = (void *)AEE_ENC_ISOLATIN1;
ISMSMSG_AddOpt(pMe->pISMSMsg, (WebOpt *)&sOpts);
CALLBACK_Init(&pMe->m_sSendMessageCallback,SMSSendCB,pMe);
ISMS_SendMsg(pMe->pISMS,pMe->pISMSMsg,&pMe->m_sSendMessageCallback,&pMe->m_dwSMSSendResult);
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_NORMAL,L"Message sent",-1,30,30,NULL,IDF_ALIGN_MIDDLE);
IDISPLAY_Update(pMe->a.m_pIDisplay);

The code is displaying "Message sent" . but nothing is sent to the phone in real. What could be the reason?

Use AEESMS_GETERRORTYPE () to get error type and AEESMS_GETERROR () function to access error in the callback function to see what is wrong. Your code will obviously display "Message Sent" as there is no conditional check whether ISMS_SendMsg () was successful or not.
Also, If you are sending message on the phone, then you must test yor app on the actual device.
Regards,
Shashi Kant

Use AEESMS_GETERRORTYPE () to get error type and AEESMS_GETERROR () function to access error in the callback function to see what is wrong. Your code will obviously display "Message Sent" as there is no conditional check whether ISMS_SendMsg () was successful or not.
Also, If you are sending message on the phone, then you must test yor app on the actual device.
Regards,
Shashi Kant

Shashi Kant wrote:Use AEESMS_GETERRORTYPE () to get error type and AEESMS_GETERROR () function to access error in the callback function to see what is wrong. Your code will obviously display "Message Sent" as there is no conditional check whether ISMS_SendMsg () was successful or not.
Also, If you are sending message on the phone, then you must test yor app on the actual device.
Regards,
Shashi Kant
int nResult = EFAILED;
uint32 dwErrorType = 0;
uint32 dwErrorCode = EFAILED;
dwErrorType = AEESMS_GETERRORTYPE(pMe->m_dwSMSSendResult);
dwErrorCode = AEESMS_GETERROR(pMe->m_dwSMSSendResult);
switch(dwErrorCode)
{
case 0:
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_NORMAL,L"Message sent successfully",-1,30,30,NULL,IDF_ALIGN_MIDDLE);
IDISPLAY_Update(pMe->a.m_pIDisplay);
break;
case 1:
// SMSC Error type 1
break;
case 2:
// SMSC Error type 2
break;
case 3:
// SMSC Error type 3
break;
default:
break;

Both dwErrorCode and dwErrorType has value "0" in them.

Shashi Kant wrote:Use AEESMS_GETERRORTYPE () to get error type and AEESMS_GETERROR () function to access error in the callback function to see what is wrong. Your code will obviously display "Message Sent" as there is no conditional check whether ISMS_SendMsg () was successful or not.
Also, If you are sending message on the phone, then you must test yor app on the actual device.
Regards,
Shashi Kant
int nResult = EFAILED;
uint32 dwErrorType = 0;
uint32 dwErrorCode = EFAILED;
dwErrorType = AEESMS_GETERRORTYPE(pMe->m_dwSMSSendResult);
dwErrorCode = AEESMS_GETERROR(pMe->m_dwSMSSendResult);
switch(dwErrorCode)
{
case 0:
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_NORMAL,L"Message sent successfully",-1,30,30,NULL,IDF_ALIGN_MIDDLE);
IDISPLAY_Update(pMe->a.m_pIDisplay);
break;
case 1:
// SMSC Error type 1
break;
case 2:
// SMSC Error type 2
break;
case 3:
// SMSC Error type 3
break;
default:
break;

Both dwErrorCode and dwErrorType has value "0" in them.

The simulator can't send SMS messages to phones. When you send a message it is stored in a .sim file on the computer's file system. Check out the "Simulating SMS" section in the BREW Simulator docs.
-Erik

The simulator can't send SMS messages to phones. When you send a message it is stored in a .sim file on the computer's file system. Check out the "Simulating SMS" section in the BREW Simulator docs.
-Erik