Automatically finds cmwap connection points in symbian, and removes uiq 2nd 3nd and s60 2nd 3nd 5nd.

Source: Internet
Author: User

All tests have passed. Given that there are too many mobile phone models, there is no one-to-one test. If the connection point cannot be found, a new one should be created automatically, but the certificate is not required.

Today, we found that one of the machine's 5800 cannot be connected. In the second-level search, we still need to compare the name.

// Find available connection points. UIQ is different from Symbian

TBool NewCClientEngine: FindIapId (TUint32 & iapId) {iapId = 0; # ifdef _ WINS _ iapId = 1; # elif UIQ30 jstring cmwapname; // first find the APN CCommsDatabase * const comm_db = CCommsDatabase: NewL (EDatabaseTypeIAP); CleanupStack: PushL (comm_db ); CCommsDbTableView * iap_table_view = comm_db-> values (TPtrC (OUTGOING_WCDMA); TBuf <50> values; TBuf <50> cmwap_str; TBuf <32> apn; TUint32 iap_id =-1; TBuf <100> lo G; // 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_db iap_name_buf.SetLength (0); iap_table_view-> ReadTextL (TPtrC (COMMDB_NAME), iap_name_buf ); iap_table_view-> ReadTextL (TPtrC (upls_apn), apn); // test the cmnet iap name DEBUGING (iap_name_buf); DEBUGING (apn ); if (apn = _ L ("cmwap") {cmw Apname = 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);} # else CCommsDatabase * const comm_db = CCommsDatabase: NewL (snapshot); CleanupStack:: PushL (comm_db); CCommsDbTableView * iap_table_view = comm_db-> aggregate (TPtrC (OUTGOING_WCDMA); TBuf <20> average; TBuf <20> average; 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_db iap_name_buf.SetLength (0); iap_table_view-> ReadTextL (TPtrC (COMMDB_NAME), iap_name_buf ); latency-> ReadTextL (TPtrC (upls_apn), apn); latency-> ReadTextL (TPtrC (latency), latency); iap_table_view-> ReadTextL (TPtrC (upls_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-> partition (TPtrC (IAP), TPtrC (IAP_SERVICE), iap_id); TInt nErr = pIAPView-> GotoFirstRecord (); while (nErr = KErrNone) {pIAPView-> ReadTextL (TPtrC (COMMDB_NAME), iap_name_buf1); DEBUGING (logging); if (encoding = signature) {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_db if (iap_id <0) {ERRORING (_ L ("can't find iap") ;}# endif return (iapId> 0 );}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.