CSensorDataCompensator Class Reference

#include <sensordatacompensator.h>

Link against: sensordatacompensator.lib

class CSensorDataCompensator : public CBase

Inherits from

  • CSensorDataCompensator

    Detailed Description

    Class provides operations to compensate sensor data.


     #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(
                            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;
    S60 5.1

    Member Function Documentation

    Compensate ( TDes8 & )

    TInt Compensate(TDes8 &aData)[pure virtual]

    Compensates sensor data.

    S60 5.1
    aDataReference 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.

    GetChannelDataType ( )

    TSensrvChannelDataTypeId GetChannelDataType()const [pure virtual]

    Used to get the compensated channel data type.

    S60 5.1

    Returns: TSensrvChannelDataTypeId The compensated data type.

    GetCompensationType ( )

    TSensorCompensationType GetCompensationType()const [pure virtual]

    Used to get the compensation type.

    S60 5.1

    Returns: TSensorCompensationType The used compensation type.

    NewL ( TSensrvChannelDataTypeId, TSensorCompensationType )

    Two-phase constructor

    S60 5.1
    aDataTypeSpecifies the data type to be compensated.
    aTypeSpecifies the type of compensation. See TSensorCompensationType.

    Returns: CSensorDataCompensator* Pointer to created object