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

Developer

Forums

Forums:

That's strange that my SMS sender on Kz820 handset can only send SMS message once. After that it give ITEMBUSY error. After I restart the phone, it can send once again.

PSW: when sending, neither EVT_APP_SUSPEND nor EVT_APP_RESUME is received in sending, and the status handler is not called either.

I can sent sms more than once time, and can you send multibyte char with kz-820? By checking device info, I found that it doesn't support AEE_ENC_UNICODE or AEE_ENC_UNICODE2. :(

I can sent sms more than once time, and can you send multibyte char with kz-820? By checking device info, I found that it doesn't support AEE_ENC_UNICODE or AEE_ENC_UNICODE2. :(

I got a great mess in the destination phone when sending unicode:(

I got a great mess in the destination phone when sending unicode:(

hi, confused_ddk
Can you tell me how I can send SMS more than once?
I just use ITAPI_SendSMS and find that the status handler --although I give some simple implementation of it -- was not called at all. And any other EVENT should I handle except EVT_APP_SUSPEND and EVT_APP_RESUME?
thank you :)

hi, confused_ddk
Can you tell me how I can send SMS more than once?
I just use ITAPI_SendSMS and find that the status handler --although I give some simple implementation of it -- was not called at all. And any other EVENT should I handle except EVT_APP_SUSPEND and EVT_APP_RESUME?
thank you :)

seems that kz-820 support chinese, but don't support unicode encoding. u can try it by following the below code:
////////////////////////////////////////////////////////
AEEDeviceInfo di;
ISHELL_GetDeviceInfo(pApp->a.m_pIShell, &di);
if( di.dwLang == LNG_SCHINESE)
wID = IDS_MSG_LONG_CN;
else
wID = IDS_MSG_LONG_EN;
ISHELL_LoadResString(pApp->a.m_pIShell, SMS_RES_FILE, wID,
pApp->wStrMessage, sizeof(pApp->wStrMessage));
if( di.wEncoding != AEE_ENC_UNICODE && di.wEncoding != AEE_ENC_UNICODE2 )
{
WSTRTOSTR(pApp->wStrMessage, pApp->strMessage, sizeof(pApp->strMessage));
nRET = ITAPI_SendSMS(pApp->m_pITAPI, (const char *)pApp->strNum, (const char *)pApp->strMessage,
0, (PFNSMSSTATUS)MySmsNotify, pApp);
}
else
{
nRET = ITAPI_SendSMS(pApp->m_pITAPI, (const char *)pApp->strNum, (const char *)pApp->wStrMessage,
0, (PFNSMSSTATUS)MySmsNotify, pApp);
}
if(nRET!= SUCCESS)
{
DBGPRINTF("Send Long SMS failed(%d)!",nRET);
}
else
{
DBGPRINTF("Send Long SMS Success(%d)!",nRET);
}
pApp->m_status = LONG_SMS;
pApp->m_sentflag=TRUE;
////////////////////////////////////////////////////////////
Can we change the wEncoding?

seems that kz-820 support chinese, but don't support unicode encoding. u can try it by following the below code:
////////////////////////////////////////////////////////
AEEDeviceInfo di;
ISHELL_GetDeviceInfo(pApp->a.m_pIShell, &di);
if( di.dwLang == LNG_SCHINESE)
wID = IDS_MSG_LONG_CN;
else
wID = IDS_MSG_LONG_EN;
ISHELL_LoadResString(pApp->a.m_pIShell, SMS_RES_FILE, wID,
pApp->wStrMessage, sizeof(pApp->wStrMessage));
if( di.wEncoding != AEE_ENC_UNICODE && di.wEncoding != AEE_ENC_UNICODE2 )
{
WSTRTOSTR(pApp->wStrMessage, pApp->strMessage, sizeof(pApp->strMessage));
nRET = ITAPI_SendSMS(pApp->m_pITAPI, (const char *)pApp->strNum, (const char *)pApp->strMessage,
0, (PFNSMSSTATUS)MySmsNotify, pApp);
}
else
{
nRET = ITAPI_SendSMS(pApp->m_pITAPI, (const char *)pApp->strNum, (const char *)pApp->wStrMessage,
0, (PFNSMSSTATUS)MySmsNotify, pApp);
}
if(nRET!= SUCCESS)
{
DBGPRINTF("Send Long SMS failed(%d)!",nRET);
}
else
{
DBGPRINTF("Send Long SMS Success(%d)!",nRET);
}
pApp->m_status = LONG_SMS;
pApp->m_sentflag=TRUE;
////////////////////////////////////////////////////////////
Can we change the wEncoding?

BTW, in notification function I just return, don't do more process. if you still have this problem, paste your code.

BTW, in notification function I just return, don't do more process. if you still have this problem, paste your code.

can WSTRTOSTR work? I still get error code.

can WSTRTOSTR work? I still get error code.

hi, confused_ddk.
I still can't send more than once.:(
my code is as follow:
AECHAR cFmt[40];
AECHAR cMessage[64];
int nRet = 0;
WSTRTOSTR(pApp->m_cPhoneNum, pApp->m_cPeerNum, 12);
ISHELL_LoadResString(pApp->a.m_pIShell, LCAWHERE_RES_FILE, IDS_PMT_MSGFMT, cFmt,
sizeof(cFmt));
WSPRINTF(cMessage, 64, cFmt, pApp->m_cNickName);
WSTRTOSTR(cMessage, pApp->m_cMessage, sizeof(pApp->m_cMessage));
pApp->m_bIsShort = TRUE;//we are sending the message
nRet = ITAPI_SendSMS(pApp->m_pSender, pApp->m_cPeerNum, (const char*)pApp->m_cMessage,
0, (PFNSMSSTATUS)LA_PMT_SMSStatus, pApp);
if(nRet != SUCCESS)
DrawTipBoard(pApp, IDS_PMT_SENDERR, TRUE, (PFSOFTKEYNOTIFY)LA_DspMainMenu,
(PFSOFTKEYNOTIFY)LA_PMT_SendSMS);//this draw some string on the screen
else
DrawTipBoard(pApp, IDS_PMT_SUCCESS, FALSE, (PFSOFTKEYNOTIFY)LA_DspMainMenu, NULL);
and the notification:
void LA_PMT_SMSStatus(CLAApp * pApp, int16 status)
{
return;

and the event handler:
case EVT_APP_SUSPEND:
if(pApp->m_bIsShort)
return TRUE;
.....
case EVT_APP_RESUME:
if(pApp->m_bIsShort)
return TRUE;
thank you.

hi, confused_ddk.
I still can't send more than once.:(
my code is as follow:
AECHAR cFmt[40];
AECHAR cMessage[64];
int nRet = 0;
WSTRTOSTR(pApp->m_cPhoneNum, pApp->m_cPeerNum, 12);
ISHELL_LoadResString(pApp->a.m_pIShell, LCAWHERE_RES_FILE, IDS_PMT_MSGFMT, cFmt,
sizeof(cFmt));
WSPRINTF(cMessage, 64, cFmt, pApp->m_cNickName);
WSTRTOSTR(cMessage, pApp->m_cMessage, sizeof(pApp->m_cMessage));
pApp->m_bIsShort = TRUE;//we are sending the message
nRet = ITAPI_SendSMS(pApp->m_pSender, pApp->m_cPeerNum, (const char*)pApp->m_cMessage,
0, (PFNSMSSTATUS)LA_PMT_SMSStatus, pApp);
if(nRet != SUCCESS)
DrawTipBoard(pApp, IDS_PMT_SENDERR, TRUE, (PFSOFTKEYNOTIFY)LA_DspMainMenu,
(PFSOFTKEYNOTIFY)LA_PMT_SendSMS);//this draw some string on the screen
else
DrawTipBoard(pApp, IDS_PMT_SUCCESS, FALSE, (PFSOFTKEYNOTIFY)LA_DspMainMenu, NULL);
and the notification:
void LA_PMT_SMSStatus(CLAApp * pApp, int16 status)
{
return;

and the event handler:
case EVT_APP_SUSPEND:
if(pApp->m_bIsShort)
return TRUE;
.....
case EVT_APP_RESUME:
if(pApp->m_bIsShort)
return TRUE;
thank you.

Let me guess, the function of "WSPRINTF" has some problem for Chinese(I have same problem), I suggest that just use simple text to test, and here I note u that WSTRTOSTR is not necessary, cause convert unicode to plain text can only make a set of wrong code.
Quote:Originally posted by SandNovice
hi, confused_ddk.
I still can't send more than once.:(
my code is as follow:
AECHAR cFmt[40];
AECHAR cMessage[64];
int nRet = 0;
WSTRTOSTR(pApp->m_cPhoneNum, pApp->m_cPeerNum, 12);
ISHELL_LoadResString(pApp->a.m_pIShell, LCAWHERE_RES_FILE, IDS_PMT_MSGFMT, cFmt,
sizeof(cFmt));
WSPRINTF(cMessage, 64, cFmt, pApp->m_cNickName);
WSTRTOSTR(cMessage, pApp->m_cMessage, sizeof(pApp->m_cMessage));
pApp->m_bIsShort = TRUE;//we are sending the message
nRet = ITAPI_SendSMS(pApp->m_pSender, pApp->m_cPeerNum, (const char*)pApp->m_cMessage,
0, (PFNSMSSTATUS)LA_PMT_SMSStatus, pApp);
if(nRet != SUCCESS)
DrawTipBoard(pApp, IDS_PMT_SENDERR, TRUE, (PFSOFTKEYNOTIFY)LA_DspMainMenu,
(PFSOFTKEYNOTIFY)LA_PMT_SendSMS);//this draw some string on the screen
else
DrawTipBoard(pApp, IDS_PMT_SUCCESS, FALSE, (PFSOFTKEYNOTIFY)LA_DspMainMenu, NULL);
and the notification:
void LA_PMT_SMSStatus(CLAApp * pApp, int16 status)
{
return;

and the event handler:
case EVT_APP_SUSPEND:
if(pApp->m_bIsShort)
return TRUE;
.....
case EVT_APP_RESUME:
if(pApp->m_bIsShort)
return TRUE;
thank you.

Let me guess, the function of "WSPRINTF" has some problem for Chinese(I have same problem), I suggest that just use simple text to test, and here I note u that WSTRTOSTR is not necessary, cause convert unicode to plain text can only make a set of wrong code.
Quote:Originally posted by SandNovice
hi, confused_ddk.
I still can't send more than once.:(
my code is as follow:
AECHAR cFmt[40];
AECHAR cMessage[64];
int nRet = 0;
WSTRTOSTR(pApp->m_cPhoneNum, pApp->m_cPeerNum, 12);
ISHELL_LoadResString(pApp->a.m_pIShell, LCAWHERE_RES_FILE, IDS_PMT_MSGFMT, cFmt,
sizeof(cFmt));
WSPRINTF(cMessage, 64, cFmt, pApp->m_cNickName);
WSTRTOSTR(cMessage, pApp->m_cMessage, sizeof(pApp->m_cMessage));
pApp->m_bIsShort = TRUE;//we are sending the message
nRet = ITAPI_SendSMS(pApp->m_pSender, pApp->m_cPeerNum, (const char*)pApp->m_cMessage,
0, (PFNSMSSTATUS)LA_PMT_SMSStatus, pApp);
if(nRet != SUCCESS)
DrawTipBoard(pApp, IDS_PMT_SENDERR, TRUE, (PFSOFTKEYNOTIFY)LA_DspMainMenu,
(PFSOFTKEYNOTIFY)LA_PMT_SendSMS);//this draw some string on the screen
else
DrawTipBoard(pApp, IDS_PMT_SUCCESS, FALSE, (PFSOFTKEYNOTIFY)LA_DspMainMenu, NULL);
and the notification:
void LA_PMT_SMSStatus(CLAApp * pApp, int16 status)
{
return;

and the event handler:
case EVT_APP_SUSPEND:
if(pApp->m_bIsShort)
return TRUE;
.....
case EVT_APP_RESUME:
if(pApp->m_bIsShort)
return TRUE;
thank you.

I see, that's a pity.:(
thank you, confused_ddk.

I see, that's a pity.:(
thank you, confused_ddk.

SandNovice wrote:hi, confused_ddk.
I still can't send more than once.:(
Did you ever find a work-around? I'm finding on some phones (VX4500 and I think also VX6000, but NOT VX7000 or Simulator), I can only send one SMS using ITAPI_SendSMS().
After that, my callback never gets called again!
I'm thinking of setting up a timer (using ISHELL_SetTimer()) to /force/ the callback to get called after ~5 seconds, and send it a "SUCCESS", just to get past this crappiness.
Any other ideas???
Thx!
-bill!

SandNovice wrote:hi, confused_ddk.
I still can't send more than once.:(
Did you ever find a work-around? I'm finding on some phones (VX4500 and I think also VX6000, but NOT VX7000 or Simulator), I can only send one SMS using ITAPI_SendSMS().
After that, my callback never gets called again!
I'm thinking of setting up a timer (using ISHELL_SetTimer()) to /force/ the callback to get called after ~5 seconds, and send it a "SUCCESS", just to get past this crappiness.
Any other ideas???
Thx!
-bill!

There is a thing in SDK docs around sending sms - you can't send more than on sms at once. You should organize some queue.
Generally, a SMS message cannot be sent if the notification function has not yet been called for a previously sent SMS message.
Maybe, this will help?

There is a thing in SDK docs around sending sms - you can't send more than on sms at once. You should organize some queue.
Generally, a SMS message cannot be sent if the notification function has not yet been called for a previously sent SMS message.
Maybe, this will help?