238 sensorChannel->CloseChannel(); |
238 sensorChannel->CloseChannel(); |
239 CleanupStack::PopAndDestroy( sensorChannel ); |
239 CleanupStack::PopAndDestroy( sensorChannel ); |
240 } |
240 } |
241 |
241 |
242 } |
242 } |
243 /* |
243 |
244 ----------------------------------------------------------------------------- |
|
245 CSensorService::GetScaleFactorL() |
|
246 Description : Get property of specified channel |
|
247 Return values : NA |
|
248 ----------------------------------------------------------------------------- |
|
249 */ |
|
250 |
|
251 EXPORT_C void CSensorService::GetScaleFactorL(const TSensrvChannelInfo& aChannelInfo, |
|
252 TSensrvProperty& aMeasureRange,TSensrvProperty& aScaleRange) |
|
253 { |
|
254 TInt index; |
|
255 //Channel Id of the specified channel in the inpiut parameter |
|
256 TUint32 channelId = aChannelInfo.iChannelId; |
|
257 //Find if specified channel is already opened |
|
258 if ( ( IsChannelOpen( channelId,index ) ) ) |
|
259 { |
|
260 iChannelList[index]->GetPropertyL( KSensrvPropIdMeasureRange,-1, aMeasureRange ); |
|
261 iChannelList[index]->GetPropertyL( KSensrvPropIdScaledRange,-1, aScaleRange ); |
|
262 } |
|
263 //else open new channel and get property change listener for it |
|
264 else |
|
265 { |
|
266 CSensrvChannel* sensorChannel = CSensrvChannel::NewL( aChannelInfo ); |
|
267 CleanupStack::PushL( sensorChannel ); |
|
268 //open requested channel |
|
269 sensorChannel->OpenChannelL(); |
|
270 sensorChannel->GetPropertyL( KSensrvPropIdMeasureRange,-1, aMeasureRange ); |
|
271 sensorChannel->GetPropertyL( KSensrvPropIdScaledRange,-1, aScaleRange ); |
|
272 sensorChannel->CloseChannel(); |
|
273 CleanupStack::PopAndDestroy( sensorChannel ); |
|
274 } |
|
275 |
|
276 } |
|