|
1 /* |
|
2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Sensor and channel property container. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <sensrvproperty.h> |
|
20 #include "sensrvtrace.h" |
|
21 |
|
22 _LIT(KSensrvPropertyPanic, "SensrvProperty"); |
|
23 |
|
24 // Tracing macros for property contents |
|
25 #ifdef API_TRACE_DEBUG |
|
26 |
|
27 #define _TRACE_INT_PROPERTY_ API_TRACE((_L("Sensor Util - TSensrvProperty::TSensrvProperty - iPropertyId=%d, iItemIndex=%d, iIntValue=%d, iFlags=%d, iIntValueMax=%d, iIntValueMin=%d, iPropertyType=ESensrvIntProperty"),iPropertyId,iItemIndex,iIntValue,iFlags.Value(),iIntValueMax,iIntValueMin)); |
|
28 #define _TRACE_REAL_PROPERTY_ API_TRACE((_L("Sensor Util - TSensrvProperty::TSensrvProperty - iPropertyId=%d, iItemIndex=%d, iRealValue=%f, iFlags=%d, iRealValueMax=%f, iRealValueMin=%f, iPropertyType=ESensrvRealProperty"),iPropertyId,iItemIndex,iRealValue,iFlags.Value(),iRealValueMax,iRealValueMin)); |
|
29 #define COPY_BUFFER(buffer) \ |
|
30 TBuf<KSensrvPropertyTextBufferSize> buf;\ |
|
31 buf.Copy(buffer); |
|
32 |
|
33 #define _TRACE_BUFFER_PROPERTY_ \ |
|
34 COPY_BUFFER(iBufValue);\ |
|
35 API_TRACE((_L("Sensor Util - TSensrvProperty::TSensrvProperty - iPropertyId=%d, iItemIndex=%d, iBufValue=%S, iFlags=%d, iPropertyType=ESensrvBufferProperty"),iPropertyId,iItemIndex,&buf,iFlags.Value())); |
|
36 |
|
37 #define _TRACE_BUFVALUE(function,buffer) \ |
|
38 COPY_BUFFER(buffer);\ |
|
39 API_TRACE((_L("Sensor Util - TSensrvProperty::%S - buffer:%S"), &function, &buf)); |
|
40 |
|
41 _LIT(KSensrvFunctionNameSetValue, "SetValue"); |
|
42 _LIT(KSensrvFunctionNameGetValue, "GetValue"); |
|
43 _LIT(KSensrvFunctionNameGetValueRef, "GetValueRef"); |
|
44 |
|
45 #else |
|
46 |
|
47 #define _TRACE_INT_PROPERTY_ |
|
48 #define _TRACE_REAL_PROPERTY_ |
|
49 #define _TRACE_BUFFER_PROPERTY_ |
|
50 #define _TRACE_BUFVALUE(function,buffer) |
|
51 |
|
52 #endif |
|
53 |
|
54 |
|
55 // ======== MEMBER FUNCTIONS ======== |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // TSensrvProperty::TSensrvProperty() |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 EXPORT_C TSensrvProperty::TSensrvProperty() |
|
62 : iArrayIndex( ESensrvSingleProperty ), |
|
63 iFlags( EFalse ), |
|
64 iPropertyType( ESensrvUninitializedProperty ), |
|
65 iReserved( 0 ) |
|
66 { |
|
67 API_TRACE((_L("Sensor Util - TSensrvProperty::TSensrvProperty - iPropertyType=ESensrvUninitializedProperty"))); |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // TSensrvProperty::TSensrvProperty() |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C TSensrvProperty::TSensrvProperty( const TSensrvPropertyId aPropertyId, |
|
75 const TInt aItemIndex, |
|
76 const TInt aValue, |
|
77 const TInt aMaxValue, |
|
78 const TInt aMinValue, |
|
79 const TBool aReadOnly, |
|
80 const TSensrvPropertyType aPropertyType ) |
|
81 : iPropertyId( aPropertyId ), |
|
82 iItemIndex( aItemIndex ), |
|
83 iArrayIndex( ESensrvSingleProperty ), |
|
84 iIntValue( aValue ), |
|
85 iFlags( aReadOnly ), |
|
86 iIntValueMax( aMaxValue ), |
|
87 iIntValueMin( aMinValue ), |
|
88 iPropertyType( aPropertyType ), |
|
89 iReserved( 0 ) |
|
90 { |
|
91 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
92 |
|
93 _TRACE_INT_PROPERTY_ |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // TSensrvProperty::TSensrvProperty() |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 EXPORT_C TSensrvProperty::TSensrvProperty( const TSensrvPropertyId aPropertyId, |
|
101 const TInt aItemIndex, |
|
102 const TInt aValue ) |
|
103 : iPropertyId( aPropertyId ), |
|
104 iItemIndex( aItemIndex ), |
|
105 iArrayIndex( ESensrvSingleProperty ), |
|
106 iIntValue( aValue ), |
|
107 iFlags( EFalse ), |
|
108 iIntValueMax( 0 ), |
|
109 iIntValueMin( 0 ), |
|
110 iPropertyType( ESensrvIntProperty ), |
|
111 iReserved( 0 ) |
|
112 { |
|
113 _TRACE_INT_PROPERTY_ |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // TSensrvProperty::TSensrvProperty() |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 EXPORT_C TSensrvProperty::TSensrvProperty( const TSensrvPropertyId aPropertyId, |
|
121 const TInt aItemIndex, |
|
122 const TReal aValue, |
|
123 const TReal aMaxValue, |
|
124 const TReal aMinValue, |
|
125 const TBool aReadOnly, |
|
126 const TSensrvPropertyType aPropertyType ) |
|
127 : iPropertyId( aPropertyId ), |
|
128 iItemIndex( aItemIndex ), |
|
129 iArrayIndex( ESensrvSingleProperty ), |
|
130 iRealValue( aValue ), |
|
131 iFlags( aReadOnly ), |
|
132 iRealValueMax( aMaxValue ), |
|
133 iRealValueMin( aMinValue ), |
|
134 iPropertyType( aPropertyType ), |
|
135 iReserved( 0 ) |
|
136 { |
|
137 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
138 |
|
139 _TRACE_REAL_PROPERTY_ |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------------------------- |
|
143 // TSensrvProperty::TSensrvProperty() |
|
144 // --------------------------------------------------------------------------- |
|
145 // |
|
146 EXPORT_C TSensrvProperty::TSensrvProperty( const TSensrvPropertyId aPropertyId, |
|
147 const TInt aItemIndex, |
|
148 const TReal aValue ) |
|
149 : iPropertyId( aPropertyId ), |
|
150 iItemIndex( aItemIndex ), |
|
151 iArrayIndex( ESensrvSingleProperty ), |
|
152 iRealValue( aValue ), |
|
153 iFlags( EFalse ), |
|
154 iRealValueMax( 0 ), |
|
155 iRealValueMin( 0 ), |
|
156 iPropertyType( ESensrvRealProperty ), |
|
157 iReserved( 0 ) |
|
158 { |
|
159 _TRACE_REAL_PROPERTY_ |
|
160 } |
|
161 |
|
162 // --------------------------------------------------------------------------- |
|
163 // TSensrvProperty::TSensrvProperty() |
|
164 // --------------------------------------------------------------------------- |
|
165 // |
|
166 EXPORT_C TSensrvProperty::TSensrvProperty( const TSensrvPropertyId aPropertyId, |
|
167 const TInt aItemIndex, |
|
168 const TDesC8& aValue, |
|
169 const TBool aReadOnly, |
|
170 const TSensrvPropertyType aPropertyType ) |
|
171 : iPropertyId( aPropertyId ), |
|
172 iItemIndex( aItemIndex ), |
|
173 iArrayIndex( ESensrvSingleProperty ), |
|
174 iBufValue( aValue ), |
|
175 iFlags( aReadOnly ), |
|
176 iPropertyType( aPropertyType ), |
|
177 iReserved( 0 ) |
|
178 { |
|
179 __ASSERT_ALWAYS( ESensrvBufferProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
180 |
|
181 _TRACE_BUFFER_PROPERTY_ |
|
182 } |
|
183 |
|
184 // --------------------------------------------------------------------------- |
|
185 // TSensrvProperty::TSensrvProperty() |
|
186 // --------------------------------------------------------------------------- |
|
187 // |
|
188 EXPORT_C TSensrvProperty::TSensrvProperty( const TSensrvPropertyId aPropertyId, |
|
189 const TInt aItemIndex, |
|
190 const TDesC8& aValue ) |
|
191 : iPropertyId( aPropertyId ), |
|
192 iItemIndex( aItemIndex ), |
|
193 iArrayIndex( ESensrvSingleProperty ), |
|
194 iBufValue( aValue ), |
|
195 iFlags( EFalse ), |
|
196 iPropertyType( ESensrvBufferProperty ), |
|
197 iReserved( 0 ) |
|
198 { |
|
199 _TRACE_BUFFER_PROPERTY_ |
|
200 } |
|
201 |
|
202 // --------------------------------------------------------------------------- |
|
203 // TSensrvProperty::GetPropertyId() |
|
204 // --------------------------------------------------------------------------- |
|
205 // |
|
206 EXPORT_C TSensrvPropertyId TSensrvProperty::GetPropertyId() const |
|
207 { |
|
208 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetPropertyId - return %d" ), iPropertyId ) ); |
|
209 return iPropertyId; |
|
210 } |
|
211 |
|
212 // --------------------------------------------------------------------------- |
|
213 // TSensrvProperty::SetPropertyId() |
|
214 // --------------------------------------------------------------------------- |
|
215 // |
|
216 EXPORT_C void TSensrvProperty::SetPropertyId( TSensrvPropertyId aPropertyId ) |
|
217 { |
|
218 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetPropertyId(%d)" ), aPropertyId ) ); |
|
219 iPropertyId = aPropertyId; |
|
220 } |
|
221 |
|
222 // --------------------------------------------------------------------------- |
|
223 // TSensrvProperty::PropertyItemIndex() |
|
224 // --------------------------------------------------------------------------- |
|
225 // |
|
226 EXPORT_C TInt TSensrvProperty::PropertyItemIndex() const |
|
227 { |
|
228 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::PropertyItemIndex - return %d" ), iItemIndex ) ); |
|
229 return iItemIndex; |
|
230 } |
|
231 |
|
232 // --------------------------------------------------------------------------- |
|
233 // TSensrvProperty::SetItemIndex() |
|
234 // --------------------------------------------------------------------------- |
|
235 // |
|
236 EXPORT_C void TSensrvProperty::SetItemIndex( TInt aItemIndex ) |
|
237 { |
|
238 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetItemIndex(%d)" ), aItemIndex ) ); |
|
239 iItemIndex = aItemIndex; |
|
240 } |
|
241 |
|
242 // --------------------------------------------------------------------------- |
|
243 // TSensrvProperty::PropertyType() |
|
244 // --------------------------------------------------------------------------- |
|
245 // |
|
246 EXPORT_C TSensrvPropertyType TSensrvProperty::PropertyType() const |
|
247 { |
|
248 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::PropertyType - return %d" ), iPropertyType ) ); |
|
249 return iPropertyType; |
|
250 } |
|
251 |
|
252 // --------------------------------------------------------------------------- |
|
253 // TSensrvProperty::ReadOnly() |
|
254 // --------------------------------------------------------------------------- |
|
255 // |
|
256 EXPORT_C TBool TSensrvProperty::ReadOnly() const |
|
257 { |
|
258 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::ReadOnly - return %d" ), iFlags.Value() ) ); |
|
259 return ( iFlags.Value() != 0 ); |
|
260 } |
|
261 |
|
262 // --------------------------------------------------------------------------- |
|
263 // TSensrvProperty::SetReadOnly() |
|
264 // --------------------------------------------------------------------------- |
|
265 // |
|
266 EXPORT_C void TSensrvProperty::SetReadOnly( TBool aReadOnly ) |
|
267 { |
|
268 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetReadOnly(aReadOnly:%d)" ), aReadOnly ) ); |
|
269 iFlags = aReadOnly; |
|
270 } |
|
271 |
|
272 // --------------------------------------------------------------------------- |
|
273 // TSensrvProperty::SetValue() |
|
274 // --------------------------------------------------------------------------- |
|
275 // |
|
276 EXPORT_C void TSensrvProperty::SetValue( const TInt aValue ) |
|
277 { |
|
278 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetValue(Value:%d)" ), aValue ) ); |
|
279 |
|
280 if( ESensrvUninitializedProperty == iPropertyType ) |
|
281 { |
|
282 iPropertyType = ESensrvIntProperty; |
|
283 } |
|
284 else |
|
285 { |
|
286 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
287 } |
|
288 |
|
289 iIntValue = aValue; |
|
290 |
|
291 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetValue - return void" ) ) ); |
|
292 } |
|
293 |
|
294 // --------------------------------------------------------------------------- |
|
295 // TSensrvProperty::SetValue() |
|
296 // --------------------------------------------------------------------------- |
|
297 // |
|
298 EXPORT_C void TSensrvProperty::SetValue( const TReal aValue ) |
|
299 { |
|
300 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetValue(Value:%e)" ), aValue ) ); |
|
301 |
|
302 if( ESensrvUninitializedProperty == iPropertyType ) |
|
303 { |
|
304 iPropertyType = ESensrvRealProperty; |
|
305 } |
|
306 else |
|
307 { |
|
308 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
309 } |
|
310 |
|
311 iRealValue = aValue; |
|
312 |
|
313 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetValue - return void" ) ) ); |
|
314 } |
|
315 |
|
316 // --------------------------------------------------------------------------- |
|
317 // TSensrvProperty::SetValue() |
|
318 // --------------------------------------------------------------------------- |
|
319 // |
|
320 EXPORT_C void TSensrvProperty::SetValue( const TDesC8& aValue ) |
|
321 { |
|
322 _TRACE_BUFVALUE(KSensrvFunctionNameSetValue,aValue); |
|
323 |
|
324 if( ESensrvUninitializedProperty == iPropertyType ) |
|
325 { |
|
326 iPropertyType = ESensrvBufferProperty; |
|
327 } |
|
328 else |
|
329 { |
|
330 __ASSERT_ALWAYS( ESensrvBufferProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
331 } |
|
332 |
|
333 iBufValue = aValue; |
|
334 |
|
335 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetValue - return void" ) ) ); |
|
336 } |
|
337 |
|
338 // --------------------------------------------------------------------------- |
|
339 // TSensrvProperty::GetValue() |
|
340 // --------------------------------------------------------------------------- |
|
341 // |
|
342 EXPORT_C void TSensrvProperty::GetValue( TInt& aValue ) const |
|
343 { |
|
344 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetValue return %d" ), iIntValue ) ); |
|
345 |
|
346 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
347 |
|
348 aValue = iIntValue; |
|
349 } |
|
350 |
|
351 // --------------------------------------------------------------------------- |
|
352 // TSensrvProperty::GetValue() |
|
353 // --------------------------------------------------------------------------- |
|
354 // |
|
355 EXPORT_C void TSensrvProperty::GetValue( TReal& aValue ) const |
|
356 { |
|
357 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetValue return %e" ), iRealValue ) ); |
|
358 |
|
359 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
360 |
|
361 aValue = iRealValue; |
|
362 } |
|
363 |
|
364 // --------------------------------------------------------------------------- |
|
365 // TSensrvProperty::GetValue() |
|
366 // --------------------------------------------------------------------------- |
|
367 // |
|
368 EXPORT_C void TSensrvProperty::GetValue( TDes8& aValue ) const |
|
369 { |
|
370 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetValue(<retval>)" ) ) ); |
|
371 |
|
372 __ASSERT_ALWAYS( ESensrvBufferProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
373 |
|
374 aValue.Copy(iBufValue); |
|
375 |
|
376 _TRACE_BUFVALUE(KSensrvFunctionNameGetValue,aValue); |
|
377 } |
|
378 |
|
379 // --------------------------------------------------------------------------- |
|
380 // TSensrvProperty::GetValueRef() |
|
381 // --------------------------------------------------------------------------- |
|
382 // |
|
383 EXPORT_C TDes8& TSensrvProperty::GetValueRef() |
|
384 { |
|
385 _TRACE_BUFVALUE(KSensrvFunctionNameGetValueRef,iBufValue); |
|
386 |
|
387 __ASSERT_ALWAYS( ESensrvBufferProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
388 |
|
389 return iBufValue; |
|
390 } |
|
391 |
|
392 // --------------------------------------------------------------------------- |
|
393 // TSensrvProperty::GetMaxValue() |
|
394 // --------------------------------------------------------------------------- |
|
395 // |
|
396 EXPORT_C void TSensrvProperty::GetMaxValue( TInt& aMaxValue ) const |
|
397 { |
|
398 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetMaxValue return %d" ), iIntValueMax ) ); |
|
399 |
|
400 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
401 |
|
402 aMaxValue = iIntValueMax; |
|
403 } |
|
404 |
|
405 // --------------------------------------------------------------------------- |
|
406 // TSensrvProperty::GetMinValue() |
|
407 // --------------------------------------------------------------------------- |
|
408 // |
|
409 EXPORT_C void TSensrvProperty::GetMinValue( TInt& aMinValue ) const |
|
410 { |
|
411 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetMinValue return %d" ), iIntValueMin ) ); |
|
412 |
|
413 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
414 |
|
415 aMinValue = iIntValueMin; |
|
416 } |
|
417 |
|
418 // --------------------------------------------------------------------------- |
|
419 // TSensrvProperty::SetMaxValue |
|
420 // --------------------------------------------------------------------------- |
|
421 // |
|
422 EXPORT_C void TSensrvProperty::SetMaxValue( TInt aMaxValue ) |
|
423 { |
|
424 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMaxValue(aMaxValue=%d)" ), aMaxValue ) ); |
|
425 |
|
426 if( ESensrvUninitializedProperty == iPropertyType ) |
|
427 { |
|
428 iPropertyType = ESensrvIntProperty; |
|
429 } |
|
430 else |
|
431 { |
|
432 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 ) ); |
|
433 } |
|
434 |
|
435 iIntValueMax = aMaxValue; |
|
436 |
|
437 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMaxValue - return void" ) ) ); |
|
438 } |
|
439 |
|
440 // --------------------------------------------------------------------------- |
|
441 // TSensrvProperty::SetMinValue() |
|
442 // --------------------------------------------------------------------------- |
|
443 // |
|
444 EXPORT_C void TSensrvProperty::SetMinValue( TInt aMinValue ) |
|
445 { |
|
446 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMinValue(aMinValue= %d" ), aMinValue ) ); |
|
447 |
|
448 if( ESensrvUninitializedProperty == iPropertyType ) |
|
449 { |
|
450 iPropertyType = ESensrvIntProperty; |
|
451 } |
|
452 else |
|
453 { |
|
454 __ASSERT_ALWAYS( ESensrvIntProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
455 } |
|
456 |
|
457 iIntValueMin = aMinValue; |
|
458 |
|
459 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMinValue - return void" ) ) ); |
|
460 } |
|
461 |
|
462 // --------------------------------------------------------------------------- |
|
463 // TSensrvProperty::GetMaxValue() |
|
464 // --------------------------------------------------------------------------- |
|
465 // |
|
466 EXPORT_C void TSensrvProperty::GetMaxValue( TReal& aMaxValue ) const |
|
467 { |
|
468 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetMaxValue return %e" ), iRealValueMax ) ); |
|
469 |
|
470 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
471 |
|
472 aMaxValue = iRealValueMax; |
|
473 } |
|
474 |
|
475 // --------------------------------------------------------------------------- |
|
476 // TSensrvProperty::GetMinValue() |
|
477 // --------------------------------------------------------------------------- |
|
478 // |
|
479 EXPORT_C void TSensrvProperty::GetMinValue( TReal& aMinValue ) const |
|
480 { |
|
481 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetMinValue return %e" ), iRealValueMin ) ); |
|
482 |
|
483 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
484 |
|
485 aMinValue = iRealValueMin; |
|
486 } |
|
487 |
|
488 // --------------------------------------------------------------------------- |
|
489 // TSensrvProperty::SetMaxValue |
|
490 // --------------------------------------------------------------------------- |
|
491 // |
|
492 EXPORT_C void TSensrvProperty::SetMaxValue( const TReal& aMaxValue ) |
|
493 { |
|
494 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMaxValue(aMaxValue=%e" ), aMaxValue ) ); |
|
495 |
|
496 if( ESensrvUninitializedProperty == iPropertyType ) |
|
497 { |
|
498 iPropertyType = ESensrvRealProperty; |
|
499 } |
|
500 else |
|
501 { |
|
502 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
503 } |
|
504 |
|
505 iRealValueMax = aMaxValue; |
|
506 |
|
507 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMaxValue - return void" ) ) ); |
|
508 } |
|
509 |
|
510 // --------------------------------------------------------------------------- |
|
511 // TSensrvProperty::SetMinValue |
|
512 // --------------------------------------------------------------------------- |
|
513 // |
|
514 EXPORT_C void TSensrvProperty::SetMinValue( const TReal& aMinValue ) |
|
515 { |
|
516 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMinValue(aMinValue=%e" ), aMinValue ) ); |
|
517 |
|
518 if( ESensrvUninitializedProperty == iPropertyType ) |
|
519 { |
|
520 iPropertyType = ESensrvRealProperty; |
|
521 } |
|
522 else |
|
523 { |
|
524 __ASSERT_ALWAYS( ESensrvRealProperty == iPropertyType, User::Panic( KSensrvPropertyPanic, 0 )); |
|
525 } |
|
526 |
|
527 iRealValueMin = aMinValue; |
|
528 |
|
529 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetMinValue - return void" ) ) ); |
|
530 } |
|
531 |
|
532 // --------------------------------------------------------------------------- |
|
533 // TSensrvProperty::SetSecurityInfo |
|
534 // --------------------------------------------------------------------------- |
|
535 // |
|
536 EXPORT_C void TSensrvProperty::SetSecurityInfo( const TSecurityInfo& aSecurityInfo ) |
|
537 { |
|
538 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetSecurityInfo()" ) ) ); |
|
539 iSecurityInfo = aSecurityInfo; |
|
540 } |
|
541 |
|
542 // --------------------------------------------------------------------------- |
|
543 // TSensrvProperty::GetSecurityInfo() |
|
544 // --------------------------------------------------------------------------- |
|
545 // |
|
546 EXPORT_C TSecurityInfo TSensrvProperty::GetSecurityInfo() const |
|
547 { |
|
548 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetSecurityInfo()" ) ) ); |
|
549 return iSecurityInfo; |
|
550 } |
|
551 |
|
552 // --------------------------------------------------------------------------- |
|
553 // TSensrvProperty::SetArrayIndex() |
|
554 // --------------------------------------------------------------------------- |
|
555 // |
|
556 EXPORT_C void TSensrvProperty::SetArrayIndex( const TInt aArrayIndex ) |
|
557 { |
|
558 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::SetArrayIndex(%d)"), aArrayIndex ) ); |
|
559 iArrayIndex = aArrayIndex; |
|
560 } |
|
561 |
|
562 // --------------------------------------------------------------------------- |
|
563 // TSensrvProperty::GetArrayIndex() |
|
564 // --------------------------------------------------------------------------- |
|
565 // |
|
566 EXPORT_C TInt TSensrvProperty::GetArrayIndex() const |
|
567 { |
|
568 API_TRACE( ( _L( "Sensor Util - TSensrvProperty::GetArrayIndex() - return %d"), iArrayIndex ) ); |
|
569 return iArrayIndex; |
|
570 } |
|
571 |
|
572 // End of file |