Join Now
Quality Rating:
  • Currently 5.0 / 5
(5.0 / 5 - 1 vote cast)
Expertise Level:
  • Currently 3.0 / 5
(3.0 / 5 - 1 vote cast)

This page was last modified 12:53, 7 May 2008.

Data Connection Log Counters API

From Forum Nokia Wiki

Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.


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 link Connection monitoring API

Example code

Headers Used

#include <centralrepository.h>
#include <dclcrkeys.h> # or <dclinternalcrkeys.h>

Link against

LIBRARY   centralrepository.lib

The 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


Example project

Example_Application

Related Discussions
Thread Thread Starter Forum Replies Last Post
Receive notification of incoming & Outgoing VoIP calls Bernard Merlyn VoIP 5 2008-07-09 14:16
nokia E50 can't send udp data slawomir17 Symbian Networking & Messaging 6 2008-09-08 11:24
Does log engine remove entries automatically? AlexOfBorg Symbian Networking & Messaging 1 2006-01-03 16:42
about a file download's time? xk_newboy General Symbian C++ 7 2007-08-17 13:54
Phonebook access logica2k General Symbian C++ 10 2008-09-04 06:20
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtopicQUqfnTopicZwlanQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX