Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 07:28, 12 December 2007.

Easiest way to query Access Point (IAP)

From Forum Nokia Wiki

Lots of applications need user input for the Access point to use. The easiest way to query for an IAP is as follows:

void CMyAppView::AccessPointGetterL()
{
	iConnOK=EFalse;
 
	CApSettingsHandler* settingsHandler = CApSettingsHandler::NewLC(
        ETrue, 
        EApSettingsSelListIsPopUp   , 
        EApSettingsSelMenuSelectNormal,
        KEApIspTypeAll, 
        EApBearerTypeAll, 
        KEApSortNameAscending);
    
        TUint32 originallyFocused(0);
        // 0 is not valid IAP id. Failed if 0 after RunSettingsL().
        TUint32 selectedIap(0); 
 
        // Show the dialog
        settingsHandler->RunSettingsL(originallyFocused, selectedIap);
 
	// The CApUtils API is deprecated/removed, the following code can be
        used
	// to convert the WapAP Id to IAP Id    
	if (selectedIap)
	{
        CCommsDatabase* db = CCommsDatabase::NewL();
        CleanupStack::PushL(db);
 
    	CCommsDbTableView* wapTable;
	wapTable = db->OpenViewMatchingUintLC( TPtrC(WAP_ACCESS_POINT),
                                       TPtrC(COMMDB_ID), selectedIap );
    	User::LeaveIfError( wapTable->GotoFirstRecord() );
 
        TBuf<100> wapBearer;
	wapTable->ReadTextL(TPtrC(WAP_CURRENT_BEARER), wapBearer);
 
   	if ( wapBearer == TPtrC(WAP_IP_BEARER) )
       	{
            CCommsDbTableView* bearerTable;
            bearerTable = db->OpenViewMatchingUintLC( TPtrC(wapBearer),
                                            TPtrC(WAP_ACCESS_POINT_ID), 
                                            selectedIap );
            User::LeaveIfError( bearerTable->GotoFirstRecord() );
            bearerTable->ReadUintL(TPtrC(WAP_IAP), iIap );
            CleanupStack::PopAndDestroy( bearerTable ); // bearerTable
        }
       else
       {
           User::Leave( KErrInvalidBearerType );
       }
       CleanupStack::PopAndDestroy(2); // db, wapTable,         	
    }        
    else
    {
	iIap = 0;
    }
 
    CleanupStack::PopAndDestroy(settingsHandler);
    
    if(!iIap)
    {
    	iConnOK=EFalse;
    }
    else
    {
	iConnOK=ETrue;
    }
}

Header Files : ApSettingsHandlerUI.h

Link against : apsettingshandlerui.lib

Related Discussions
Thread Thread Starter Forum Replies Last Post
question about IAP reginwon Symbian 3 2006-02-05 04:42
E51 Access Point Groups forceps Wired and Wireless interfaces 0 2008-03-14 04:09
N70 Access Point becomes Unusable ravey72 General Symbian C++ 0 2007-04-18 10:58
Midlet and WAP access point!!! khurshed79 Mobile Java Networking & Messaging & Security 5 2006-08-24 09:35
Get current IAP of an RConnection AcroDesign Symbian Networking & Messaging 6 2006-09-28 00:42
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX