|
1 // ssyreferenceorientation.h |
|
2 |
|
3 /* |
|
4 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
5 * All rights reserved. |
|
6 * This component and the accompanying materials are made available |
|
7 * under the terms of "Eclipse Public License v1.0" |
|
8 * which accompanies this distribution, and is available |
|
9 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
10 * |
|
11 * Initial Contributors: |
|
12 * Nokia Corporation - initial contribution. |
|
13 * |
|
14 * Contributors: |
|
15 * |
|
16 * Description: |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 /** |
|
24 @file |
|
25 @internalAll Sensor framework Reference SSY header file |
|
26 @test |
|
27 */ |
|
28 |
|
29 |
|
30 #ifndef SSYREFERENCEORIENTATION_H |
|
31 #define SSYREFERENCEORIENTATION_H |
|
32 |
|
33 // INCLUDES |
|
34 #include <e32base.h> |
|
35 #include <sensors/sensrvtypes.h> |
|
36 |
|
37 |
|
38 // ORIENTATION RELATED CHANNELS |
|
39 |
|
40 /** |
|
41 * - Name: Orientation event channel type |
|
42 * - Type: Event |
|
43 * - Datatype: TSensrvOrientationData |
|
44 * - Description: Orientation events |
|
45 */ |
|
46 const TSensrvChannelTypeId KSensrvChannelTypeIdOrientationData = 0x10205088; |
|
47 |
|
48 /** |
|
49 * - Name: Rotation event channel type |
|
50 * - Type: Event |
|
51 * - Datatype: TSensrvRotationData |
|
52 * - Description: Rotation events |
|
53 */ |
|
54 const TSensrvChannelTypeId KSensrvChannelTypeIdRotationData = 0x10205089; |
|
55 |
|
56 // ORIENTATION RELATED DATATYPES |
|
57 |
|
58 class TSensrvOrientationData |
|
59 { |
|
60 public: |
|
61 /** |
|
62 * Channel data type Id number |
|
63 */ |
|
64 static const TSensrvChannelDataTypeId KDataTypeId = 0x10205088; |
|
65 |
|
66 /** |
|
67 * Channel data type index numbers |
|
68 */ |
|
69 enum TSensrvOrientationEventIndexes |
|
70 { |
|
71 ETimeStamp = 0, |
|
72 EDeviceOrientation |
|
73 }; |
|
74 |
|
75 /** |
|
76 * Possible device orientations |
|
77 */ |
|
78 enum TSensrvDeviceOrientation |
|
79 { |
|
80 EOrientationUndefined = 0, |
|
81 EOrientationDisplayUp, |
|
82 EOrientationDisplayDown, |
|
83 EOrientationDisplayLeftUp, |
|
84 EOrientationDisplayRightUp, |
|
85 EOrientationDisplayUpwards, |
|
86 EOrientationDisplayDownwards |
|
87 }; |
|
88 |
|
89 public: |
|
90 |
|
91 /** |
|
92 * - Item name: Sampling time |
|
93 * - Item Index: 0 |
|
94 * - Description: Timestamp for a sample |
|
95 */ |
|
96 TTime iTimeStamp; |
|
97 |
|
98 /** |
|
99 * - Item name: Device orientation |
|
100 * - Item Index: 1 |
|
101 * - Description: Contains one of the six basic orientations of the device |
|
102 */ |
|
103 TSensrvDeviceOrientation iDeviceOrientation; |
|
104 }; |
|
105 |
|
106 |
|
107 class TSensrvRotationData |
|
108 { |
|
109 public: |
|
110 /** |
|
111 * Channel data type Id number |
|
112 */ |
|
113 static const TSensrvChannelDataTypeId KDataTypeId = 0x10205089; |
|
114 |
|
115 /** |
|
116 * Rotation axis value equals -1 when it cannot be defined. |
|
117 * The undefined situation varies depending on the sensor type. |
|
118 * In the case of an accelerometer, the rotation value cannot be defined |
|
119 * when the corresponding axis is parallel to the gravitational force or |
|
120 * the device is in motion. In the case of a magnetometer, there are |
|
121 * difficulties in measuring values, when the axis is parallel to the |
|
122 * magnetic field. |
|
123 */ |
|
124 static const TInt KSensrvRotationUndefined = -1; |
|
125 |
|
126 /** |
|
127 * Channel data type index numbers |
|
128 */ |
|
129 enum TSensrvRotationDataIndexes |
|
130 { |
|
131 ETimeStamp = 0, |
|
132 EDeviceRotationAboutXAxis, |
|
133 EDeviceRotationAboutYAxis, |
|
134 EDeviceRotationAboutZAxis, |
|
135 }; |
|
136 |
|
137 public: |
|
138 /** |
|
139 * - Item name: Sampling time. |
|
140 * - Item Index: 0 |
|
141 * - Description: Timestamp for a sample |
|
142 */ |
|
143 TTime iTimeStamp; |
|
144 |
|
145 /** |
|
146 * - Item name: Rotation about x-axis |
|
147 * - Item Index: 1 |
|
148 * - Description: Positive rotation in Cartesian coordinate system about the x-axis. |
|
149 * If the value cannot be defined it is set to KSensrvRotationUndefined. |
|
150 */ |
|
151 TInt iDeviceRotationAboutXAxis; |
|
152 |
|
153 /** |
|
154 * - Item name: Rotation about y-axis |
|
155 * - Item Index: 2 |
|
156 * - Description: Positive rotation in Cartesian coordinate system about the y-axis. |
|
157 * If the value cannot be defined it is set to KSensrvRotationUndefined. |
|
158 */ |
|
159 TInt iDeviceRotationAboutYAxis; |
|
160 |
|
161 |
|
162 /** |
|
163 * - Item name: Rotation about z-axis |
|
164 * - Item Index: 3 |
|
165 * - Description: Positive rotation in Cartesian coordinate system about the z-axis. |
|
166 * If the value cannot be defined it is set to KSensrvRotationUndefined. |
|
167 */ |
|
168 TInt iDeviceRotationAboutZAxis; |
|
169 }; |
|
170 |
|
171 #endif //SSYREFERENCEORIENTATION_H |
|
172 |