|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\resourceman\resourceman_psl\rescontrol_psl.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "rescontrol_psl.h" |
|
19 TInt KSimulatedRCThreadPriority = 28; |
|
20 #ifdef RESOURCE_MANAGER_SIMULATED_PSL |
|
21 static DSimulatedPowerResourceController TheController; |
|
22 #endif |
|
23 |
|
24 //Resource controller creation |
|
25 #ifdef RESOURCE_MANAGER_SIMULATED_PSL |
|
26 DECLARE_STANDARD_PDD() |
|
27 { |
|
28 TInt r = DPowerResourceController::InitController(); |
|
29 if(r == KErrNone) |
|
30 return new DResConPddFactory; |
|
31 return NULL; |
|
32 } |
|
33 #endif |
|
34 |
|
35 /** ISR function invoked when the specified amount of time expires. This is used for event driven resources. */ |
|
36 void DSimulatedPowerResourceController::TimerIsrFunc(TAny *ptr) |
|
37 { |
|
38 DSimulatedPowerResourceController *pC = (DSimulatedPowerResourceController *)ptr; |
|
39 //Queues a Dfc to signal fast semaphore. |
|
40 pC->iEventDfc.Add(); |
|
41 } |
|
42 |
|
43 /** DFC function to signal the fast semaphore. For event driven resources, the PIL is blocked until specified time (just |
|
44 to simulate hardware event). */ |
|
45 void DSimulatedPowerResourceController::EventDfcFunc(TAny *ptr) |
|
46 { |
|
47 DSimulatedPowerResourceController *pC = (DSimulatedPowerResourceController *)ptr; |
|
48 NKern::FSSignal((NFastSemaphore*)&pC->iEventFastSem); |
|
49 } |
|
50 |
|
51 /** Constructor for simulated resource controller. */ |
|
52 DSimulatedPowerResourceController::DSimulatedPowerResourceController():DPowerResourceController(),iStaticResourceCount(0), iEventDfc(EventDfcFunc, this) |
|
53 { |
|
54 Kern::Printf(">DSimulatedPowerResourceController"); |
|
55 } |
|
56 |
|
57 /** Destructor for simulated resource controller. */ |
|
58 DSimulatedPowerResourceController::~DSimulatedPowerResourceController() |
|
59 { |
|
60 Kern::Printf("DSimulatedPowerResourceController::~DSimulatedPowerResourceController()\n"); |
|
61 ((TDynamicDfcQue*)iDfcQ)->Destroy(); |
|
62 DStaticPowerResource *pR; |
|
63 TUint c; |
|
64 for(c = 0; c < iStaticResourceCount; c++) |
|
65 { |
|
66 pR = iResources[c]; |
|
67 delete pR; |
|
68 } |
|
69 delete []iResources; |
|
70 #ifdef PRM_ENABLE_EXTENDED_VERSION |
|
71 DStaticPowerResourceD* pDR; |
|
72 |
|
73 delete []iNodeArray; //Delete dependency nodes |
|
74 for(c = 0; c < iStaticResDependencyCount; c++) |
|
75 { |
|
76 pDR = iDependencyResources[c]; |
|
77 delete pDR; |
|
78 } |
|
79 delete []iDependencyResources; |
|
80 #endif |
|
81 } |
|
82 |
|
83 #ifdef PRM_ENABLE_EXTENDED_VERSION |
|
84 //Function to return the controller pointer to use in extended psl file |
|
85 DSimulatedPowerResourceController* GetControllerPtr() |
|
86 { |
|
87 return &TheController; |
|
88 } |
|
89 #endif |
|
90 |
|
91 /** This function is called from PIL, during resource controller creation phase. |
|
92 It creates a DFC queue and then invokes setDfcQ function to PIL to set the queue. |
|
93 It calls InitPools function of PIL to create the specified sizes of clients, |
|
94 client levels and requests pools. |
|
95 */ |
|
96 TInt DSimulatedPowerResourceController::DoInitController() |
|
97 { |
|
98 TInt r = KErrNone; |
|
99 Kern::Printf(">DSimulatedPowerResourceController::DoInitController()"); |
|
100 //Create a DFC queue |
|
101 r = Kern::DynamicDfcQCreate((TDynamicDfcQue*&)iDfcQ, KSimulatedRCThreadPriority, KResmanName); |
|
102 if(r != KErrNone) |
|
103 { |
|
104 Kern::Printf("DFC Queue creation failed"); |
|
105 return r; |
|
106 } |
|
107 //Call the resource controller to set the DFCQ |
|
108 SetDfcQ(iDfcQ); |
|
109 |
|
110 #ifdef PRM_ENABLE_EXTENDED_VERSION |
|
111 //Create a DFC Dependency Queue |
|
112 r = Kern::DynamicDfcQCreate((TDynamicDfcQue*&)iDfcQDependency, KSimulatedRCThreadPriority, |
|
113 KResmanName); |
|
114 if(r != KErrNone) |
|
115 { |
|
116 Kern::Printf("DFC Dependency Queue creation failed"); |
|
117 return r; |
|
118 } |
|
119 //Call the resource controller to set the DFCQDependency |
|
120 SetDfcQDependency(iDfcQDependency); |
|
121 #endif |
|
122 //Init pools |
|
123 r = InitPools(KERNEL_CLIENTS, USER_CLIENTS, CLIENT_LEVELS, REQUESTS); |
|
124 return r; |
|
125 } |
|
126 |
|
127 /** This function is used only for testing purpose to test the RegisterResorcesForIdle API |
|
128 ideally will be used by Power controller to obtain the state of the resources will be interested |
|
129 for idle power management. |
|
130 */ |
|
131 EXPORT_C TInt DSimulatedPowerResourceController::CaptureIdleResourcesInfo(TUint aControllerId, TUint aNumResources, TPtr* aPtr) |
|
132 { |
|
133 Kern::Printf("DSimulatedPowerResourceController::CaptureIdleResourcesInfo\n"); |
|
134 TInt r = TheController.RegisterResourcesForIdle(aControllerId, aNumResources, aPtr); |
|
135 return r; |
|
136 } |
|
137 |
|
138 /** This function is used only for testing purpose. This is complete the initialization of resource controller. |
|
139 This is used to test the Postbootlevel and registration of static resource API's. |
|
140 */ |
|
141 EXPORT_C TInt DSimulatedPowerResourceController::CompleteResourceControllerInitialisation() |
|
142 { |
|
143 Kern::Printf("DSimulatedPowerResourceController::CompleteResourceControllerInitialisation()\n"); |
|
144 return(TheController.InitResources()); |
|
145 } |
|
146 |
|
147 /** This function changes the state of the resource to appropriate value */ |
|
148 TInt DSimulatedPowerResourceController::ChangeResource(TPowerRequest& req, TInt& aCurrentLevel, TInt aMaxLevel, TInt aMinLevel) |
|
149 { |
|
150 DStaticPowerResource* pR = req.Resource(); |
|
151 if(pR->Sense() == DStaticPowerResource::ECustom) //Custom sense set it to specified level |
|
152 { |
|
153 req.Level() = aCurrentLevel; |
|
154 } |
|
155 else if(pR->Sense() == DStaticPowerResource::EPositive) |
|
156 { |
|
157 //Set it to value specified if valid, otherwise minimum or maximum based on the value. |
|
158 if(req.Level() > aMaxLevel) |
|
159 req.Level() = aMaxLevel; |
|
160 else if(req.Level() < aMinLevel) |
|
161 req.Level() = aMinLevel; |
|
162 aCurrentLevel = req.Level(); |
|
163 } |
|
164 else |
|
165 { |
|
166 //Set it to value specified if valid, otherwise minimum or maximum based on the value. |
|
167 if( req.Level() < aMaxLevel) |
|
168 req.Level() = aMaxLevel; |
|
169 else if(req.Level() > aMinLevel) |
|
170 req.Level() = aMinLevel; |
|
171 aCurrentLevel = req.Level(); |
|
172 } |
|
173 return KErrNone; |
|
174 } |
|
175 |
|
176 /** This function processes all instantaneous resource types. Instantaneous resources should returned immediately, so |
|
177 this function returns immediately after updating the value. */ |
|
178 TInt DSimulatedPowerResourceController::ProcessInstantaneousResources(TPowerRequest& req, TInt& aCurrentLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel) |
|
179 { |
|
180 if(req.ReqType() == TPowerRequest::EGet) |
|
181 { |
|
182 req.Level() = aCurrentLevel; |
|
183 } |
|
184 else if(req.ReqType() == TPowerRequest::EChange) |
|
185 { |
|
186 return ChangeResource(req, aCurrentLevel, aMaxLevel, aMinLevel); |
|
187 } |
|
188 else if(req.ReqType() == TPowerRequest::ESetDefaultLevel) |
|
189 { |
|
190 req.Level() = aDefaultLevel; |
|
191 aCurrentLevel = aDefaultLevel; |
|
192 } |
|
193 else |
|
194 return KErrNotSupported; |
|
195 return KErrNone; |
|
196 } |
|
197 |
|
198 /** Function used for polling resources. */ |
|
199 TBool PollingFunction(TAny* ptr) |
|
200 { |
|
201 static TInt count = 0; |
|
202 if(++count == (TInt)ptr) |
|
203 { |
|
204 count = 0; |
|
205 return ETrue; |
|
206 } |
|
207 return EFalse; |
|
208 } |
|
209 |
|
210 /** This function processes polled resources. It waits for specified time and then performs requested operation |
|
211 if the specified operation is long latency operation. |
|
212 */ |
|
213 TInt DSimulatedPowerResourceController::ProcessPolledResources(TPowerRequest& req, TInt&aCurrentLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel, TInt aBlockTime) |
|
214 { |
|
215 DStaticPowerResource* pR = req.Resource(); |
|
216 if(req.ReqType() == TPowerRequest::EGet) |
|
217 { |
|
218 if(!pR->LatencyGet()) |
|
219 return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); |
|
220 Kern::PollingWait(PollingFunction, (TAny*)aBlockTime, 3, aBlockTime); |
|
221 req.Level() = aCurrentLevel; |
|
222 } |
|
223 else if(req.ReqType() == TPowerRequest::EChange) |
|
224 { |
|
225 if(!pR->LatencySet()) |
|
226 return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); |
|
227 Kern::PollingWait(PollingFunction, (TAny*)aBlockTime, 3, aBlockTime); |
|
228 return ChangeResource(req, aCurrentLevel, aMaxLevel, aMinLevel); |
|
229 } |
|
230 else if(req.ReqType() == TPowerRequest::ESetDefaultLevel) |
|
231 { |
|
232 if(!pR->LatencySet()) |
|
233 return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); |
|
234 Kern::PollingWait(PollingFunction, (TAny*)aBlockTime, 3, aBlockTime); |
|
235 req.Level() = aDefaultLevel; |
|
236 aCurrentLevel = aDefaultLevel; |
|
237 } |
|
238 else |
|
239 return KErrNotSupported; |
|
240 return KErrNone; |
|
241 } |
|
242 |
|
243 /** This function processes event driven resources. It makes the calling function (PIL) to block on fast semaphore |
|
244 and starts the timer.The PIL is blocked until the timer expires. |
|
245 */ |
|
246 TInt DSimulatedPowerResourceController::ProcessEventResources(TPowerRequest& req, TInt& aCurrentLevel, TInt aMaxLevel, TInt aMinLevel, TInt aDefaultLevel, TInt aBlockTime) |
|
247 { |
|
248 DStaticPowerResource* pR = req.Resource(); |
|
249 if(((req.ReqType() == TPowerRequest::EGet) && (!pR->LatencyGet())) || ((req.ReqType() == TPowerRequest::EChange) && (!pR->LatencySet())) || ((req.ReqType() == TPowerRequest::ESetDefaultLevel) && (!pR->LatencySet()))) |
|
250 return ProcessInstantaneousResources(req, aCurrentLevel, aMaxLevel, aMinLevel, aDefaultLevel); |
|
251 iEventFastSem.iOwningThread = (NThreadBase*)NKern::CurrentThread(); |
|
252 iEventFastSem.iCount = 0; |
|
253 TInt timeout = NKern::TimerTicks(aBlockTime); |
|
254 NTimer iEventTimer(TimerIsrFunc, this); |
|
255 iEventTimer.OneShot(timeout); |
|
256 NKern::FSWait(&iEventFastSem); |
|
257 if(req.ReqType() == TPowerRequest::EGet) |
|
258 req.Level() = aCurrentLevel; |
|
259 else if(req.ReqType() == TPowerRequest::EChange) |
|
260 return ChangeResource(req, aCurrentLevel, aMaxLevel, aMinLevel); |
|
261 else if(req.ReqType() == TPowerRequest::ESetDefaultLevel) |
|
262 { |
|
263 req.Level() = aDefaultLevel; |
|
264 aCurrentLevel = aDefaultLevel; |
|
265 } |
|
266 else |
|
267 return KErrNotSupported; |
|
268 return KErrNone; |
|
269 } |
|
270 |
|
271 //This registers all static resource with resource controller. This function is called by PIL |
|
272 TInt DSimulatedPowerResourceController::DoRegisterStaticResources(DStaticPowerResource**& aStaticResourceArray, TUint16& aStaticResourceCount) |
|
273 { |
|
274 Kern::Printf(">DSimulatedPowerResourceController::DoRegisterStaticResources"); |
|
275 aStaticResourceArray = (DStaticPowerResource**)new(DStaticPowerResource*[MAX_RESOURCE_COUNT]); |
|
276 if(!aStaticResourceArray) |
|
277 return KErrNoMemory; |
|
278 DStaticPowerResource* pR = NULL; |
|
279 |
|
280 //Create Binary Single Instantaneous Positive Resource |
|
281 pR = new DBSIGISPResource(); |
|
282 if(!pR) |
|
283 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
284 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
285 |
|
286 //Create Multilevel Single Instantaneous Positive Resource |
|
287 pR = new DMLSIGISPResource(); |
|
288 if(!pR) |
|
289 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
290 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
291 |
|
292 //Create Binary Single Instantaneous Negative Resource |
|
293 pR = new DBSIGISNResource(); |
|
294 if(!pR) |
|
295 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
296 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
297 |
|
298 //Create Multilevel Single Instantaneous Negative Resource |
|
299 pR = new DMLSIGISNResource(); |
|
300 if(!pR) |
|
301 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
302 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
303 |
|
304 //Create Binary Single Longlatency Positive Resource |
|
305 pR = new DBSLGLSPResource(); |
|
306 if(!pR) |
|
307 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
308 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
309 |
|
310 //Create Multilevel Single Longlatency Positive Resource |
|
311 pR = new DMLSLGLSPResource(); |
|
312 if(!pR) |
|
313 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
314 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
315 |
|
316 //Create Binary Single Longlatency Get & Instantaneous Set Negative Resource |
|
317 pR = new DBSLGISNResource(); |
|
318 if(!pR) |
|
319 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
320 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
321 |
|
322 //Create Multilevel Single Longlatency Get & Instantaneous Set Negative Resource |
|
323 pR = new DMLSLGISNResource(); |
|
324 if(!pR) |
|
325 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
326 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
327 |
|
328 //Create Binary Single Instantaneous Get & Longlatency Set Positive Resource |
|
329 pR = new DBSIGLSPResource(); |
|
330 if(!pR) |
|
331 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
332 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
333 |
|
334 //Create Multilevel Single Instantaneous Get & Longlatency Set Positive Resource |
|
335 pR = new DMLSIGLSPResource(); |
|
336 if(!pR) |
|
337 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
338 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
339 |
|
340 //Create Binary SHared Instantaneous Positive Resource |
|
341 pR = new DBSHIGISPResource(); |
|
342 if(!pR) |
|
343 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
344 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
345 |
|
346 //Create Multilevel SHared Instantaneous Positive Resource |
|
347 pR = new DMLSHIGISPResource(); |
|
348 if(!pR) |
|
349 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
350 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
351 |
|
352 //Create Binary SHared Instantaneous Negative Resource |
|
353 pR = new DBSHIGISNResource(); |
|
354 if(!pR) |
|
355 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
356 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
357 |
|
358 //Create Multilevel SHared Instantaneous Negative Resource |
|
359 pR = new DMLSHIGISNResource(); |
|
360 if(!pR) |
|
361 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
362 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
363 |
|
364 //Create Binary SHared Longlatency Positive Resource |
|
365 pR = new DBSHLGLSPResource(); |
|
366 if(!pR) |
|
367 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
368 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
369 |
|
370 //Create Multilevel SHared Longlatency Positive Resource |
|
371 pR = new DMLSHLGLSPResource(); |
|
372 if(!pR) |
|
373 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
374 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
375 |
|
376 //Create Binary SHared Longlatency Get & Instantaneous Set Negative Resource |
|
377 pR = new DBSHLGISNResource(); |
|
378 if(!pR) |
|
379 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
380 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
381 |
|
382 //Create Multilevel SHared Longlatency Get & Instantaneous Set Negative Resource |
|
383 pR = new DMLSHLGISNResource(); |
|
384 if(!pR) |
|
385 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
386 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
387 |
|
388 //Create holes in resource array |
|
389 aStaticResourceArray[iStaticResourceCount++] = NULL; |
|
390 aStaticResourceArray[iStaticResourceCount++] = NULL; |
|
391 //Create Binary SHared Instantaneous Get & Longlatency Set Positive Resource |
|
392 pR = new DBSHIGLSPResource(); |
|
393 if(!pR) |
|
394 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
395 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
396 |
|
397 //Create Multilevel SHared Instantaneous Get & Longlatency Set Positive Resource |
|
398 pR = new DMLSHIGLSPResource(); |
|
399 if(!pR) |
|
400 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
401 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
402 |
|
403 //Create Binary shared Longlatency get and set Custom Resource |
|
404 pR = new DBSHLGLSCResource(); |
|
405 if(!pR) |
|
406 CLEAN_AND_RETURN(iStaticResourceCount, aStaticResourceArray, KErrNoMemory) |
|
407 aStaticResourceArray[iStaticResourceCount++] = pR; |
|
408 |
|
409 iResources = aStaticResourceArray; |
|
410 |
|
411 aStaticResourceCount = iStaticResourceCount; |
|
412 return KErrNone; |
|
413 } |
|
414 |
|
415 //Constructors of all resources |
|
416 _LIT(KDBSIGISPResource, "SymbianSimulResource"); |
|
417 DBSIGISPResource::DBSIGISPResource() : DStaticPowerResource(KDBSIGISPResource, E_OFF), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) |
|
418 { |
|
419 iFlags = KBinary; |
|
420 } |
|
421 |
|
422 _LIT(KDMLSIGISPResource, "DMLSIGISPResource"); |
|
423 DMLSIGISPResource::DMLSIGISPResource() : DStaticPowerResource(KDMLSIGISPResource, 12), iMinLevel(10), iMaxLevel(75), iCurrentLevel(12) |
|
424 { |
|
425 iFlags = KMultiLevel; |
|
426 } |
|
427 |
|
428 _LIT(KDBSIGISNResource, "DBSIGISNResource"); |
|
429 DBSIGISNResource::DBSIGISNResource() : DStaticPowerResource(KDBSIGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON) |
|
430 { |
|
431 iFlags = KBinary | KSenseNegative; |
|
432 } |
|
433 |
|
434 _LIT(KDMLSIGISNResource, "DMLSIGISNResource"); |
|
435 DMLSIGISNResource::DMLSIGISNResource() : DStaticPowerResource(KDMLSIGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75) |
|
436 { |
|
437 iFlags = KMultiLevel | KSenseNegative; |
|
438 } |
|
439 |
|
440 _LIT(KDBSLGLSPResource, "DBSLGLSPResource"); |
|
441 // change this state to OFF |
|
442 DBSLGLSPResource::DBSLGLSPResource() : DStaticPowerResource(KDBSLGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) |
|
443 { |
|
444 iFlags = KLongLatencyGet | KLongLatencySet; |
|
445 NKern::LockSystem(); |
|
446 iBlockTime = 5; |
|
447 NKern::UnlockSystem(); |
|
448 } |
|
449 |
|
450 _LIT(KDMLSLGLSPResource, "DMLSLGLSPResource"); |
|
451 DMLSLGLSPResource::DMLSLGLSPResource() : DStaticPowerResource(KDMLSLGLSPResource, 75), iMinLevel(10), iMaxLevel(75), iCurrentLevel(75), iPolled(EFalse) |
|
452 { |
|
453 iFlags = KMultiLevel | KLongLatencySet | KLongLatencyGet; |
|
454 NKern::LockSystem(); |
|
455 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
456 NKern::UnlockSystem(); |
|
457 } |
|
458 |
|
459 _LIT(KDBSLGISNResource, "DBSLGISNResource"); |
|
460 DBSLGISNResource::DBSLGISNResource() : DStaticPowerResource(KDBSLGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON), iPolled(ETrue) |
|
461 { |
|
462 iFlags = KLongLatencyGet | KSenseNegative; |
|
463 NKern::LockSystem(); |
|
464 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
465 NKern::UnlockSystem(); |
|
466 } |
|
467 |
|
468 _LIT(KDMLSLGISNResource, "DMLSLGISNResource"); |
|
469 DMLSLGISNResource::DMLSLGISNResource() : DStaticPowerResource(KDMLSLGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75), iPolled(EFalse) |
|
470 { |
|
471 iFlags = KMultiLevel | KLongLatencyGet | KSenseNegative; |
|
472 NKern::LockSystem(); |
|
473 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
474 NKern::UnlockSystem(); |
|
475 } |
|
476 |
|
477 _LIT(KDBSIGLSPResource, "DBSIGLSPResource"); |
|
478 DBSIGLSPResource::DBSIGLSPResource() : DStaticPowerResource(KDBSIGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) |
|
479 { |
|
480 iFlags = KBinary | KLongLatencySet; |
|
481 NKern::LockSystem(); |
|
482 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
483 NKern::UnlockSystem(); |
|
484 } |
|
485 |
|
486 _LIT(KDMLSIGLSPResource, "DMLSIGLSPResource"); |
|
487 DMLSIGLSPResource::DMLSIGLSPResource() : DStaticPowerResource(KDMLSIGLSPResource, 75), iMinLevel(10), iMaxLevel(100), iCurrentLevel(75), iPolled(EFalse) |
|
488 { |
|
489 iFlags = KMultiLevel | KLongLatencySet; |
|
490 NKern::LockSystem(); |
|
491 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
492 NKern::UnlockSystem(); |
|
493 } |
|
494 |
|
495 _LIT(KDBSHIGISPResource, "DBSHIGISPResource"); |
|
496 DBSHIGISPResource::DBSHIGISPResource() : DStaticPowerResource(KDBSHIGISPResource, E_OFF), iMinLevel(0), iMaxLevel(1), iCurrentLevel(0) |
|
497 { |
|
498 iFlags = KBinary | KShared; |
|
499 } |
|
500 |
|
501 _LIT(KDMLSHIGISPResource, "DMLSHIGISPResource"); |
|
502 DMLSHIGISPResource::DMLSHIGISPResource() : DStaticPowerResource(KDMLSHIGISPResource, 12), iMinLevel(10), iMaxLevel(75), iCurrentLevel(12) |
|
503 { |
|
504 iFlags = KMultiLevel | KShared; |
|
505 } |
|
506 |
|
507 _LIT(KDBSHIGISNResource, "DBSHIGISNResource"); |
|
508 DBSHIGISNResource::DBSHIGISNResource() : DStaticPowerResource(KDBSHIGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON) |
|
509 { |
|
510 iFlags = KBinary | KShared | KSenseNegative; |
|
511 } |
|
512 |
|
513 _LIT(KDMLSHIGISNResource, "DMLSHIGISNResource"); |
|
514 DMLSHIGISNResource::DMLSHIGISNResource() : DStaticPowerResource(KDMLSHIGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75) |
|
515 { |
|
516 iFlags = KMultiLevel | KShared | KSenseNegative; |
|
517 } |
|
518 |
|
519 _LIT(KDBSHLGLSPResource, "DBSHLGLSPResource"); |
|
520 DBSHLGLSPResource::DBSHLGLSPResource() : DStaticPowerResource(KDBSHLGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) |
|
521 { |
|
522 iFlags = KBinary | KShared | KLongLatencySet | KLongLatencyGet; |
|
523 NKern::LockSystem(); |
|
524 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
525 NKern::UnlockSystem(); |
|
526 } |
|
527 |
|
528 _LIT(KDMLSHLGLSPResource, "DMLSHLGLSPResource"); |
|
529 DMLSHLGLSPResource::DMLSHLGLSPResource() : DStaticPowerResource(KDMLSHLGLSPResource, 70), iMinLevel(5), iMaxLevel(70), iCurrentLevel(70), iPolled(EFalse) |
|
530 { |
|
531 iFlags = KMultiLevel | KShared | KLongLatencySet | KLongLatencyGet; |
|
532 NKern::LockSystem(); |
|
533 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
534 NKern::UnlockSystem(); |
|
535 } |
|
536 |
|
537 _LIT(KDBSHLGISNResource, "DBSHLGISNResource"); |
|
538 DBSHLGISNResource::DBSHLGISNResource() : DStaticPowerResource(KDBSHLGISNResource, E_ON), iMinLevel(E_ON), iMaxLevel(E_OFF), iCurrentLevel(E_ON), iPolled(ETrue) |
|
539 { |
|
540 iFlags = KBinary | KShared | KLongLatencyGet | KSenseNegative; |
|
541 NKern::LockSystem(); |
|
542 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
543 NKern::UnlockSystem(); |
|
544 } |
|
545 |
|
546 _LIT(KDMLSHLGISNResource, "DMLSHLGISNResource"); |
|
547 DMLSHLGISNResource::DMLSHLGISNResource() : DStaticPowerResource(KDMLSHLGISNResource, 75), iMinLevel(75), iMaxLevel(10), iCurrentLevel(75), iPolled(EFalse) |
|
548 { |
|
549 iFlags = KMultiLevel | KShared | KLongLatencySet | KSenseNegative; |
|
550 NKern::LockSystem(); |
|
551 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
552 NKern::UnlockSystem(); |
|
553 } |
|
554 |
|
555 _LIT(KDBSHIGLSPResource, "DBSHIGLSPResource"); |
|
556 DBSHIGLSPResource::DBSHIGLSPResource() : DStaticPowerResource(KDBSHIGLSPResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(ETrue) |
|
557 { |
|
558 iFlags = KBinary | KShared | KLongLatencySet; |
|
559 NKern::LockSystem(); |
|
560 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
561 NKern::UnlockSystem(); |
|
562 } |
|
563 |
|
564 _LIT(KDMLSHIGLSPResource, "DMLSHIGLSPResource"); |
|
565 DMLSHIGLSPResource::DMLSHIGLSPResource() : DStaticPowerResource(KDMLSHIGLSPResource, 75), iMinLevel(10), iMaxLevel(75), iCurrentLevel(75), iPolled(EFalse) |
|
566 { |
|
567 iFlags = KMultiLevel | KShared | KLongLatencySet; |
|
568 NKern::LockSystem(); |
|
569 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
570 NKern::UnlockSystem(); |
|
571 } |
|
572 |
|
573 _LIT(KDBSHLGLSCResource, "KDBSHLGLSCResource"); |
|
574 DBSHLGLSCResource::DBSHLGLSCResource() : DStaticPowerResource(KDBSHLGLSCResource, E_ON), iMinLevel(E_OFF), iMaxLevel(E_ON), iCurrentLevel(E_ON), iPolled(EFalse) |
|
575 { |
|
576 iFlags = KMultiLevel | KShared | KLongLatencySet | KSenseCustom; |
|
577 SetCustomFunction(CustomFunction); |
|
578 NKern::LockSystem(); |
|
579 iBlockTime = MIN_BLOCK_TIME + Kern::Random() % MAX_BLOCK_TIME; |
|
580 NKern::UnlockSystem(); |
|
581 } |
|
582 |
|
583 //DoRequest implementation of all functions |
|
584 TInt DBSIGISPResource::DoRequest(TPowerRequest& req) |
|
585 { |
|
586 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
587 } |
|
588 |
|
589 TInt DMLSIGISPResource::DoRequest(TPowerRequest& req) |
|
590 { |
|
591 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
592 } |
|
593 |
|
594 TInt DBSIGISNResource::DoRequest(TPowerRequest& req) |
|
595 { |
|
596 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
597 } |
|
598 |
|
599 TInt DMLSIGISNResource::DoRequest(TPowerRequest& req) |
|
600 { |
|
601 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
602 } |
|
603 |
|
604 TInt DBSLGLSPResource::DoRequest(TPowerRequest& req) |
|
605 { |
|
606 return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
607 } |
|
608 |
|
609 TInt DMLSLGLSPResource::DoRequest(TPowerRequest& req) |
|
610 { |
|
611 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
612 } |
|
613 |
|
614 TInt DBSLGISNResource::DoRequest(TPowerRequest& req) |
|
615 { |
|
616 return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
617 } |
|
618 |
|
619 TInt DMLSLGISNResource::DoRequest(TPowerRequest& req) |
|
620 { |
|
621 return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
622 } |
|
623 |
|
624 TInt DBSIGLSPResource::DoRequest(TPowerRequest& req) |
|
625 { |
|
626 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
627 } |
|
628 |
|
629 TInt DMLSIGLSPResource::DoRequest(TPowerRequest& req) |
|
630 { |
|
631 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
632 } |
|
633 |
|
634 TInt DBSHIGISPResource::DoRequest(TPowerRequest& req) |
|
635 { |
|
636 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
637 } |
|
638 |
|
639 TInt DMLSHIGISPResource::DoRequest(TPowerRequest& req) |
|
640 { |
|
641 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
642 } |
|
643 |
|
644 TInt DBSHIGISNResource::DoRequest(TPowerRequest& req) |
|
645 { |
|
646 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
647 } |
|
648 |
|
649 TInt DMLSHIGISNResource::DoRequest(TPowerRequest& req) |
|
650 { |
|
651 return TheController.ProcessInstantaneousResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel); |
|
652 } |
|
653 |
|
654 TInt DBSHLGLSPResource::DoRequest(TPowerRequest& req) |
|
655 { |
|
656 return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
657 } |
|
658 |
|
659 TInt DMLSHLGLSPResource::DoRequest(TPowerRequest& req) |
|
660 { |
|
661 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
662 } |
|
663 |
|
664 TInt DBSHLGISNResource::DoRequest(TPowerRequest& req) |
|
665 { |
|
666 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
667 } |
|
668 |
|
669 TInt DMLSHLGISNResource::DoRequest(TPowerRequest& req) |
|
670 { |
|
671 return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
672 } |
|
673 |
|
674 TInt DBSHIGLSPResource::DoRequest(TPowerRequest& req) |
|
675 { |
|
676 return TheController.ProcessPolledResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
677 } |
|
678 |
|
679 TInt DMLSHIGLSPResource::DoRequest(TPowerRequest& req) |
|
680 { |
|
681 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
682 } |
|
683 |
|
684 TInt DBSHLGLSCResource::DoRequest(TPowerRequest& req) |
|
685 { |
|
686 return TheController.ProcessEventResources(req, iCurrentLevel, iMaxLevel, iMinLevel, iDefaultLevel, iBlockTime); |
|
687 } |
|
688 |
|
689 /** Custom function implemetation*/ |
|
690 TBool DBSHLGLSCResource::CustomFunction(TInt &aClientId, const TDesC8& aClientName, |
|
691 TUint /*aResourceId*/, |
|
692 TCustomOperation aCustomOperation, TInt &aLevel, |
|
693 TAny* aLevelList, TAny* /*aReserved*/) |
|
694 { |
|
695 static TInt ClientId = -1; |
|
696 |
|
697 Kern::Printf("CustomFunction Passed Clientname = %S\n", &aClientName); |
|
698 |
|
699 //Allow first client to change the resource state |
|
700 if(aCustomOperation == EClientRequestLevel && ClientId == -1) |
|
701 { |
|
702 ClientId = aClientId; |
|
703 return ETrue; |
|
704 } |
|
705 |
|
706 //If client deregisters then ask to set the value to next client level if present, else to default level. |
|
707 if(aCustomOperation == EClientRelinquishLevel) |
|
708 { |
|
709 TInt count = 0; |
|
710 SPowerResourceClientLevel* pL = NULL; |
|
711 SDblQue* pS = (SDblQue*)aLevelList; |
|
712 for(SDblQueLink* pCL=pS->First();pCL!=&pS->iA;pCL=pCL->iNext) |
|
713 { |
|
714 count++; |
|
715 pL=(SPowerResourceClientLevel*)pCL; |
|
716 if((pL->iClientId != (TUint)aClientId)) |
|
717 { |
|
718 aClientId = pL->iClientId; |
|
719 aLevel = pL->iLevel; |
|
720 ClientId = aClientId; |
|
721 return ETrue; |
|
722 } |
|
723 } |
|
724 if((pL == NULL) || (count == 1)) |
|
725 { |
|
726 aClientId = -1; |
|
727 aLevel = E_OFF; |
|
728 ClientId = aClientId; |
|
729 return ETrue; |
|
730 } |
|
731 } |
|
732 |
|
733 /*Allow if the current client is asking to state change to E_ON. |
|
734 Also change is allowed if current client asks for E_OFF and no other |
|
735 client is holding requirement for E_ON |
|
736 */ |
|
737 if(aClientId == ClientId) |
|
738 { |
|
739 if(aLevel == E_ON) |
|
740 return ETrue; |
|
741 SPowerResourceClientLevel* pL = NULL; |
|
742 SDblQue* pS = (SDblQue*)aLevelList; |
|
743 for(SDblQueLink* pCL=pS->First();pCL!=&pS->iA;pCL=pCL->iNext) |
|
744 { |
|
745 pL=(SPowerResourceClientLevel*)pCL; |
|
746 if(pL->iLevel == E_ON) |
|
747 { |
|
748 aClientId = pL->iClientId; |
|
749 ClientId = pL->iClientId; |
|
750 aLevel = E_ON; |
|
751 return EFalse; |
|
752 } |
|
753 } |
|
754 return ETrue; |
|
755 } |
|
756 return EFalse; |
|
757 } |
|
758 |
|
759 //Get info implementation of all resources. |
|
760 TInt DBSIGISPResource::GetInfo(TDes8* info) const |
|
761 { |
|
762 DStaticPowerResource::GetInfo((TDes8*)info); |
|
763 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
764 buf1->iMinLevel = iMinLevel; |
|
765 buf1->iMaxLevel = iMaxLevel; |
|
766 return KErrNone; |
|
767 } |
|
768 |
|
769 TInt DMLSIGISPResource::GetInfo(TDes8* info) const |
|
770 { |
|
771 DStaticPowerResource::GetInfo((TDes8*)info); |
|
772 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
773 buf1->iMinLevel = iMinLevel; |
|
774 buf1->iMaxLevel = iMaxLevel; |
|
775 return KErrNone; |
|
776 } |
|
777 |
|
778 TInt DBSIGISNResource::GetInfo(TDes8* info) const |
|
779 { |
|
780 DStaticPowerResource::GetInfo((TDes8*)info); |
|
781 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
782 buf1->iMinLevel = iMinLevel; |
|
783 buf1->iMaxLevel = iMaxLevel; |
|
784 return KErrNone; |
|
785 } |
|
786 |
|
787 TInt DMLSIGISNResource::GetInfo(TDes8* info) const |
|
788 { |
|
789 DStaticPowerResource::GetInfo((TDes8*)info); |
|
790 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
791 buf1->iMinLevel = iMinLevel; |
|
792 buf1->iMaxLevel = iMaxLevel; |
|
793 return KErrNone; |
|
794 } |
|
795 |
|
796 TInt DBSLGLSPResource::GetInfo(TDes8* info) const |
|
797 { |
|
798 DStaticPowerResource::GetInfo((TDes8*)info); |
|
799 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
800 buf1->iMinLevel = iMinLevel; |
|
801 buf1->iMaxLevel = iMaxLevel; |
|
802 return KErrNone; |
|
803 } |
|
804 |
|
805 TInt DMLSLGLSPResource::GetInfo(TDes8* info) const |
|
806 { |
|
807 DStaticPowerResource::GetInfo((TDes8*)info); |
|
808 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
809 buf1->iMinLevel = iMinLevel; |
|
810 buf1->iMaxLevel = iMaxLevel; |
|
811 return KErrNone; |
|
812 } |
|
813 |
|
814 TInt DBSLGISNResource::GetInfo(TDes8* info) const |
|
815 { |
|
816 DStaticPowerResource::GetInfo((TDes8*)info); |
|
817 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
818 buf1->iMinLevel = iMinLevel; |
|
819 buf1->iMaxLevel = iMaxLevel; |
|
820 return KErrNone; |
|
821 } |
|
822 |
|
823 TInt DMLSLGISNResource::GetInfo(TDes8* info) const |
|
824 { |
|
825 DStaticPowerResource::GetInfo((TDes8*)info); |
|
826 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
827 buf1->iMinLevel = iMinLevel; |
|
828 buf1->iMaxLevel = iMaxLevel; |
|
829 return KErrNone; |
|
830 } |
|
831 |
|
832 TInt DBSIGLSPResource::GetInfo(TDes8* info) const |
|
833 { |
|
834 DStaticPowerResource::GetInfo((TDes8*)info); |
|
835 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
836 buf1->iMinLevel = iMinLevel; |
|
837 buf1->iMaxLevel = iMaxLevel; |
|
838 return KErrNone; |
|
839 } |
|
840 |
|
841 TInt DMLSIGLSPResource::GetInfo(TDes8* info) const |
|
842 { |
|
843 DStaticPowerResource::GetInfo((TDes8*)info); |
|
844 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
845 buf1->iMinLevel = iMinLevel; |
|
846 buf1->iMaxLevel = iMaxLevel; |
|
847 return KErrNone; |
|
848 } |
|
849 |
|
850 TInt DBSHIGISPResource::GetInfo(TDes8* info) const |
|
851 { |
|
852 DStaticPowerResource::GetInfo((TDes8*)info); |
|
853 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
854 buf1->iMinLevel = iMinLevel; |
|
855 buf1->iMaxLevel = iMaxLevel; |
|
856 return KErrNone; |
|
857 } |
|
858 |
|
859 TInt DMLSHIGISPResource::GetInfo(TDes8* info) const |
|
860 { |
|
861 DStaticPowerResource::GetInfo((TDes8*)info); |
|
862 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
863 buf1->iMinLevel = iMinLevel; |
|
864 buf1->iMaxLevel = iMaxLevel; |
|
865 return KErrNone; |
|
866 } |
|
867 |
|
868 TInt DBSHIGISNResource::GetInfo(TDes8* info) const |
|
869 { |
|
870 DStaticPowerResource::GetInfo((TDes8*)info); |
|
871 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
872 buf1->iMinLevel = iMinLevel; |
|
873 buf1->iMaxLevel = iMaxLevel; |
|
874 return KErrNone; |
|
875 } |
|
876 |
|
877 TInt DMLSHIGISNResource::GetInfo(TDes8* info) const |
|
878 { |
|
879 DStaticPowerResource::GetInfo((TDes8*)info); |
|
880 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
881 buf1->iMinLevel = iMinLevel; |
|
882 buf1->iMaxLevel = iMaxLevel; |
|
883 return KErrNone; |
|
884 } |
|
885 |
|
886 TInt DBSHLGLSPResource::GetInfo(TDes8* info) const |
|
887 { |
|
888 DStaticPowerResource::GetInfo((TDes8*)info); |
|
889 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
890 buf1->iMinLevel = iMinLevel; |
|
891 buf1->iMaxLevel = iMaxLevel; |
|
892 return KErrNone; |
|
893 } |
|
894 |
|
895 TInt DMLSHLGLSPResource::GetInfo(TDes8* info) const |
|
896 { |
|
897 DStaticPowerResource::GetInfo((TDes8*)info); |
|
898 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
899 buf1->iMinLevel = iMinLevel; |
|
900 buf1->iMaxLevel = iMaxLevel; |
|
901 return KErrNone; |
|
902 } |
|
903 |
|
904 TInt DBSHLGISNResource::GetInfo(TDes8* info) const |
|
905 { |
|
906 DStaticPowerResource::GetInfo((TDes8*)info); |
|
907 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
908 buf1->iMinLevel = iMinLevel; |
|
909 buf1->iMaxLevel = iMaxLevel; |
|
910 return KErrNone; |
|
911 } |
|
912 |
|
913 TInt DMLSHLGISNResource::GetInfo(TDes8* info) const |
|
914 { |
|
915 DStaticPowerResource::GetInfo((TDes8*)info); |
|
916 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
917 buf1->iMinLevel = iMinLevel; |
|
918 buf1->iMaxLevel = iMaxLevel; |
|
919 return KErrNone; |
|
920 } |
|
921 |
|
922 TInt DBSHIGLSPResource::GetInfo(TDes8* info) const |
|
923 { |
|
924 DStaticPowerResource::GetInfo((TDes8*)info); |
|
925 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
926 buf1->iMinLevel = iMinLevel; |
|
927 buf1->iMaxLevel = iMaxLevel; |
|
928 return KErrNone; |
|
929 } |
|
930 |
|
931 TInt DMLSHIGLSPResource::GetInfo(TDes8* info) const |
|
932 { |
|
933 DStaticPowerResource::GetInfo((TDes8*)info); |
|
934 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
935 buf1->iMinLevel = iMinLevel; |
|
936 buf1->iMaxLevel = iMaxLevel; |
|
937 return KErrNone; |
|
938 } |
|
939 |
|
940 TInt DBSHLGLSCResource::GetInfo(TDes8* info) const |
|
941 { |
|
942 DStaticPowerResource::GetInfo((TDes8*)info); |
|
943 TPowerResourceInfoV01 *buf1 = (TPowerResourceInfoV01*)info; |
|
944 buf1->iMinLevel = iMinLevel; |
|
945 buf1->iMaxLevel = iMaxLevel; |
|
946 return KErrNone; |
|
947 } |