Symbian
Symbian OS Library

FAQ-1173 What CommDB tables do I need to setup for a GPRS Internet (not WAP) connection ?

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



 

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

Question:
What are the table names that require populating for a GRPS connection ?

Answer:
Depending on the Symbian OS version there can be upto 7 tables that require setting in order to make a successful GPRS connection. The various tables are linked where the IAP table forms the root of the link. These tables are used at different points when attempting a GPRS connection. There are two ways by which you can configure the CommDB:

a. Prefabricate the CommDB with the desired settings. Refer to FAQ-1071 for more details
b. Use the CommDB API programmatically to create/edit settings.

The following provides explanation on the tables that are required to be filled for a Internet GPRS connection and what each table is used for. Note that this is just an overview on the required tables and the FAQ refrains from giving detailed field definitions and how to access them . Moreover, the tables only apply to a GPRS Internet connection and not a WAP connection. For a WAP connection other WAP specific tables are required to be populated in addition to the ones listed below.

The following creates a handle to CommDB which is used below to access each table:

CCommsDatabase* comDB=CCommsDatabase::NewL(EDatabaseTypeIAP);

Note : The words 'table' and 'record' are used in several places. To clarify these terms a table encapsulates several records of a particular type. There can
be one or several records in a given table. Each record in a table has identical number and type of fields, and when created a record is assigned a
unique COMMDB_ID. Refer to CommDB Overview and CommDB API for more details.

1. The SERVICE (OUTGOING_GPRS) table

This is the 'Service' table that provides settings for a given GPRS connection. It defines the GPRS Access Point Name (APN), PDP type, inteface settings such DNS server address, QoS details etc. This is a mandatory table for a given GPRS connection. Several records can coexist in this table within CommDB and be used simultaneously. The SERVICE tables defines what underlying bearer type the connection applies to. Settings in the OUTGOING_GPRS table is used to make a connection to the GPRS network. This table has been supported since 6.1.

Access : CCommsDbTableView *myGPRSTableView = comDB->OpenTableLC(TPtrC(OUTGOING_GPRS));

2. The MODEM table

This is the bearer table which the Service is going to use during a connection. Generally, a fast MODEM (serial) connection is used between Symbian OS and the signalling stack (which runs on a seperate CPU on current phones). The MODEM bearer table defines attributes to enable communication to the signalling (i.e. GPRS) stack over a defined COMM port when making a connection. Several MODEM records can exist at the same time in the MODEM table, however only one is generally in use. Every connection requires a bearer record, thus for a GPRS connection a MODEM record associates the bearer type.

In most Symbian phones when you insert a SIM card the MODEM table gets created/updated to reflect the settings defined in the SIM. Generally, changes to the MODEM table is not required.

Access : CCommsDbTableView *myModemTableView = comDB->OpenTableLC(TPtrC(MODEM));

Note that as of v7.0s this table changed its name from MODEM to MODEM_BEARER.

3. The NETWORK table

This table was added in v7.0s to provide an alternative means of choosing a connection instead of using the Connection Preference table (see below).The Network table allows grouping of IAPs which are associated to one network.

Access : CCommsDbTableView *myNetworkTableView = comDB->OpenTableLC(TPtrC(NETWORK));

4. The LOCATION Table

The location table is used to set the dialling behaviour etc when making a call. Attributes such as country code, international prefix code etc are all set in this table. Generally, there is a default Location record that gets reused in several IAP records. This table was added in 6.1.

Access : CCommsDbTableView *myLocationTableView = comDB->OpenTableLC(LOCATION));

5. The IAP table

The IAP table is used as the starting point for making a connection. See FAQ-1140 on how to access the IAP table. New fields (Bearer type, location and Network) were added to this table from 7.0s. The IAP table defines what service the connection applies to. The table defines the Network it belongs to and the IAP_NETWORK_WEIGHTING field sets the priority of the IAP within the identified Network. The IAP with the lowest weighting value is given precedence when making a connection. Currently, the entry for a NETWORK record in a IAP record is ignored, however, in the future this will override the behaviour of IAP selection used in the Connetion Preference table (see below).

Access : CCommsDbTableView *myIapTableView = comDB->OpenTableLC(TPtrC(IAP));

Or you could use other methods to open the table depending on the bearerset e.g.

CCommsDbTableView *myIapTableView = comDB->OpenIAPTableViewMatchingBearerSetLC(KCommDbBearerPSD);

6. The Connetion Preference table

This table defines the connection ordering. IAPs are ranked by priority and a ranking of 1 is given the highest precedence. Ranking is the only criterion used for making a connection. QoS, tariffs etc are beyond the scope of this table. There are two instances where this table is used during a connection:

a. Implicit connection

A connection is attempted without specifying any overrides.

RConnection::Start(iStatus) OR RGenericAgent::StartOutgoing(iStatus)

When making an implicit connection the Connection Preference table is accessed by the Networking layer to get the highest ranking IAP. On failure the next lower ranking IAP is used before the connection attempt is terminated.

b. Explicit connection

A connection is attempted using overrides.

RConnection::Start(overridepref, iStatus) OR RGenericAgent::StartOutgoing(overridepref, istatus)

The Networking sub-system uses the overrides to make the connection. If the override is for ranking 1 then the Connection Preference table is not accessed. If the ranking in the override is set to 2 the Connection Preference table is accessed and a connection is attempted first using the IAP with ranking 1and followed by the IAP with ranking 2 from the overrides.
Access :

CCommsDbTableView *myConTableView = comDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);

7. The Global settings table

This table defines settings that are globally (across various connections) applicable such as redial attempts, default location table etc; hence, there is only one set of global settings which can be accessed directly from the CommDB API (without the need of any views). Care should be taken when updating this table (infact any changes could result in disruptive consequences). When creating an IAP table the default GPRS MODEM bearer and the location table ID can be obtained from the global table.

Usage : comDB->OpenTableLC(TPtrC(IAP));
comDB->GetGlobalSettingL(TPtrC(MODEM_PHONE_SERVICES_SMS), id);

// Note myIapTableView from above
myIapTableView ->WriteTextL(TPtrC(IAP_BEARER_TYPE), TPtrC(MODEM_BEARER));
myIapTableView ->WriteUintL(TPtrC(IAP_BEARER), id);

comDB->GetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS), id);
myIapTableView ->WriteUintL(TPtrC(IAP_LOCATION), id);