ITeye博客

设置symbian信息中心号

netxdiy · 2011-04-08 17:59 · Markdown

代码:

CSmsAccount* account = CSmsAccount::NewL();
CleanupStack::PushL(account);
CSmsSettings* sendOptions = CSmsSettings::NewL();
CleanupStack::PushL(sendOptions);
account->InitialiseDefaultSettingsL(*sendOptions);
sendOptions->CopyL(iSmsMtm->ServiceSettings()); // restore existing settings
// set send options
sendOptions->SetDelivery(ESmsDeliveryImmediately); // set to be delivered immediately
sendOptions->SetStatusReportHandling(CSmsSettings::EDiscardReport);
sendOptions->SetDeliveryReport(EFalse);
// here we modified the character set
sendOptions->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
scIndex = sendOptions->DefaultServiceCenter();
if ((scIndex < 0) || (scIndex >= numSCAddresses))
scIndex = 0;
sendOptions->GetServiceCenter(scIndex).SetAddressL(CnBuf);
//This can only be used on SMS-SUBMIT type messages. The message PDU
//type can be checked by using the CSmsHeader::Type API.
//sendOptions->AddServiceCenterL(_L("scenter"),_L("+8613800200502"));
sendOptions->SetCommDbAction( CSmsSettings::EStoreToCommDb );
sendOptions->SetSmsBearerAction( CSmsSettings::EStoreToCommDb );
//header.SetServiceCenterAddressL(CnBuf); //改变短信中心号码
//header.SetSmsSettingsL(*sendOptions);
account->SaveSettingsL(*sendOptions);
CleanupStack::PopAndDestroy(sendOptions);
CleanupStack::PopAndDestroy(account);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。