2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Type definitions file for Sensor Server
24 #include <sensrvproperty.h>
26 // Forward declare channel info
27 class TSensrvChannelInfo;
30 * Max length of the vendor Id
32 * @see TSensrvChannelInfo
34 const TInt KSensrvVendorIdLength = 16;
37 * Max length of the location string
39 * @see TSensrvChannelInfo
41 const TInt KSensrvLocationLength = 16;
44 * Item index for properties that are not data item specific
46 * @see TSensrvProperty
48 const TInt KSensrvItemIndexNone = -1;
53 * Type definition for a channel id used by TSensrvChannelInfo. Its value is assigned by the Sensor
54 * Server and uniquely identifies a channel for the client session. When the client session has ended
55 * the channel id is no longer valid.
57 * @see TSensrvChannelInfo
60 * @see MSsyChannelDataProvider
61 * @see MSsyPropertyProvider
63 typedef TUint32 TSensrvChannelId;
66 * Type definition for a channel type used by TSensrvChannelInfo. This id identifies the type of channel
67 * * that the object represents and therefore the content of the channel. This value is a uid and is unique
68 * among all channels. See sensor channel specific header files. A client can use this value as one of the
69 * search criteria when finding channels.
71 * @see TSensrvChannelInfo
73 typedef TUint32 TSensrvChannelTypeId;
76 * Typedef for datatype Id used by TSensrvChannelInfo. This identifies the data type for the data that the
77 * channel provides. This value is a uid and is unique among all channels. See sensor channel specific header
80 * @see TSensrvChannelInfo
82 typedef TUint32 TSensrvChannelDataTypeId;
86 * Undefined Channel id for use when finding channels
88 * @see CSensrvChannelFinder
90 const TSensrvChannelTypeId KSensrvChannelTypeIdUndefined = 0x00000000;
93 * RArray based channel Id list
96 * @see MSsyPropertyProvider
98 typedef RArray<TSensrvChannelId> RSensrvChannelList;
101 * RArray based property list
103 * @see CSensrvChannel
104 * @see MSsyPropertyProvider
106 typedef RArray<TSensrvProperty> RSensrvPropertyList;
109 * RArray based channel info list
111 * @see CSensrvChannelFinder
114 typedef RArray<TSensrvChannelInfo> RSensrvChannelInfoList;
117 * Indication of whether a call to CSensrvChannel::SetPropertyL() is likely to succeed
119 * @see CSensrvChannel
120 * @see MSensrvPropertyListener
122 enum TSetPropertySuccessIndicator
124 ESetPropertyIndicationUnknown = 0,
126 * Setting of a property is certain to succeed because client has the highest priority
127 * of all clients that have open channels on that sensor device
129 ESetPropertyIndicationAvailable,
131 * Setting of a property may not succeed because:
132 * 1. Client has the highest priority on its own channel however there are multiple
133 * clients with the same priority and control is granted on a first come first served
135 * 2. Client has highest priority on its own channel however there are higher priority
136 * clients on other channels of the device that may be affected by the setting, in which
137 * case it will not be allowed.
138 * 3. Client has highest priority on its channel however there are same priority clients
139 * on other channels of the device that may be affected by the setting, in which case it
140 * will not be allowed
142 ESetPropertyIndicationPossible,
144 * Setting of a property will not succeed because:
145 * 1. There are clients on the same channel with higher priority
146 * 2. A client of the same priority is already setting properties on channel.
148 ESetPropertyIndicationUnavailable
152 * The quantity of channel values. Defines the quantity the channel is measuring.
153 * Licensee defined values must be between ESensrvQuantityLicenseeBase and
154 * ESensrvQuantityLicenseeEnd
156 * @see TSensrvChannelInfo
160 /** Channel doesn't provide quantity information*/
161 ESensrvQuantityNotUsed = -1,
162 /** Quantity is not defined */
163 ESensrvQuantityNotdefined = 0,
164 /** Channel measures acceleration */
165 ESensrvQuantityAcceleration = 10,
166 /** Channel measures tapping events */
167 ESensrvQuantityTapping = 11,
168 /** Channel measures phone orientation */
169 ESensrvQuantityOrientation = 12,
170 /** Channel measures phone rotation */
171 ESensrvQuantityRotation = 13,
172 /** Channel measures phone direction */
173 ESensrvQuantityMagnetic = 14,
174 /** Channel measures degrees */
175 ESensrvQuantityAngle = 15,
176 /** Channel measures phone proximity events*/
177 ESensrvQuantityProximity = 16,
178 /** Start of licensee quantity range definitions */
179 ESensrvQuantityLicenseeBase = 8192,
180 /** End of licensee quantity range definitions */
181 ESensrvQuantityLicenseeEnd = 12287
185 * The context type of a sensor.
186 * Licensee defined values must be between ESensrvContextTypeLicenseeBase and
187 * ESensrvContextTypeLicenseeEnd
189 * @see TSensrvChannelInfo
191 enum TSensrvContextType
193 /** Channel doesn't provide sensor context type information */
194 ESensrvContextTypeNotUsed = -1,
195 /** Context type is not defined */
196 ESensrvContextTypeNotDefined = 0,
198 * Sensor is measuring a physical quantity of the phones environment e.g. pressure, temperature,
199 * sound intensity, humidity
201 ESensrvContextTypeAmbient = 1,
203 * Sensor is measuring a physical quantity that the phone itself is undergoing e.g. acceleration,
204 * rotation, orientation
206 ESensrvContextTypeDevice = 2,
208 * Sensor is measuring a physical quantity that is user stimulated e.g. body temperature, body mass,
211 ESensrvContextTypeUser = 3,
212 /** Start of licensee context range definitions */
213 ESensrvContextTypeLicenseeBase = 8192,
214 /** End of licensee context range definitions */
215 ESensrvContextTypeLicenseeEnd = 12287
219 * The connection type of a sensor.
220 * Licensee defined values must be between ESensrvConnectionTypeLicenseeBase and
221 * ESensrvConnectionTypeLicenseeEnd
223 * @see KSensrvSensorConnectionType
225 enum TSensrvConnectionType
227 /** Connection type is not defined */
228 ESensrvConnectionTypeNotDefined = 0,
229 /** Sensor is embedded in the phone */
230 ESensrvConnectionTypeEmbedded,
231 /** Sensor is attached to phone by wire */
232 ESensrvConnectionTypeWired,
233 /** Sensor is attached to phone wirelessly */
234 ESensrvConnectionTypeWireless,
235 /** Start of licensee Connection type range definitions */
236 ESensrvConnectionTypeLicenseeBase = 8192,
237 /** End of licensee Connection type range definitions */
238 ESensrvConnectionTypeLicenseeEnd = 12287
242 * The unit of the data measured by the sensor channel
243 * Licensee defined values must be between ESensrvChannelUnitLicenseeBase and
244 * ESensrvChannelUnitLicenseeEnd
246 * @see KSensrvPropIdChannelUnit
248 enum TSensrvChannelUnit
250 /** Channel Unit is not defined */
251 ESensrvChannelUnitNotDefined = 0,
252 /** Acceleration, meter per square second (m/s^2) */
253 ESensevChannelUnitAcceleration = 10,
254 /** Acceleration, gravitational constant (G) */
255 ESensrvChannelUnitGravityConstant = 11,
256 /** ESensrvChannelUnitMagneticFluxDensity, magnetic field density, Tesla (T) */
257 ESensrvChannelUnitMagneticFluxDensity = 12,
258 /** Start of licensee Channel Unit range definitions */
259 ESensrvChannelUnitLicenseeBase = 8192,
260 /** End of licensee Channel Unit range definitions */
261 ESensrvChannelUnitLicenseeEnd = 12287
265 * The format of the data measured by the sensor channel
266 * Licensee defined values must be between ESensrvChannelDataFormatLicenseeBase and
267 * ESensrvChannelDataFormatLicenseeEnd
270 * Scaled format example:
271 * Measure range for the accelerometer, KSensrvPropIdMeasureRange: -2g to 2g.
272 * KSensrvPropIdScaledRange defines following values:
273 * Range: Min: -127 Max: 127
275 * Example values for the data item and their absolute values:
276 * Data item: -64 = > -64/127 * 2g = -1.01g
277 * Data item: 32 = > 32/127 * 2g = 0.51g
278 * Data item: 127 = > 127/127 * 2g = 2g
281 * @see KSensrvPropIdChannelDataFormat
283 enum TSensrvChannelDataFormat
285 /** Data Fomat is not defined */
286 ESensrvChannelDataFormatNotDefined = 0,
287 /** Value of the data item represents actual value of the measured quantity */
288 ESensrvChannelDataFormatAbsolute,
290 * Value of the data item represents a relative value which is scaled between the maximum
291 * and minimum values of the measured quantity
293 ESensrvChannelDataFormatScaled,
294 /** Start of licensee Data Format range definitions */
295 ESensrvChannelDataFormatLicenseeBase = 8192,
296 /** End of licensee Data Format range definitions */
297 ESensrvChannelDataFormatLicenseeEnd = 12287
301 * The error code received by a sensor server listener
303 * @see MSensrvChannelConditionListener
304 * @see MSensrvChannelListener
305 * @see MSensrvDataListener
306 * @see MSensrvPropertyListener
308 enum TSensrvErrorSeverity
310 /** Error Severity is not defined */
311 ESensrvErrorSeverityNotDefined = 0,
312 /** The channel has a temporary failure but listening has been successfully continued */
313 ESensrvErrorSeverityMinor,
314 /** The channel has a fatal error and the channel was closed */
315 ESensrvErrorSeverityFatal
319 * The channel change is detected by the Channel Listener
321 * @see MSensrvChannelListener
323 enum TSensrvChannelChangeType
325 /** Channel Change not defined */
326 ESensrvChannelChangeTypeNotDefined = 0,
327 /** Channel was removed */
328 ESensrvChannelChangeTypeRemoved,
329 /** Channel was added */
330 ESensrvChannelChangeTypeAdded
334 * The TSensrvPower represents sensor power state
337 * - ESensrvPowerPowerDown, sensor is currently powered down
338 * - ESensrvPowerPowerUp, sensor currently powered up
342 /** Sensor is powered down */
343 ESensrvPowerPowerDown = 0,
344 /** Sensor is powered up */
349 * The TSensrvAvailability represents sensor channel availability
352 * - ESensrvAvailabilityFalse, the channel is not available, which is caused by
353 * either sensor being powered down, or a dependency with another channel
354 * prevents the channel for being available
355 * - ESensrvAvailabilityTrue, the channel is available
357 enum TSensrvAvailability
359 /** Channel not available */
360 ESensrvAvailabilityFalse = 0,
361 /** Channel available */
362 ESensrvAvailabilityTrue
366 #endif //SENSRVTYPES_H