?
全測(cè)試過(guò)了,鑒于手機(jī)型號(hào)太多,沒(méi)有一一的測(cè)試。 找不到連接點(diǎn),應(yīng)該自動(dòng)創(chuàng)建一個(gè)的,但這個(gè)需要證書(shū),就沒(méi)寫(xiě)了。
今天發(fā)現(xiàn)刷了機(jī)的一個(gè)5800連不上,在二級(jí)查找上,還需比較一下名字。
//尋找可用的連接點(diǎn), UIQ與Symbian不同
TBool NewCClientEngine::FindIapId(TUint32& iapId){iapId = 0;
#ifdef __WINS__iapId = 1;
#elif UIQ30jstring cmwapname;
//先找出APNCCommsDatabase*
const comm_db = CCommsDatabase::NewL(EDatabaseTypeIAP);CleanupStack::PushL(comm_db);CCommsDbTableView *iap_table_view = comm_db->OpenTableLC(TPtrC(OUTGOING_WCDMA));TBuf<50> iap_name_buf;TBuf<50> cmwap_str; TBuf<32> apn;TUint32 iap_id = -1;TBuf<100> log;
// switch pointer to the first iap record if(iap_table_view->GotoFirstRecord() == KErrNone){
// search comm_db for cmnet iap do{
// get the iap name from comm_dbiap_name_buf.SetLength(0);iap_table_view->ReadTextL(TPtrC(COMMDB_NAME), iap_name_buf);iap_table_view->ReadTextL(TPtrC(GPRS_APN), apn);
// test the cmnet iap name DEBUGING(iap_name_buf);DEBUGING(apn);
if( apn == _L("
cmwap") ){cmwapname = iap_name_buf;iap_table_view->ReadUintL(TPtrC(COMMDB_ID), iap_id);log.Format(_L("
id = %d"),iap_id);DEBUGING(log);
break;}}
while (KErrNone == iap_table_view->GotoNextRecord());}CleanupStack::PopAndDestroy(2, comm_db);
// iap_table_view, comm_db if(cmwapname != _L("
")){CCommsDatabase* database = CCommsDatabase::NewL(EDatabaseTypeIAP);CleanupStack::PushL(database );CCommsDbTableView* view = database->OpenTableLC(TPtrC(IAP));
if( view->GotoFirstRecord() == KErrNone ){
do{TBuf<50> accessPointName;view->ReadTextL(TPtrC(COMMDB_NAME),accessPointName);DEBUGING(accessPointName);
if(cmwapname == accessPointName){TUint32 id;view->ReadUintL(TPtrC(COMMDB_ID),id);log.Format(_L("
iapid = %d"),id);iapId = id;DEBUGING(log);
break;}}
while(view->GotoNextRecord()==KErrNone);}CleanupStack::PopAndDestroy(view);CleanupStack::PopAndDestroy(database );} #
elseCCommsDatabase*
const comm_db = CCommsDatabase::NewL(EDatabaseTypeIAP);CleanupStack::PushL(comm_db);CCommsDbTableView *iap_table_view = comm_db->OpenTableLC(TPtrC(OUTGOING_WCDMA));TBuf<20> iap_name_buf;TBuf<20> iap_name_buf1;TBuf<20> cmwap_str;TBuf<100> cmwap_username;TBuf<100> cmwap_userpass;TBuf<32> apn;TUint32 iap_id = -1;TBuf<100> log;
// switch pointer to the first iap record if(iap_table_view->GotoFirstRecord() == KErrNone){
// search comm_db for cmnet iap do{
// get the iap name from comm_dbiap_name_buf.SetLength(0);iap_table_view->ReadTextL(TPtrC(COMMDB_NAME), iap_name_buf);iap_table_view->ReadTextL(TPtrC(GPRS_APN), apn);iap_table_view->ReadTextL(TPtrC(GPRS_IF_AUTH_PASS), cmwap_userpass);iap_table_view->ReadTextL(TPtrC(GPRS_IF_AUTH_NAME), cmwap_username);
// test the cmnet iap name DEBUGING(iap_name_buf);DEBUGING(cmwap_userpass);DEBUGING(cmwap_username);DEBUGING(apn);
if( apn == _L("
cmwap") && cmwap_userpass.Length()==0 && cmwap_username.Length()==0 ){iap_table_view->ReadUintL(TPtrC(COMMDB_ID), iap_id);CCommsDbTableView* pIAPView = comm_db->OpenViewMatchingUintLC(TPtrC(IAP), TPtrC(IAP_SERVICE), iap_id);TInt nErr = pIAPView->GotoFirstRecord();
while(nErr == KErrNone){pIAPView->ReadTextL(TPtrC(COMMDB_NAME), iap_name_buf1);DEBUGING(iap_name_buf1);
if(iap_name_buf1 == iap_name_buf){pIAPView->ReadUintL(TPtrC(COMMDB_ID), iap_id);iapId= iap_id;DEBUGING(_L("
find iap..."));}nErr = pIAPView->GotoNextRecord();}CleanupStack::PopAndDestroy();
//pIAPView}}
while (KErrNone == iap_table_view->GotoNextRecord());}CleanupStack::PopAndDestroy(2, comm_db);
// iap_table_view, comm_dbif( iap_id < 0){ERRORING(_L("
can't find iap"));}
#endif
return (iapId > 0);}
轉(zhuǎn)載于:https://www.cnblogs.com/hhuai/archive/2010/04/28/1723004.html
總結(jié)
以上是生活随笔為你收集整理的symbian 中自动寻找cmwap连接点,通杀uiq 2nd 3nd和s60 2nd 3nd 5nd的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。