sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\resourceman\resourceman_psl\rescontrol_psl.cpp sl@0: // sl@0: // sl@0: sl@0: #include "rescontrol_psl.h" sl@0: TInt KSimulatedRCThreadPriority = 28; sl@0: #ifdef RESOURCE_MANAGER_SIMULATED_PSL sl@0: static DSimulatedPowerResourceController TheController; sl@0: #endif sl@0: sl@0: //Resource controller creation sl@0: #ifdef RESOURCE_MANAGER_SIMULATED_PSL sl@0: DECLARE_STANDARD_PDD() sl@0: { sl@0: TInt r = DPowerResourceController::InitController(); sl@0: if(r == KErrNone) sl@0: return new DResConPddFactory; sl@0: return NULL; sl@0: } sl@0: #endif sl@0: sl@0: /** ISR function invoked when the specified amount of time expires. This is used for event driven resources. */ sl@0: void DSimulatedPowerResourceController::TimerIsrFunc(TAny *ptr) sl@0: { sl@0: DSimulatedPowerResourceController *pC = (DSimulatedPowerResourceController *)ptr; sl@0: //Queues a Dfc to signal fast semaphore. sl@0: pC->iEventDfc.Add(); sl@0: } sl@0: sl@0: /** DFC function to signal the fast semaphore. For event driven resources, the PIL is blocked until specified time (just sl@0: to simulate hardware event). */ sl@0: void DSimulatedPowerResourceController::EventDfcFunc(TAny *ptr) sl@0: { sl@0: DSimulatedPowerResourceController *pC = (DSimulatedPowerResourceController *)ptr; sl@0: NKern::FSSignal((NFastSemaphore*)&pC->iEventFastSem); sl@0: } sl@0: sl@0: /** Constructor for simulated resource controller. */ sl@0: DSimulatedPowerResourceController::DSimulatedPowerResourceController():DPowerResourceController(),iStaticResourceCount(0), iEventDfc(EventDfcFunc, this) sl@0: { sl@0: Kern::Printf(">DSimulatedPowerResourceController"); sl@0: } sl@0: sl@0: /** Destructor for simulated resource controller. */ sl@0: DSimulatedPowerResourceController::~DSimulatedPowerResourceController() sl@0: { sl@0: Kern::Printf("DSimulatedPowerResourceController::~DSimulatedPowerResourceController()\n"); sl@0: ((TDynamicDfcQue*)iDfcQ)->Destroy(); sl@0: DStaticPowerResource *pR; sl@0: TUint c; sl@0: for(c = 0; c < iStaticResourceCount; c++) sl@0: { sl@0: pR = iResources[c]; sl@0: delete pR; sl@0: } sl@0: delete []iResources; sl@0: #ifdef PRM_ENABLE_EXTENDED_VERSION sl@0: DStaticPowerResourceD* pDR; sl@0: sl@0: delete []iNodeArray; //Delete dependency nodes sl@0: for(c = 0; c < iStaticResDependencyCount; c++) sl@0: { sl@0: pDR = iDependencyResources[c]; sl@0: delete pDR; sl@0: } sl@0: delete []iDependencyResources; sl@0: #endif sl@0: } sl@0: sl@0: #ifdef PRM_ENABLE_EXTENDED_VERSION sl@0: //Function to return the controller pointer to use in extended psl file sl@0: DSimulatedPowerResourceController* GetControllerPtr() sl@0: { sl@0: return &TheController; sl@0: } sl@0: #endif sl@0: sl@0: /** This function is called from PIL, during resource controller creation phase. sl@0: It creates a DFC queue and then invokes setDfcQ function to PIL to set the queue. sl@0: It calls InitPools function of PIL to create the specified sizes of clients, sl@0: client levels and requests pools. sl@0: */ sl@0: TInt DSimulatedPowerResourceController::DoInitController() sl@0: { sl@0: TInt r = KErrNone; sl@0: Kern::Printf(">DSimulatedPowerResourceController::DoInitController()"); sl@0: //Create a DFC queue sl@0: r = Kern::DynamicDfcQCreate((TDynamicDfcQue*&)iDfcQ, KSimulatedRCThreadPriority, KResmanName); sl@0: if(r != KErrNone) sl@0: { sl@0: Kern::Printf("DFC Queue creation failed"); sl@0: return r; sl@0: } sl@0: sl@0: #ifdef CPU_AFFINITY_ANY sl@0: NKern::ThreadSetCpuAffinity((NThread*)(iDfcQ->iThread), KCpuAffinityAny); sl@0: #endif sl@0: sl@0: //Call the resource controller to set the DFCQ sl@0: SetDfcQ(iDfcQ); sl@0: sl@0: #ifdef PRM_ENABLE_EXTENDED_VERSION sl@0: //Create a DFC Dependency Queue sl@0: r = Kern::DynamicDfcQCreate((TDynamicDfcQue*&)iDfcQDependency, KSimulatedRCThreadPriority, sl@0: KResmanName); sl@0: if(r != KErrNone) sl@0: { sl@0: Kern::Printf("DFC Dependency Queue creation failed"); sl@0: return r; sl@0: } sl@0: //Call the resource controller to set the DFCQDependency sl@0: SetDfcQDependency(iDfcQDependency); sl@0: #endif sl@0: //Init pools sl@0: r = InitPools(KERNEL_CLIENTS, USER_CLIENTS, CLIENT_LEVELS, REQUESTS); sl@0: return r; sl@0: } sl@0: sl@0: /** This function is used only for testing purpose to test the RegisterResorcesForIdle API sl@0: ideally will be used by Power controller to obtain the state of the resources will be interested sl@0: for idle power management. sl@0: */ sl@0: EXPORT_C TInt DSimulatedPowerResourceController::CaptureIdleResourcesInfo(TUint aControllerId, TUint aNumResources, TPtr* aPtr) sl@0: { sl@0: Kern::Printf("DSimulatedPowerResourceController::CaptureIdleResourcesInfo\n"); sl@0: TInt r = TheController.RegisterResourcesForIdle(aControllerId, aNumResources, aPtr); sl@0: return r; sl@0: } sl@0: sl@0: /** This function is used only for testing purpose. This is complete the initialization of resource controller. sl@0: This is used to test the Postbootlevel and registration of static resource API's. sl@0: */ sl@0: EXPORT_C TInt DSimulatedPowerResourceController::CompleteResourceControllerInitialisation() sl@0: { sl@0: Kern::Printf("DSimulatedPowerResourceController::CompleteResourceControllerInitialisation()\n"); sl@0: return(TheController.InitResources()); sl@0: } sl@0: sl@0: /** This function changes the state of the resource to appropriate value */ sl@0: TInt DSimulatedPowerResourceController::ChangeResource(TPowerRequest& req, TInt& aCurrentLevel, TInt aMaxLevel, TInt aMinLevel) sl@0: { sl@0: DStaticPowerResource* pR = req.Resource(); sl@0: if(pR->Sense() == DStaticPowerResource::ECustom) //Custom sense set it to specified level sl@0: { sl@0: req.Level() = aCurrentLevel; sl@0: } sl@0: else if(pR->Sense() == DStaticPowerResource::EPositive) sl@0: { sl@0: //Set it to value specified if valid, otherwise minimum or maximum based on the value. sl@0: if(req.Level() > aMaxLevel) sl@0: req.Level() = aMaxLevel; sl@0: else if(req.Level() < aMinLevel) sl@0: req.Level() = aMinLevel; sl@0: aCurrentLevel = req.Level(); sl@0: } sl@0: else sl@0: { sl@0: //Set it to value specified if valid, otherwise minimum or maximum based on the value. sl@0: if( req.Level() < aMaxLevel) sl@0: req.Level() = aMaxLevel; sl@0: else if(req.Level() > aMinLevel) sl@0: req.Level() = aMinLevel; sl@0: aCurrentLevel = req.Level(); sl@0: } sl@0: return KErrNone; sl@0: } sl@0: sl@0: /** This function processes all instantaneous resource types. Instantaneous resources should returned immediately, so sl@0: this function returns immediately after updating the value. */ sl@0: TInt DSimulatedPowerResourceController::ProcessInstantaneousResources(TPowerRequest& req, TInt& aCurrentLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel) sl@0: { sl@0: if(req.ReqType() == TPowerRequest::EGet) sl@0: { sl@0: req.Level() = aCurrentLevel; sl@0: } sl@0: else if(req.ReqType() == TPowerRequest::EChange) sl@0: { sl@0: return ChangeResource(req, aCurrentLevel, aMaxLevel, aMinLevel); sl@0: } sl@0: else if(req.ReqType() == TPowerRequest::ESetDefaultLevel) sl@0: { sl@0: req.Level() = aDefaultLevel; sl@0: aCurrentLevel = aDefaultLevel; sl@0: } sl@0: else sl@0: return KErrNotSupported; sl@0: return KErrNone; sl@0: } sl@0: sl@0: /** Function used for polling resources. */ sl@0: TBool PollingFunction(TAny* ptr) sl@0: { sl@0: static TInt count = 0; sl@0: if(++count == (TInt)ptr) sl@0: { sl@0: count = 0; sl@0: return ETrue; sl@0: } sl@0: return EFalse; sl@0: } sl@0: sl@0: /** This function processes polled resources. It waits for specified time and then performs requested operation sl@0: if the specified operation is long latency operation. sl@0: */ sl@0: TInt DSimulatedPowerResourceController::ProcessPolledResources(TPowerRequest& req, TInt&aCurrentLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel, TInt aBlockTime) sl@0: { sl@0: DStaticPowerResource* pR = req.Resource(); sl@0: if(req.ReqType() == TPowerRequest::EGet) sl@0: { sl@0: if(!pR->LatencyGet()) sl@0: return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); sl@0: Kern::PollingWait(PollingFunction, (TAny*)aBlockTime, 3, aBlockTime); sl@0: req.Level() = aCurrentLevel; sl@0: } sl@0: else if(req.ReqType() == TPowerRequest::EChange) sl@0: { sl@0: if(!pR->LatencySet()) sl@0: return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); sl@0: Kern::PollingWait(PollingFunction, (TAny*)aBlockTime, 3, aBlockTime); sl@0: return ChangeResource(req, aCurrentLevel, aMaxLevel, aMinLevel); sl@0: } sl@0: else if(req.ReqType() == TPowerRequest::ESetDefaultLevel) sl@0: { sl@0: if(!pR->LatencySet()) sl@0: return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); sl@0: Kern::PollingWait(PollingFunction, (TAny*)aBlockTime, 3, aBlockTime); sl@0: req.Level() = aDefaultLevel; sl@0: aCurrentLevel = aDefaultLevel; sl@0: } sl@0: else sl@0: return KErrNotSupported; sl@0: return KErrNone; sl@0: } sl@0: sl@0: /** This function processes event driven resources. It makes the calling function (PIL) to block on fast semaphore sl@0: and starts the timer.The PIL is blocked until the timer expires. sl@0: */ sl@0: TInt DSimulatedPowerResourceController::ProcessEventResources(TPowerRequest& req, TInt& aCurrentLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel, TInt aBlockTime) sl@0: { sl@0: DStaticPowerResource* pR = req.Resource(); sl@0: if(((req.ReqType() == TPowerRequest::EGet) && (!pR->LatencyGet())) || ((req.ReqType() == TPowerRequest::EChange) && (!pR->LatencySet())) || ((req.ReqType() == TPowerRequest::ESetDefaultLevel) && (!pR->LatencySet()))) sl@0: return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); sl@0: iEventFastSem.iOwningThread = (NThreadBase*)NKern::CurrentThread(); sl@0: iEventFastSem.iCount = 0; sl@0: TInt timeout = NKern::TimerTicks(aBlockTime); sl@0: NTimer iEventTimer(TimerIsrFunc, this); sl@0: iEventTimer.OneShot(timeout); sl@0: NKern::FSWait(&iEventFastSem); sl@0: if(req.ReqType() == TPowerRequest::EGet) sl@0: req.Level() = aCurrentLevel; sl@0: else if(req.ReqType() == TPowerRequest::EChange) sl@0: return ChangeResource(req, aCurrentLevel, aMaxLevel, aMinLevel); sl@0: else if(req.ReqType() == TPowerRequest::ESetDefaultLevel) sl@0: { sl@0: req.Level() = aDefaultLevel; sl@0: aCurrentLevel = aDefaultLevel; sl@0: } sl@0: else sl@0: return KErrNotSupported; sl@0: return KErrNone; sl@0: } sl@0: sl@0: //This registers all static resource with resource controller. This function is called by PIL sl@0: TInt DSimulatedPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount) sl@0: { sl@0: Kern::Printf(">DSimulatedPowerResourceController::DoRegisterStaticResources"); sl@0: aStaticResourceArray = (DStaticPowerResource**)new(DStaticPowerResource*[MAX_RESOURCE_COUNT]); sl@0: if(!aStaticResourceArray) sl@0: return KErrNoMemory; sl@0: DStaticPowerResource* pR = NULL; sl@0: sl@0: //Create Binary Single Instantaneous Positive Resource sl@0: pR = new DBSIGISPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel Single Instantaneous Positive Resource sl@0: pR = new DMLSIGISPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary Single Instantaneous Negative Resource sl@0: pR = new DBSIGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel Single Instantaneous Negative Resource sl@0: pR = new DMLSIGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary Single Longlatency Positive Resource sl@0: pR = new DBSLGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel Single Longlatency Positive Resource sl@0: pR = new DMLSLGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary Single Longlatency Get & Instantaneous Set Negative Resource sl@0: pR = new DBSLGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel Single Longlatency Get & Instantaneous Set Negative Resource sl@0: pR = new DMLSLGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary Single Instantaneous Get & Longlatency Set Positive Resource sl@0: pR = new DBSIGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel Single Instantaneous Get & Longlatency Set Positive Resource sl@0: pR = new DMLSIGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary SHared Instantaneous Positive Resource sl@0: pR = new DBSHIGISPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel SHared Instantaneous Positive Resource sl@0: pR = new DMLSHIGISPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary SHared Instantaneous Negative Resource sl@0: pR = new DBSHIGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel SHared Instantaneous Negative Resource sl@0: pR = new DMLSHIGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary SHared Longlatency Positive Resource sl@0: pR = new DBSHLGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel SHared Longlatency Positive Resource sl@0: pR = new DMLSHLGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary SHared Longlatency Get & Instantaneous Set Negative Resource sl@0: pR = new DBSHLGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel SHared Longlatency Get & Instantaneous Set Negative Resource sl@0: pR = new DMLSHLGISNResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create holes in resource array sl@0: aStaticResourceArray[iStaticResourceCount++] = NULL; sl@0: aStaticResourceArray[iStaticResourceCount++] = NULL; sl@0: //Create Binary SHared Instantaneous Get & Longlatency Set Positive Resource sl@0: pR = new DBSHIGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Multilevel SHared Instantaneous Get & Longlatency Set Positive Resource sl@0: pR = new DMLSHIGLSPResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: //Create Binary shared Longlatency get and set Custom Resource sl@0: pR = new DBSHLGLSCResource(); sl@0: if(!pR) sl@0: CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) sl@0: aStaticResourceArray[iStaticResourceCount++] = pR; sl@0: sl@0: iResources = aStaticResourceArray; sl@0: sl@0: aStaticResourceCount = iStaticResourceCount; sl@0: return KErrNone; sl@0: } sl@0: sl@0: //Constructors of all resources sl@0: _LIT(KDBSIGISPResource, "SymbianSimulResource"); sl@0: DBSIGISPResource::DBSIGISPResource() : DStaticPowerResource(KDBSIGISPResource, E_OFF), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) sl@0: { sl@0: iFlags = KBinary; sl@0: } sl@0: sl@0: _LIT(KDMLSIGISPResource, "DMLSIGISPResource"); sl@0: DMLSIGISPResource::DMLSIGISPResource() : DStaticPowerResource(KDMLSIGISPResource, 12), iMinLevel(10), iMaxLevel(75), iCurrentLevel(12) sl@0: { sl@0: iFlags = KMultiLevel; sl@0: } sl@0: sl@0: _LIT(KDBSIGISNResource, "DBSIGISNResource"); sl@0: DBSIGISNResource::DBSIGISNResource() : DStaticPowerResource(KDBSIGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON) sl@0: { sl@0: iFlags = KBinary | KSenseNegative; sl@0: } sl@0: sl@0: _LIT(KDMLSIGISNResource, "DMLSIGISNResource"); sl@0: DMLSIGISNResource::DMLSIGISNResource() : DStaticPowerResource(KDMLSIGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75) sl@0: { sl@0: iFlags = KMultiLevel | KSenseNegative; sl@0: } sl@0: sl@0: _LIT(KDBSLGLSPResource, "DBSLGLSPResource"); sl@0: // change this state to OFF sl@0: DBSLGLSPResource::DBSLGLSPResource() : DStaticPowerResource(KDBSLGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) sl@0: { sl@0: iFlags = KLongLatencyGet | KLongLatencySet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = 5; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDMLSLGLSPResource, "DMLSLGLSPResource"); sl@0: DMLSLGLSPResource::DMLSLGLSPResource() : DStaticPowerResource(KDMLSLGLSPResource, 75), iMinLevel(10), iMaxLevel(75), iCurrentLevel(75), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KLongLatencySet | KLongLatencyGet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDBSLGISNResource, "DBSLGISNResource"); sl@0: DBSLGISNResource::DBSLGISNResource() : DStaticPowerResource(KDBSLGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON), iPolled(ETrue) sl@0: { sl@0: iFlags = KLongLatencyGet | KSenseNegative; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDMLSLGISNResource, "DMLSLGISNResource"); sl@0: DMLSLGISNResource::DMLSLGISNResource() : DStaticPowerResource(KDMLSLGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KLongLatencyGet | KSenseNegative; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDBSIGLSPResource, "DBSIGLSPResource"); sl@0: DBSIGLSPResource::DBSIGLSPResource() : DStaticPowerResource(KDBSIGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) sl@0: { sl@0: iFlags = KBinary | KLongLatencySet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDMLSIGLSPResource, "DMLSIGLSPResource"); sl@0: DMLSIGLSPResource::DMLSIGLSPResource() : DStaticPowerResource(KDMLSIGLSPResource, 75), iMinLevel(10), iMaxLevel(100), iCurrentLevel(75), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KLongLatencySet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDBSHIGISPResource, "DBSHIGISPResource"); sl@0: DBSHIGISPResource::DBSHIGISPResource() : DStaticPowerResource(KDBSHIGISPResource, E_OFF), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) sl@0: { sl@0: iFlags = KBinary | KShared; sl@0: } sl@0: sl@0: _LIT(KDMLSHIGISPResource, "DMLSHIGISPResource"); sl@0: DMLSHIGISPResource::DMLSHIGISPResource() : DStaticPowerResource(KDMLSHIGISPResource, 12), iMinLevel(10), iMaxLevel(75), iCurrentLevel(12) sl@0: { sl@0: iFlags = KMultiLevel | KShared; sl@0: } sl@0: sl@0: _LIT(KDBSHIGISNResource, "DBSHIGISNResource"); sl@0: DBSHIGISNResource::DBSHIGISNResource() : DStaticPowerResource(KDBSHIGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON) sl@0: { sl@0: iFlags = KBinary | KShared | KSenseNegative; sl@0: } sl@0: sl@0: _LIT(KDMLSHIGISNResource, "DMLSHIGISNResource"); sl@0: DMLSHIGISNResource::DMLSHIGISNResource() : DStaticPowerResource(KDMLSHIGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75) sl@0: { sl@0: iFlags = KMultiLevel | KShared | KSenseNegative; sl@0: } sl@0: sl@0: _LIT(KDBSHLGLSPResource, "DBSHLGLSPResource"); sl@0: DBSHLGLSPResource::DBSHLGLSPResource() : DStaticPowerResource(KDBSHLGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) sl@0: { sl@0: iFlags = KBinary | KShared | KLongLatencySet | KLongLatencyGet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDMLSHLGLSPResource, "DMLSHLGLSPResource"); sl@0: DMLSHLGLSPResource::DMLSHLGLSPResource() : DStaticPowerResource(KDMLSHLGLSPResource, 70), iMinLevel(5), iMaxLevel(70), iCurrentLevel(70), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KShared | KLongLatencySet | KLongLatencyGet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDBSHLGISNResource, "DBSHLGISNResource"); sl@0: DBSHLGISNResource::DBSHLGISNResource() : DStaticPowerResource(KDBSHLGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON), iPolled(ETrue) sl@0: { sl@0: iFlags = KBinary | KShared | KLongLatencyGet | KSenseNegative; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDMLSHLGISNResource, "DMLSHLGISNResource"); sl@0: DMLSHLGISNResource::DMLSHLGISNResource() : DStaticPowerResource(KDMLSHLGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KShared | KLongLatencySet | KSenseNegative; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDBSHIGLSPResource, "DBSHIGLSPResource"); sl@0: DBSHIGLSPResource::DBSHIGLSPResource() : DStaticPowerResource(KDBSHIGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) sl@0: { sl@0: iFlags = KBinary | KShared | KLongLatencySet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDMLSHIGLSPResource, "DMLSHIGLSPResource"); sl@0: DMLSHIGLSPResource::DMLSHIGLSPResource() : DStaticPowerResource(KDMLSHIGLSPResource, 75), iMinLevel(10), iMaxLevel(75), iCurrentLevel(75), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KShared | KLongLatencySet; sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: _LIT(KDBSHLGLSCResource, "KDBSHLGLSCResource"); sl@0: DBSHLGLSCResource::DBSHLGLSCResource() : DStaticPowerResource(KDBSHLGLSCResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(EFalse) sl@0: { sl@0: iFlags = KMultiLevel | KShared | KLongLatencySet | KSenseCustom; sl@0: SetCustomFunction(CustomFunction); sl@0: NKern::LockSystem(); sl@0: iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; sl@0: NKern::UnlockSystem(); sl@0: } sl@0: sl@0: //DoRequest implementation of all functions sl@0: TInt DBSIGISPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DMLSIGISPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DBSIGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DMLSIGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DBSLGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DMLSLGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DBSLGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DMLSLGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DBSIGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DMLSIGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DBSHIGISPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DMLSHIGISPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DBSHIGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DMLSHIGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); sl@0: } sl@0: sl@0: TInt DBSHLGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DMLSHLGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DBSHLGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DMLSHLGISNResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DBSHIGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DMLSHIGLSPResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: TInt DBSHLGLSCResource::DoRequest(TPowerRequest& req) sl@0: { sl@0: return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); sl@0: } sl@0: sl@0: /** Custom function implemetation*/ sl@0: TBool DBSHLGLSCResource::CustomFunction(TInt &aClientId, const TDesC8& aClientName, sl@0: TUint /*aResourceId*/, sl@0: TCustomOperation aCustomOperation, TInt &aLevel, sl@0: TAny* aLevelList, TAny* /*aReserved*/) sl@0: { sl@0: static TInt ClientId = -1; sl@0: sl@0: Kern::Printf("CustomFunction Passed Clientname = %S\n", &aClientName); sl@0: sl@0: //Allow first client to change the resource state sl@0: if(aCustomOperation == EClientRequestLevel && ClientId == -1) sl@0: { sl@0: ClientId = aClientId; sl@0: return ETrue; sl@0: } sl@0: sl@0: //If client deregisters then ask to set the value to next client level if present, else to default level. sl@0: if(aCustomOperation == EClientRelinquishLevel) sl@0: { sl@0: TInt count = 0; sl@0: SPowerResourceClientLevel* pL = NULL; sl@0: SDblQue* pS = (SDblQue*)aLevelList; sl@0: for(SDblQueLink* pCL=pS->First();pCL!=&pS->iA;pCL=pCL->iNext) sl@0: { sl@0: count++; sl@0: pL=(SPowerResourceClientLevel*)pCL; sl@0: if((pL->iClientId != (TUint)aClientId)) sl@0: { sl@0: aClientId = pL->iClientId; sl@0: aLevel = pL->iLevel; sl@0: ClientId = aClientId; sl@0: return ETrue; sl@0: } sl@0: } sl@0: if((pL == NULL) || (count == 1)) sl@0: { sl@0: aClientId = -1; sl@0: aLevel = E_OFF; sl@0: ClientId = aClientId; sl@0: return ETrue; sl@0: } sl@0: } sl@0: sl@0: /*Allow if the current client is asking to state change to E_ON. sl@0: Also change is allowed if current client asks for E_OFF and no other sl@0: client is holding requirement for E_ON sl@0: */ sl@0: if(aClientId == ClientId) sl@0: { sl@0: if(aLevel == E_ON) sl@0: return ETrue; sl@0: SPowerResourceClientLevel* pL = NULL; sl@0: SDblQue* pS = (SDblQue*)aLevelList; sl@0: for(SDblQueLink* pCL=pS->First();pCL!=&pS->iA;pCL=pCL->iNext) sl@0: { sl@0: pL=(SPowerResourceClientLevel*)pCL; sl@0: if(pL->iLevel == E_ON) sl@0: { sl@0: aClientId = pL->iClientId; sl@0: ClientId = pL->iClientId; sl@0: aLevel = E_ON; sl@0: return EFalse; sl@0: } sl@0: } sl@0: return ETrue; sl@0: } sl@0: return EFalse; sl@0: } sl@0: sl@0: //Get info implementation of all resources. sl@0: TInt DBSIGISPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSIGISPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSIGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSIGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSLGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSLGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSLGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSLGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSIGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSIGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSHIGISPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSHIGISPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSHIGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSHIGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSHLGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSHLGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSHLGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSHLGISNResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSHIGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DMLSHIGLSPResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: } sl@0: sl@0: TInt DBSHLGLSCResource::GetInfo(TDes8* info) const sl@0: { sl@0: DStaticPowerResource::GetInfo((TDes8*)info); sl@0: TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; sl@0: buf1->iMinLevel = iMinLevel; sl@0: buf1->iMaxLevel = iMaxLevel; sl@0: return KErrNone; sl@0: }