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