1.1 --- a/epoc32/include/sensrvorientationsensor.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sensrvorientationsensor.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,162 @@
1.4 -sensrvorientationsensor.h
1.5 +/*
1.6 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: Channel data types definitions
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef SENSRVORIENTATIONSENSOR_H
1.25 +#define SENSRVORIENTATIONSENSOR_H
1.26 +
1.27 +// INCLUDES
1.28 +#include <e32base.h>
1.29 +#include <sensrvtypes.h>
1.30 +
1.31 +// ORIENTATION RELATED CHANNELS
1.32 +
1.33 +/**
1.34 +* - Name: Orientation event channel type
1.35 +* - Type: Event
1.36 +* - Datatype: TSensrvOrientationData
1.37 +* - Description: Orientation events
1.38 +*/
1.39 +const TSensrvChannelTypeId KSensrvChannelTypeIdOrientationData = 0x10205088;
1.40 +
1.41 +/**
1.42 +* - Name: Rotation event channel type
1.43 +* - Type: Event
1.44 +* - Datatype: TSensrvRotationData
1.45 +* - Description: Rotation events
1.46 +*/
1.47 +const TSensrvChannelTypeId KSensrvChannelTypeIdRotationData = 0x10205089;
1.48 +
1.49 +// ORIENTATION RELATED DATATYPES
1.50 +
1.51 +class TSensrvOrientationData
1.52 + {
1.53 +public:
1.54 + /**
1.55 + * Channel data type Id number
1.56 + */
1.57 + static const TSensrvChannelDataTypeId KDataTypeId = 0x10205088;
1.58 +
1.59 + /**
1.60 + * Channel data type index numbers
1.61 + */
1.62 + enum TSensrvOrientationEventIndexes
1.63 + {
1.64 + ETimeStamp = 0,
1.65 + EDeviceOrientation
1.66 + };
1.67 +
1.68 + /**
1.69 + * Possible device orientations
1.70 + */
1.71 + enum TSensrvDeviceOrientation
1.72 + {
1.73 + EOrientationUndefined = 0,
1.74 + EOrientationDisplayUp,
1.75 + EOrientationDisplayDown,
1.76 + EOrientationDisplayLeftUp,
1.77 + EOrientationDisplayRightUp,
1.78 + EOrientationDisplayUpwards,
1.79 + EOrientationDisplayDownwards
1.80 + };
1.81 +
1.82 +public:
1.83 +
1.84 + /**
1.85 + * - Item name: Sampling time
1.86 + * - Item Index: 0
1.87 + * - Description: Timestamp for a sample
1.88 + */
1.89 + TTime iTimeStamp;
1.90 +
1.91 + /**
1.92 + * - Item name: Device orientation
1.93 + * - Item Index: 1
1.94 + * - Description: Contains one of the six basic orientations of the device
1.95 + */
1.96 + TSensrvDeviceOrientation iDeviceOrientation;
1.97 + };
1.98 +
1.99 +
1.100 +class TSensrvRotationData
1.101 + {
1.102 +public:
1.103 + /**
1.104 + * Channel data type Id number
1.105 + */
1.106 + static const TSensrvChannelDataTypeId KDataTypeId = 0x10205089;
1.107 +
1.108 + /**
1.109 + * Rotation axis value equals -1 when it cannot be defined.
1.110 + * The undefined situation varies depending on the sensor type.
1.111 + * In the case of an accelerometer, the rotation value cannot be defined
1.112 + * when the corresponding axis is parallel to the gravitational force or
1.113 + * the device is in motion. In the case of a magnetometer, there are
1.114 + * difficulties in measuring values, when the axis is parallel to the
1.115 + * magnetic field.
1.116 + */
1.117 + static const TInt KSensrvRotationUndefined = -1;
1.118 +
1.119 + /**
1.120 + * Channel data type index numbers
1.121 + */
1.122 + enum TSensrvRotationDataIndexes
1.123 + {
1.124 + ETimeStamp = 0,
1.125 + EDeviceRotationAboutXAxis,
1.126 + EDeviceRotationAboutYAxis,
1.127 + EDeviceRotationAboutZAxis,
1.128 + };
1.129 +
1.130 +public:
1.131 + /**
1.132 + * - Item name: Sampling time.
1.133 + * - Item Index: 0
1.134 + * - Description: Timestamp for a sample
1.135 + */
1.136 + TTime iTimeStamp;
1.137 +
1.138 + /**
1.139 + * - Item name: Rotation about x-axis
1.140 + * - Item Index: 1
1.141 + * - Description: Positive rotation in Cartesian coordinate system about the x-axis.
1.142 + * If the value cannot be defined it is set to KSensrvRotationUndefined.
1.143 + */
1.144 + TInt iDeviceRotationAboutXAxis;
1.145 +
1.146 + /**
1.147 + * - Item name: Rotation about y-axis
1.148 + * - Item Index: 2
1.149 + * - Description: Positive rotation in Cartesian coordinate system about the y-axis.
1.150 + * If the value cannot be defined it is set to KSensrvRotationUndefined.
1.151 + */
1.152 + TInt iDeviceRotationAboutYAxis;
1.153 +
1.154 +
1.155 + /**
1.156 + * - Item name: Rotation about z-axis
1.157 + * - Item Index: 3
1.158 + * - Description: Positive rotation in Cartesian coordinate system about the z-axis.
1.159 + * If the value cannot be defined it is set to KSensrvRotationUndefined.
1.160 + */
1.161 + TInt iDeviceRotationAboutZAxis;
1.162 + };
1.163 +
1.164 +#endif //SENSRVORIENTATIONSENSOR_H
1.165 +
1.166 +// End of File