Data Connection Log Counters API
Article Metadata
Code Example
Article
The Data Connection Log Counters API provides central repository keys using which we can get the total amount of data sent and recieved using GPRS and WLAN.
Use cases
These APIs can be used in an application, which is developed to send/recieve data using WLAN/GPRS, to check the data transfer rate over specified duration.
They can be also used to check the amount of data transfered by your application by checking the log counters before and after data transfer. You can also monitor any data connection and get the data amounts by using File:RConMon Example.zip
Note that the logs can be disabled by the user using the Log application!
Example code
Headers Used
#include <centralrepository.h>
#include <dclcrkeys.h> # or <dclinternalcrkeys.h>
Link against
LIBRARY centralrepository.libThe following code displays the total data sent using GPRS :
// We need to Query Central Repository.
CRepository* cRepository = CRepository::NewLC( KCRUidDCLLogs );
// Get the data in bytes
TBuf<50> bytes;
User::LeaveIfError( cRepository->Get( KLogsGPRSSentCounter, bytes ) );
// To display message
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<100> msg;
msg.Copy(_L("Data in bytes : "));
msg.Append(bytes) ;
informationNote->ExecuteLD(msg);
CleanupStack::PopAndDestroy();
The following code displays the total data received using GPRS :
// We need to Query Central Repository.
CRepository* cRepository = CRepository::NewLC( KCRUidDCLLogs );
// Get the data in bytes
TBuf<50> bytes;
User::LeaveIfError( cRepository->Get( KLogsGPRSReceivedCounter, bytes ) );
// To display message
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<100> msg;
msg.Copy(_L("Data in bytes : "));
msg.Append(bytes) ;
informationNote->ExecuteLD(msg);
CleanupStack::PopAndDestroy();
The following code displays the total data sent using WLAN :
// We need to Query Central Repository.
CRepository* cRepository = CRepository::NewLC( KCRUidDCLLogs );
// Get the data in bytes
TBuf<50> bytes;
User::LeaveIfError( cRepository->Get( KLogsWLANSentCounter, bytes ) );
// To display message
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<100> msg;
msg.Copy(_L("Data in bytes : "));
msg.Append(bytes) ;
informationNote->ExecuteLD(msg);
CleanupStack::PopAndDestroy();
The following code displays the total data received using WLAN :
// We need to Query Central Repository.
CRepository* cRepository = CRepository::NewLC( KCRUidDCLLogs );
// Get the data in bytes
TBuf<50> bytes;
User::LeaveIfError( cRepository->Get( KLogsWLANReceivedCounter, bytes ) );
// To display message
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<100> msg;
msg.Copy(_L("Data in bytes : "));
msg.Append(bytes) ;
informationNote->ExecuteLD(msg);
CleanupStack::PopAndDestroy();
Note: The data display is in bytes


29 Sep
2009
Data Connection Log Counters API are useful to get the total amount of data sent and received using GPRS and WLAN. The application that is started as file server client is identified by application UID. This article demonstrates the use of Data Connection Log Counters API to displays the total data sent using GPRS and WLAN, to displays the total data received using GPRS and WLAN. Note that this API, Data Connection Log Counters API, is not part of the public SDK. So you have to download it from SDK API Plug-in before using it. Furthermore, the author added a working demo project, which can be used for more detailed study of new opportunities for various kinds of experiments.
Data Connection Log doesn't work with N95 and N95 8GB : -6 error !
Cyke64
Kurmasys - Collect data for all applications
Hi
Is there possibility I can collect the data download/upload for all the applications and per app basis using these APIs. I have seen IPhook but it seems it requires to become a Symbian partner.
thankskurmasys 21:58, 13 May 2013 (EEST)
Hamishwillee - Might be best to post on discussion board or private message the users
This article is 6 years old and I very much doubt the author is still monitoring it. You might be better off sending a private message to him, or even better posting on the Symbian C++ discussion board with a link to here.
This API might do what you need, but as it uses the SDK API plugin which is intended for S60 3rd Edition devices it is quite possible that it won't work on more recent devices.hamishwillee 08:22, 14 May 2013 (EEST)