Symbian
Symbian OS Library

FAQ-1140 How do I get a list of Internet Access Point (IAP) names?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Networking
Created: 09/21/2004 Modified: 12/15/2004
Number: FAQ-1140
Platform: Symbian OS v6.1, Symbian OS v7.0, Symbian OS v7.0s, Symbian OS v8.0, Symbian OS v8.0a, Symbian OS v8.0b, Symbian OS v8.1a, Symbian OS v8.1b

Question:
How do I get a list of Internet Access Point (IAP) names and the corresponding ID values?

Answer:
An Internet Access Point (IAP) is a table in Symbian's Communication database (CommDB) which provides an entry point for making a connection over a given bearer type e.g. GPRS, WCDMA, GSM Data Call etc. There can be several IAP records in the IAP table within CommDB each pointing to a different connection type.

Note : The example code below uses Symbian OS APIs directly. Some SDKs might include UI Platform specific APIs to achieve the same thing. You can use
the Symbian APIs to allow your solution to work over different platforms - though any future changes made to CommDB API/functionality will affect your
implementation.

How do I get a list of IAP's names?

The below code snippet below showshow to get the IAP names for GPRS (and also WCDMA).

TUint32 CCommsDBAccessor::GetGPRSIAPsFromIAPTableL(CDesCArrayFlat* aList)
{
TBuf<52> iapfromtable;
TInt err = KErrNone;

// Open IAP table using the GPRS as the bearer.
    CCommsDbTableView* gprsTable = iCommsDB->OpenIAPTableViewMatchingBearerSetLC(ECommDbBearerGPRS,
    ECommDbConnectionDirectionOutgoing); // Point to the first entry
    User::LeaveIfError(gprsTable->GotoFirstRecord());
    gprsTable->ReadTextL(TPtrC(COMMDB_NAME), iapfromtable);
    aList->AppendL(iapfromtable);

    while (err = gprsTable->GotoNextRecord(), err == KErrNone)
    {
    gprsTable->ReadTextL(TPtrC(COMMDB_NAME), iapfromtable);
    aList->AppendL(iapfromtable);
    }

    CleanupStack::PopAndDestroy(); // gprsTable
    }

    How do I get the IAP ID values?
    You can extend the second example above to get the IAP value. Include the line below
    to read the IAP value for each record.

    TUint32 id=0;
    gprsTable->ReadUintL(TPtrC(COMMDB_ID), id);

    The IAP value can be used in the override settings when making a connection. See FAQ 1064 for more details.