All About Symbian - Nokia (S60) and Sony Ericsson (UIQ) smartphones unwrapped

Go Back   All About Symbian Forums > Symbian Based Devices > UIQ

 
 
Thread Tools Display Modes

  #1  
Old 18-11-2004, 11:09 AM
amitaggarwal amitaggarwal is offline
Registered User
 
Join Date: Jun 2004
Posts: 6
amitaggarwal is on a distinguished road
Using RSystemAgent with TSysAgentEvent and RSAVarChangeNotify

I m trying to monitor some system varibles like battery strength and network strength etc using the classes RSystemAgent, TSysAgentEvent and RSAVarChangeNotify.

This is the code i m writing ....

Code:
#include "CBatteryReader.h"

CBatteryReader::CBatteryReader(MBatteryObserver* aOb):CActive(0),iBatteryObserver(aOb)
{

}


CBatteryReader::~CBatteryReader()
{
//delete iBatteryObserver;
iSystemAgent.Close();
Cancel();
}

CBatteryReader* CBatteryReader::NewL(MBatteryObserver* aOb)
{
	CBatteryReader* self = new(ELeave) CBatteryReader(aOb);
	CleanupStack::PushL( self );
	self->ConstructL();
	CleanupStack::Pop();		
	return self;
}

void CBatteryReader::ConstructL()
{
	User::LeaveIfError(iSystemAgent.Connect());
	iSysAgentEvent.SetRequestStatus(iStatus);
	iSysAgentEvent.SetUid(KUidBatteryStrength);
	CActiveScheduler::Add( this );
}

TInt CBatteryReader::GetBatteryState()
{
	//iSysAgentEvent.SetRequestStatus(iStatus);
   	//iSysAgentEvent.SetUid(KUidBatteryStrength);
   	iSystemAgent.NotifyOnEvent(iSysAgentEvent);
    SetActive();

//return 0;//(iSystemAgent.GetState(KUidBatteryStrength));
}

void CBatteryReader::RunL()
{
TInt state = iSystemAgent.GetState(iSysAgentEvent.Uid());
// do what you want with state here
iBatteryObserver->OnBatteryChange(iSysAgentEvent.State());

//Reenable
//GetBatteryState();
}

void CBatteryReader::DoCancel()
{ 

}

TInt CBatteryReader::RunError( TInt aError )
{

}
but i receive a Panic Code 36 CONE
which says
Quote:
Open handles were found during application shutdown
ANy clues ????
__________________
Thanks
Amit
Ads
 

Bookmarks

Tags
rsavarchangenotify, rsystemagent, tsysagentevent

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using RSystemAgent with TSysAgentEvent and RSAVarChangeNotify amitaggarwal S60 (Series 60) 0 18-11-2004 11:08 AM



All times are GMT. The time now is 07:18 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright Notes || Contact Us || Privacy Policy