CSensorDataCompensator Class Reference

Link against: sensordatacompensator.lib


#include <
sensordatacompensator.h>

Detailed Description

Class provides operations to compensate sensor data.

Usage:

 #include <sensordatacompensator.h>
 #include <sensrvaccelerometersensor.h>

 // Client creates the compensator instance as a member.
 // This compensates the axis data received from accelerometer.
 // The data is compensated according to both device and UI rotation.
 // See sensrvtypes.h and sensordatacompensationtypes.h for more information.
 iDataCompensator = CSensorDataCompensator::NewL(
                        KSensrvChannelTypeIdAccelerometerXYZAxisData,
                        ESensorCompensateDeviceAndUIOrientation );

 // Data compensation is done in client's MSensrvDataListener::DataReceived() implementation 
 // where 'iSensorChannel' contains the accelerometer channel instance.
 TPckgBuf<TSensrvAccelerometerAxisData> dataPckgBuf;
 // Get data from accelerometer ( iSensorChannel->GetData( dataPckgBuf ) )
 TInt err( iDataCompensator->Compensate( dataPckgBuf ) );

 // Client deletes the compensator instance in destructor.
 delete iDataCompensator;
Dll sensordatacompensator.lib
Since:
S60 5.1

Public Member Functions

virtual TInt Compensate (TDes8 &aData)=0
 Compensates sensor data.
virtual TSensrvChannelDataTypeId GetChannelDataType () const =0
 Used to get the compensated channel data type.
virtual TSensorCompensationType GetCompensationType () const =0
 Used to get the compensation type.

Static Public Member Functions

static IMPORT_C CSensorDataCompensatorNewL (TSensrvChannelDataTypeId aDataType, TSensorCompensationType aType)
 Two-phase constructor.

Member Function Documentation

virtual TInt CSensorDataCompensator::Compensate TDes8 &  aData  )  [pure virtual]
 

Compensates sensor data.

Since:
S60 5.1
Parameters:
aData Reference to descriptor where sensor data locates. On return contains compensated data if compensation successful. The following packages can be used in compensating; TSensrvAccelerometerAxisData TSensrvMagnetometerAxisData TSensrvMagneticNorthData TSensrvTappingData
Returns:
TInt KErrNone - Compensation successful. KErrArgument - Input aData does not match data type. KErrNotSupported - Compensation not supported for data type. KErrNotReady - Not ready for compensation. KErrCorrupt - Configured compensation values are invalid.
virtual TSensrvChannelDataTypeId CSensorDataCompensator::GetChannelDataType  )  const [pure virtual]
 

Used to get the compensated channel data type.

Since:
S60 5.1
Returns:
TSensrvChannelDataTypeId The compensated data type.
virtual TSensorCompensationType CSensorDataCompensator::GetCompensationType  )  const [pure virtual]
 

Used to get the compensation type.

Since:
S60 5.1
Returns:
TSensorCompensationType The used compensation type.
static IMPORT_C CSensorDataCompensator* CSensorDataCompensator::NewL TSensrvChannelDataTypeId  aDataType,
TSensorCompensationType  aType
[static]
 

Two-phase constructor.

Since:
S60 5.1
Parameters:
aDataType Specifies the data type to be compensated.
aType Specifies the type of compensation. See TSensorCompensationType.
Returns:
CSensorDataCompensator* Pointer to created object

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top