1 // ssyreferenceaccelerometer.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 SSYREFERENCEACCELEROMETER_H |
|
31 #define SSYREFERENCEACCELEROMETER_H |
|
32 |
|
33 // INCLUDES |
|
34 #include <e32base.h> |
|
35 #include <sensors/sensrvtypes.h> |
|
36 |
|
37 |
|
38 // ACCELEROMETER RELATED CHANNELS |
|
39 |
|
40 /** |
|
41 * - Name: Accelerometer XYZ-axis data channel type |
|
42 * - Type: Rawdata |
|
43 * - Datatype: TSensrvAccelerometerAxisData |
|
44 * - Description: Accelerometer x-, y-, z-axis data |
|
45 */ |
|
46 const TSensrvChannelTypeId KSensrvChannelTypeIdAccelerometerXYZAxisData = 0x1020507E; |
|
47 |
|
48 // ACCELEROMETER RELATED PROPERTIES |
|
49 |
|
50 /** |
|
51 * - Name: Axis active |
|
52 * - Type: TInt |
|
53 * - Scope: Channel item property |
|
54 * - Mandatory: No |
|
55 * - Capability: None |
|
56 * - Description: Indicates is sensor axis activated. |
|
57 * Value is one if the axis is activated, zero otherwise. |
|
58 */ |
|
59 const TSensrvPropertyId KSensrvPropIdAxisActive = 0x00001001; |
|
60 |
|
61 /** |
|
62 * - Name: Axis threshold value |
|
63 * - Type: TReal |
|
64 * - Scope: Channel item property |
|
65 * - Mandatory: No |
|
66 * - Capability: None |
|
67 * - Description: Threshold value for a sensor channel |
|
68 */ |
|
69 const TSensrvPropertyId KSensrvPropIdAxisThresholdValue = 0x00001002; |
|
70 |
|
71 // ACCELEROMETER RELATED DATATYPES |
|
72 |
|
73 /** |
|
74 * Accelerometer axis data type |
|
75 */ |
|
76 class TSensrvAccelerometerAxisData |
|
77 { |
|
78 public: |
|
79 /** |
|
80 * Channel data type Id number |
|
81 */ |
|
82 static const TSensrvChannelDataTypeId KDataTypeId = 0x1020507E; |
|
83 |
|
84 /** |
|
85 * Channel data type index numbers |
|
86 */ |
|
87 enum TSensrvAccelerometerAxisDataIndexes |
|
88 { |
|
89 ETimeStamp = 0, |
|
90 EAxisX, |
|
91 EAxisY, |
|
92 EAxisZ |
|
93 }; |
|
94 |
|
95 public: |
|
96 /** |
|
97 * - Item name: Sampling time. |
|
98 * - Item Index: 0 |
|
99 * - Conditions: None |
|
100 * - Description: Timestamp for a sample. |
|
101 */ |
|
102 TTime iTimeStamp; |
|
103 |
|
104 /** |
|
105 * - Item name: Accelerometer x-axis |
|
106 * - Item Index: 1 |
|
107 * - Conditions: Single limit and range |
|
108 * - Description: Accelerometer values from x-axis |
|
109 */ |
|
110 TInt iAxisX; |
|
111 |
|
112 /** |
|
113 * - Item name: Accelerometer y-axis |
|
114 * - Item Index: 2 |
|
115 * - Conditions: Single limit and range |
|
116 * - Description: Accelerometer values from y-axis |
|
117 */ |
|
118 TInt iAxisY; |
|
119 |
|
120 /** |
|
121 * - Item name: Accelerometer z-axis |
|
122 * - Item Index: 3 |
|
123 * - Conditions: Single limit and range |
|
124 * - Description: Accelerometer values from z-axis |
|
125 */ |
|
126 TInt iAxisZ; |
|
127 }; |
|
128 |
|
129 |
|
130 // TAPPING RELATED CHANNELS |
|
131 |
|
132 /** |
|
133 * - Name: Wakeup event channel type |
|
134 * - Type: Event |
|
135 * - Datatype: TSensrvTappingData |
|
136 * - Description: Wakeup events |
|
137 */ |
|
138 const TSensrvChannelTypeId KSensrvChannelTypeIdAccelerometerWakeupData = 0x1020507F; |
|
139 |
|
140 /** |
|
141 * - Name: Double tapping event channel type |
|
142 * - Type: Event |
|
143 * - Datatype: TSensrvTappingData |
|
144 * - Description: Double tapping events |
|
145 */ |
|
146 const TSensrvChannelTypeId KSensrvChannelTypeIdAccelerometerDoubleTappingData = 0x10205081; |
|
147 |
|
148 // TAPPING RELATED PROPERTIES |
|
149 |
|
150 /** |
|
151 * - Name: Tapping axis active |
|
152 * - Type: TInt |
|
153 * - Scope: Channel item property |
|
154 * - Mandatory: No |
|
155 * - Capability: None |
|
156 * - Description: Indicates is sensor axis activated. |
|
157 * Value is one if the axis is activated, zero otherwise. |
|
158 */ |
|
159 const TSensrvPropertyId KSensrvPropIdTappingAxisActive = 0x00001001; |
|
160 |
|
161 /** |
|
162 * - Name: Tapping axis threshold value |
|
163 * - Type: TReal |
|
164 * - Scope: Channel item property |
|
165 * - Mandatory: No |
|
166 * - Capability: None |
|
167 * - Description: Threshold value for a sensor channel |
|
168 */ |
|
169 const TSensrvPropertyId KSensrvPropIdTappingAxisThresholdValue = 0x00001002; |
|
170 |
|
171 /** |
|
172 * - Name: Tap duration in milliseconds |
|
173 * - Type: TInt |
|
174 * - Scope: Channel property |
|
175 * - Mandatory: No |
|
176 * - Capability: None |
|
177 * - Description: Tapping duration setting |
|
178 */ |
|
179 const TSensrvPropertyId KSensrvPropIdTapDurationValue = 0x00001003; |
|
180 |
|
181 /** |
|
182 * - Name: Double tap latency |
|
183 * - Type: TInt |
|
184 * - Scope: Channel property |
|
185 * - Mandatory: No |
|
186 * - Capability: None |
|
187 * - Description: Double tap latency in milliseconds |
|
188 */ |
|
189 const TSensrvPropertyId KSensrvPropIdDblTapLatency = 0x00001004; |
|
190 |
|
191 /** |
|
192 * - Name: Double tap interval |
|
193 * - Type: TInt |
|
194 * - Scope: Channel property |
|
195 * - Mandatory: No |
|
196 * - Capability: None |
|
197 * - Description: Double tap interval in milliseconds |
|
198 */ |
|
199 const TSensrvPropertyId KSensrvPropIdDblTapInterval = 0x00001005; |
|
200 |
|
201 |
|
202 |
|
203 // TAPPING RELATED DATATYPES |
|
204 |
|
205 /** |
|
206 * Direction of the tapping data. If direction (plus or minus) is not known, |
|
207 * direction is, for example in x-axis case |
|
208 * KSensrvAccelerometerDirectionXplus | KSensrvAccelerometerDirectionXminus |
|
209 */ |
|
210 const TUint8 KSensrvAccelerometerDirectionXplus = 0x01; |
|
211 const TUint8 KSensrvAccelerometerDirectionXminus = 0x02; |
|
212 const TUint8 KSensrvAccelerometerDirectionYplus = 0x04; |
|
213 const TUint8 KSensrvAccelerometerDirectionYminus = 0x08; |
|
214 const TUint8 KSensrvAccelerometerDirectionZplus = 0x10; |
|
215 const TUint8 KSensrvAccelerometerDirectionZminus = 0x20; |
|
216 |
|
217 /** |
|
218 * Tapping data type |
|
219 */ |
|
220 class TSensrvTappingData |
|
221 { |
|
222 public: |
|
223 /** |
|
224 * Channel data type Id number |
|
225 */ |
|
226 static const TSensrvChannelDataTypeId KDataTypeId = 0x1020507F; |
|
227 |
|
228 /** |
|
229 * Channel data type index numbers |
|
230 */ |
|
231 enum TSensrvAccelerometerAxisDataIndexes |
|
232 { |
|
233 ETimeStamp = 0, |
|
234 EDirection |
|
235 }; |
|
236 |
|
237 public: |
|
238 /** |
|
239 * - Item name: Sampling time. |
|
240 * - Item Index: 0 |
|
241 * - Conditions: None |
|
242 * - Description: Timestamp for a sample. |
|
243 */ |
|
244 TTime iTimeStamp; |
|
245 |
|
246 /** |
|
247 * - Item name: Tapping direction bitmask |
|
248 * - Item Index: 1 |
|
249 * - Conditions: Binary |
|
250 * - Description: Direction bitmask of the tapping event. |
|
251 * See constant definitions above. |
|
252 */ |
|
253 TUint32 iDirection; |
|
254 }; |
|
255 |
|
256 #endif //SSYREFERENCEACCELEROMETER_H |
|