More and more applications have to use the phones connectivity. Sending some short messages (SMS) for licensing, transmit pictures using multimedia messages (MMS), manage emails (Pop3, IMAP and SMTP) or simply use a client socket for HTTP or your custom protocol over TCP / IP using GPRS, CSD or WCDMA (UMTS). This list is only a brief summary of functions where the OS will have to access an internal database for informations about how to handle the respective protocol stack. The database is called CommDB .
Like Other themes you will find a lot of basic information about this "Communications Database" in your sdks documentation - search for "Using Commdb".
In my last symbian project I made some additional insights (Symbian OS versions 6.1, 7.0, 7.0s) which I want to share with you -. Any comments are welcome I will not show much program code, because there are already many examples in The SDKS DOC, THE SYMBIAN FAQ AND Some Threads in the newsgroup. The article's aim is to get you across the command-layout and the basical kinds to get access to it.
1. Basic Termsthe Commdb Is A File Named
Cdbv2.dat for Symbian OS 6.1 (Series 60 V0.9, V1.0, V1.2) and
Cdbv3.dat for Symbian OS 7.0S / 7.0 (Series 60 2.0 / Uiq 2.0, UIQ 2.1).
You Will Find this file twice on your phone: in c: / system / data / - the current data in z: / system / data / - the Rom-version. If the ram-version cannot be found NEVER Checked this feature "" "" NEVER CHECKED THIS
The file can be accessed through the communications database server (a layer over DBMS). This server gives you a logical access to an (extensible) database, existing of many "linked" tables. Each logical summary of information how to get connectivity access using a special protocol and / or bearer type is called Internet Access Point (IAP) Both Series 60 and UIQ offer a user interface to manage IAPs and alter the CommDB:.. Each mobile network provider needs it's own individual configuration Therefore mostly the phones come from your provider with a subset of common IAPs, ready configured for SMS, WAP, WWW using different bearers like GSM, GPRS or GPRS Users can add new access points manually by using the above dialogs or they make use of BIO messaging -. a kind of System SMS from your provider to configure the phone.
As a developer you do not really need to take account for selecting the right IAP for the required type of connection -. The OS will prompt the user with a selection dialog But if you want to use a special IAP for eg a dedicated WAP- or Intranet-Gateway you have to insert a new IAP and then select him. This can be done by direct altering the CommDB-Tables or if you developing for Series 60 by use of Nokia's access-point-engine-library (ApEngine).
2. Nokia's Apengine (a General Survey) This Library Encapsulates The Commdb-API AND BRINGS A FELOGOGS / Views, Which One Can Embed to The Program.
(Link Against Apengine.lib).
Classname Headerfile Description (taken from SDK) CApSelect
CApAccessPointItem is used to exchange data between engine and client It holds the information for an access point including WAP, IAP, ISP (if present & applies) This class uses the same approach as CommDB to read and write data:.. It has functions for each data type implemented. to read or write the data, we have to know the data type and the enum name of the 'column'. The column values has the names of the database columns with the 'EAp' prefix. The reason for this (not using the database column descriptors) is performance. It is much faster to compare enum values than literals. CApUtils
There are some additional information in the headerfiles Have a look insight Some headerfiles are missing in OS 7.0s I copied them from 6.1 and it works for my needs (TX to Jan .Here are two short examples how to use it...:
/ * EX1: SHOW a List of all IAPS (Series 60 Only) * /
Capsettingshandler * settingshandler = capSettingsHandler :: newlc
Efalse,
EAPSETTINGSSELLISLISTISTPANE,
EAPSETTINGSSELMENUNORMAL,
Keapisptypell,
EAPBearertypeAll,
KeapsortNameascending;
Tuint32 Originallyfocused (UID);
Tuint32 SELECTEDIAP (UID);
// Show the dialog
Settingshandler-> RunSettingsl (Originallyfocused, SELECTEDIAP);
Cleanupstack :: PopandDestroy (SettingsHandler);
/ * EX2: Itereate over a list of Iaps (Series 60 Only) * /
CCOMMSDATABASE * COMMDB = CCOMMSDATABASE :: newl (edatabaseTypeia);
Cleanupstack :: Pushl (Commdb);
Capselect * apselect = capselect :: newlc (* Commdb, KeapisptyPEAll, EAPBEARTYPEALL, Keapsortuidascending);
IF (apselect-> movetofirst ())
{
DO
{
Tuint Uid = APSELECT-> UID ();
// Put here your Iap stuff
}
While (APSELECT-> MOVENEXT ());
}
Cleanupstack :: PopandDestroy (APSELECT);
Cleanupstack :: PopandDestroy (CommDB);
When you use the ApEngine (or the Series 60 GUI) to add a new IAP, you always will find an entry in table WAP_ACCESS_POINT, even so if the IAP is not for a wap connection - it's gateway will be set to "0.0.0.0 "!
3. UIQ - MISSING Access Point Engineunfortunately you will not find a apngine.dll in UIQ's SDK (NOR at the device
). If you want to select or create an Iap you have to use the "RAW" strDb-API - See Your SDKS Documentation "
How to access tables in the database.
The SDKs documentation lists all necessary tables with short description of their content, but it's obscure how they relate to each other. So I've created a CommDB-datamodel for Symbian OS 6.1, 7.0 and 7.0s. It's not perfect, but they will Really help you to gain inSight.commdb v2 - Symbian OS V6.1 Commdb V3 - Symbian V7.0 Commdb V3 - Symbian V7.0S
(CUTOUT)
Legend:. Each table and columns have a name (see
Some Example Code:
// Get All EXISTING IAPS
CCOMMSDATABASE * COMMDB = CCOMMSDATABASE :: newl (edatabaseTypeia);
Cleanupstack :: Pushl (Commdb);
CCOMMSDBTABLEVIEW * TABLEIAP = Commdb-> OpenTableLC (TPTRC (IAP));
IF (Tableiap-> gotofirstRecord () == Kerrnone)
{
Do {
Tuint32 UID (0);
Tableiap-> Readuintl (TPTRC (Commdb_ID), UID);
...
Tableiap-> ReadTextL (TPTRC (Commdb_name), CommdbNamePtr);
...
}
While (Tableiap-> gotoneXTRecord () == Kerrnone);
}
Cleanupstack :: PopandDestroy (Tableiap);
Cleanupstack :: PopandDestroy (CommDB);
4. Symbian Toolsthere Are Some Tools Available for Editing and Dumping The Commdb - Ceddump, CED, Commdb Editor - Read
Symbians FAQ-1071 for more information.
That's it.
All the best - happy coding
- Tobias Stöger