Categories: S60 | Symbian C++ | Networking | WLAN | Code Examples
This page was last modified 12:53, 7 May 2008.
Data Connection Log Counters API
From Forum Nokia Wiki
| Note! |
|---|
|
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
| 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 |
