diff -r 666f914201fb -r 2fe1408b6811 epoc32/include/sensrvorientationsensor.h --- a/epoc32/include/sensrvorientationsensor.h Tue Nov 24 13:55:44 2009 +0000 +++ b/epoc32/include/sensrvorientationsensor.h Tue Mar 16 16:12:26 2010 +0000 @@ -1,1 +1,162 @@ -sensrvorientationsensor.h +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Channel data types definitions +* +*/ + + + +#ifndef SENSRVORIENTATIONSENSOR_H +#define SENSRVORIENTATIONSENSOR_H + +// INCLUDES +#include +#include + +// ORIENTATION RELATED CHANNELS + +/** +* - Name: Orientation event channel type +* - Type: Event +* - Datatype: TSensrvOrientationData +* - Description: Orientation events +*/ +const TSensrvChannelTypeId KSensrvChannelTypeIdOrientationData = 0x10205088; + +/** +* - Name: Rotation event channel type +* - Type: Event +* - Datatype: TSensrvRotationData +* - Description: Rotation events +*/ +const TSensrvChannelTypeId KSensrvChannelTypeIdRotationData = 0x10205089; + +// ORIENTATION RELATED DATATYPES + +class TSensrvOrientationData + { +public: + /** + * Channel data type Id number + */ + static const TSensrvChannelDataTypeId KDataTypeId = 0x10205088; + + /** + * Channel data type index numbers + */ + enum TSensrvOrientationEventIndexes + { + ETimeStamp = 0, + EDeviceOrientation + }; + + /** + * Possible device orientations + */ + enum TSensrvDeviceOrientation + { + EOrientationUndefined = 0, + EOrientationDisplayUp, + EOrientationDisplayDown, + EOrientationDisplayLeftUp, + EOrientationDisplayRightUp, + EOrientationDisplayUpwards, + EOrientationDisplayDownwards + }; + +public: + + /** + * - Item name: Sampling time + * - Item Index: 0 + * - Description: Timestamp for a sample + */ + TTime iTimeStamp; + + /** + * - Item name: Device orientation + * - Item Index: 1 + * - Description: Contains one of the six basic orientations of the device + */ + TSensrvDeviceOrientation iDeviceOrientation; + }; + + +class TSensrvRotationData + { +public: + /** + * Channel data type Id number + */ + static const TSensrvChannelDataTypeId KDataTypeId = 0x10205089; + + /** + * Rotation axis value equals -1 when it cannot be defined. + * The undefined situation varies depending on the sensor type. + * In the case of an accelerometer, the rotation value cannot be defined + * when the corresponding axis is parallel to the gravitational force or + * the device is in motion. In the case of a magnetometer, there are + * difficulties in measuring values, when the axis is parallel to the + * magnetic field. + */ + static const TInt KSensrvRotationUndefined = -1; + + /** + * Channel data type index numbers + */ + enum TSensrvRotationDataIndexes + { + ETimeStamp = 0, + EDeviceRotationAboutXAxis, + EDeviceRotationAboutYAxis, + EDeviceRotationAboutZAxis, + }; + +public: + /** + * - Item name: Sampling time. + * - Item Index: 0 + * - Description: Timestamp for a sample + */ + TTime iTimeStamp; + + /** + * - Item name: Rotation about x-axis + * - Item Index: 1 + * - Description: Positive rotation in Cartesian coordinate system about the x-axis. + * If the value cannot be defined it is set to KSensrvRotationUndefined. + */ + TInt iDeviceRotationAboutXAxis; + + /** + * - Item name: Rotation about y-axis + * - Item Index: 2 + * - Description: Positive rotation in Cartesian coordinate system about the y-axis. + * If the value cannot be defined it is set to KSensrvRotationUndefined. + */ + TInt iDeviceRotationAboutYAxis; + + + /** + * - Item name: Rotation about z-axis + * - Item Index: 3 + * - Description: Positive rotation in Cartesian coordinate system about the z-axis. + * If the value cannot be defined it is set to KSensrvRotationUndefined. + */ + TInt iDeviceRotationAboutZAxis; + }; + +#endif //SENSRVORIENTATIONSENSOR_H + +// End of File