1.1 --- a/epoc32/include/sensrvtypes.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sensrvtypes.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,368 @@
1.4 -sensrvtypes.h
1.5 +/*
1.6 +* Copyright (c) 2006-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: Type definitions file for Sensor Server
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef SENSRVTYPES_H
1.25 +#define SENSRVTYPES_H
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <sensrvproperty.h>
1.29 +
1.30 +// Forward declare channel info
1.31 +class TSensrvChannelInfo;
1.32 +
1.33 +/**
1.34 +* Max length of the vendor Id
1.35 +*
1.36 +* @see TSensrvChannelInfo
1.37 +*/
1.38 +const TInt KSensrvVendorIdLength = 16;
1.39 +
1.40 +/**
1.41 +* Max length of the location string
1.42 +*
1.43 +* @see TSensrvChannelInfo
1.44 +*/
1.45 +const TInt KSensrvLocationLength = 16;
1.46 +
1.47 +/**
1.48 +* Item index for properties that are not data item specific
1.49 +*
1.50 +* @see TSensrvProperty
1.51 +*/
1.52 +const TInt KSensrvItemIndexNone = -1;
1.53 +
1.54 +// DATA TYPES
1.55 +
1.56 +/**
1.57 +* Type definition for a channel id used by TSensrvChannelInfo. Its value is assigned by the Sensor
1.58 +* Server and uniquely identifies a channel for the client session. When the client session has ended
1.59 +* the channel id is no longer valid.
1.60 +*
1.61 +* @see TSensrvChannelInfo
1.62 +* @see CSsyControl
1.63 +* @see MSsyCallback
1.64 +* @see MSsyChannelDataProvider
1.65 +* @see MSsyPropertyProvider
1.66 +*/
1.67 +typedef TUint32 TSensrvChannelId;
1.68 +
1.69 +/**
1.70 +* Type definition for a channel type used by TSensrvChannelInfo. This id identifies the type of channel
1.71 +* * that the object represents and therefore the content of the channel. This value is a uid and is unique
1.72 +* among all channels. See sensor channel specific header files. A client can use this value as one of the
1.73 +* search criteria when finding channels.
1.74 +*
1.75 +* @see TSensrvChannelInfo
1.76 +*/
1.77 +typedef TUint32 TSensrvChannelTypeId;
1.78 +
1.79 +/**
1.80 +* Typedef for datatype Id used by TSensrvChannelInfo. This identifies the data type for the data that the
1.81 +* channel provides. This value is a uid and is unique among all channels. See sensor channel specific header
1.82 +* files.
1.83 +*
1.84 +* @see TSensrvChannelInfo
1.85 +*/
1.86 +typedef TUint32 TSensrvChannelDataTypeId;
1.87 +
1.88 +
1.89 +/**
1.90 +* Undefined Channel id for use when finding channels
1.91 +*
1.92 +* @see CSensrvChannelFinder
1.93 +*/
1.94 +const TSensrvChannelTypeId KSensrvChannelTypeIdUndefined = 0x00000000;
1.95 +
1.96 +/**
1.97 +* RArray based channel Id list
1.98 +*
1.99 +* @see MSsyCallback
1.100 +* @see MSsyPropertyProvider
1.101 +*/
1.102 +typedef RArray<TSensrvChannelId> RSensrvChannelList;
1.103 +
1.104 +/**
1.105 +* RArray based property list
1.106 +*
1.107 +* @see CSensrvChannel
1.108 +* @see MSsyPropertyProvider
1.109 +*/
1.110 +typedef RArray<TSensrvProperty> RSensrvPropertyList;
1.111 +
1.112 +/**
1.113 +* RArray based channel info list
1.114 +*
1.115 +* @see CSensrvChannelFinder
1.116 +* @see MSsyCallback
1.117 +*/
1.118 +typedef RArray<TSensrvChannelInfo> RSensrvChannelInfoList;
1.119 +
1.120 +/**
1.121 +* Indication of whether a call to CSensrvChannel::SetPropertyL() is likely to succeed
1.122 +*
1.123 +* @see CSensrvChannel
1.124 +* @see MSensrvPropertyListener
1.125 +*/
1.126 +enum TSetPropertySuccessIndicator
1.127 + {
1.128 + ESetPropertyIndicationUnknown = 0,
1.129 + /**
1.130 + * Setting of a property is certain to succeed because client has the highest priority
1.131 + * of all clients that have open channels on that sensor device
1.132 + */
1.133 + ESetPropertyIndicationAvailable,
1.134 + /**
1.135 + * Setting of a property may not succeed because:
1.136 + * 1. Client has the highest priority on its own channel however there are multiple
1.137 + * clients with the same priority and control is granted on a first come first served
1.138 + * basis.
1.139 + * 2. Client has highest priority on its own channel however there are higher priority
1.140 + * clients on other channels of the device that may be affected by the setting, in which
1.141 + * case it will not be allowed.
1.142 + * 3. Client has highest priority on its channel however there are same priority clients
1.143 + * on other channels of the device that may be affected by the setting, in which case it
1.144 + * will not be allowed
1.145 + */
1.146 + ESetPropertyIndicationPossible,
1.147 + /**
1.148 + * Setting of a property will not succeed because:
1.149 + * 1. There are clients on the same channel with higher priority
1.150 + * 2. A client of the same priority is already setting properties on channel.
1.151 + */
1.152 + ESetPropertyIndicationUnavailable
1.153 + };
1.154 +
1.155 +/**
1.156 +* The quantity of channel values. Defines the quantity the channel is measuring.
1.157 +* Licensee defined values must be between ESensrvQuantityLicenseeBase and
1.158 +* ESensrvQuantityLicenseeEnd
1.159 +*
1.160 +* @see TSensrvChannelInfo
1.161 +*/
1.162 +enum TSensrvQuantity
1.163 + {
1.164 + /** Channel doesn't provide quantity information*/
1.165 + ESensrvQuantityNotUsed = -1,
1.166 + /** Quantity is not defined */
1.167 + ESensrvQuantityNotdefined = 0,
1.168 + /** Channel measures acceleration */
1.169 + ESensrvQuantityAcceleration = 10,
1.170 + /** Channel measures tapping events */
1.171 + ESensrvQuantityTapping = 11,
1.172 + /** Channel measures phone orientation */
1.173 + ESensrvQuantityOrientation = 12,
1.174 + /** Channel measures phone rotation */
1.175 + ESensrvQuantityRotation = 13,
1.176 + /** Channel measures phone direction */
1.177 + ESensrvQuantityMagnetic = 14,
1.178 + /** Channel measures degrees */
1.179 + ESensrvQuantityAngle = 15,
1.180 + /** Channel measures phone proximity events*/
1.181 + ESensrvQuantityProximity = 16,
1.182 + /** Start of licensee quantity range definitions */
1.183 + ESensrvQuantityLicenseeBase = 8192,
1.184 + /** End of licensee quantity range definitions */
1.185 + ESensrvQuantityLicenseeEnd = 12287
1.186 + };
1.187 +
1.188 +/**
1.189 +* The context type of a sensor.
1.190 +* Licensee defined values must be between ESensrvContextTypeLicenseeBase and
1.191 +* ESensrvContextTypeLicenseeEnd
1.192 +*
1.193 +* @see TSensrvChannelInfo
1.194 +*/
1.195 +enum TSensrvContextType
1.196 + {
1.197 + /** Channel doesn't provide sensor context type information */
1.198 + ESensrvContextTypeNotUsed = -1,
1.199 + /** Context type is not defined */
1.200 + ESensrvContextTypeNotDefined = 0,
1.201 + /**
1.202 + * Sensor is measuring a physical quantity of the phones environment e.g. pressure, temperature,
1.203 + * sound intensity, humidity
1.204 + */
1.205 + ESensrvContextTypeAmbient = 1,
1.206 + /**
1.207 + * Sensor is measuring a physical quantity that the phone itself is undergoing e.g. acceleration,
1.208 + * rotation, orientation
1.209 + */
1.210 + ESensrvContextTypeDevice = 2,
1.211 + /**
1.212 + * Sensor is measuring a physical quantity that is user stimulated e.g. body temperature, body mass,
1.213 + * heart rate
1.214 + */
1.215 + ESensrvContextTypeUser = 3,
1.216 + /** Start of licensee context range definitions */
1.217 + ESensrvContextTypeLicenseeBase = 8192,
1.218 + /** End of licensee context range definitions */
1.219 + ESensrvContextTypeLicenseeEnd = 12287
1.220 + };
1.221 +
1.222 +/**
1.223 +* The connection type of a sensor.
1.224 +* Licensee defined values must be between ESensrvConnectionTypeLicenseeBase and
1.225 +* ESensrvConnectionTypeLicenseeEnd
1.226 +*
1.227 +* @see KSensrvSensorConnectionType
1.228 +*/
1.229 +enum TSensrvConnectionType
1.230 + {
1.231 + /** Connection type is not defined */
1.232 + ESensrvConnectionTypeNotDefined = 0,
1.233 + /** Sensor is embedded in the phone */
1.234 + ESensrvConnectionTypeEmbedded,
1.235 + /** Sensor is attached to phone by wire */
1.236 + ESensrvConnectionTypeWired,
1.237 + /** Sensor is attached to phone wirelessly */
1.238 + ESensrvConnectionTypeWireless,
1.239 + /** Start of licensee Connection type range definitions */
1.240 + ESensrvConnectionTypeLicenseeBase = 8192,
1.241 + /** End of licensee Connection type range definitions */
1.242 + ESensrvConnectionTypeLicenseeEnd = 12287
1.243 + };
1.244 +
1.245 +/**
1.246 +* The unit of the data measured by the sensor channel
1.247 +* Licensee defined values must be between ESensrvChannelUnitLicenseeBase and
1.248 +* ESensrvChannelUnitLicenseeEnd
1.249 +*
1.250 +* @see KSensrvPropIdChannelUnit
1.251 +*/
1.252 +enum TSensrvChannelUnit
1.253 + {
1.254 + /** Channel Unit is not defined */
1.255 + ESensrvChannelUnitNotDefined = 0,
1.256 + /** Acceleration, meter per square second (m/s^2) */
1.257 + ESensevChannelUnitAcceleration = 10,
1.258 + /** Acceleration, gravitational constant (G) */
1.259 + ESensrvChannelUnitGravityConstant = 11,
1.260 + /** ESensrvChannelUnitMagneticFluxDensity, magnetic field density, Tesla (T) */
1.261 + ESensrvChannelUnitMagneticFluxDensity = 12,
1.262 + /** Start of licensee Channel Unit range definitions */
1.263 + ESensrvChannelUnitLicenseeBase = 8192,
1.264 + /** End of licensee Channel Unit range definitions */
1.265 + ESensrvChannelUnitLicenseeEnd = 12287
1.266 + };
1.267 +
1.268 +/**
1.269 +* The format of the data measured by the sensor channel
1.270 +* Licensee defined values must be between ESensrvChannelDataFormatLicenseeBase and
1.271 +* ESensrvChannelDataFormatLicenseeEnd
1.272 +*
1.273 +* @code
1.274 +* Scaled format example:
1.275 +* Measure range for the accelerometer, KSensrvPropIdMeasureRange: -2g to 2g.
1.276 +* KSensrvPropIdScaledRange defines following values:
1.277 +* Range: Min: -127 Max: 127
1.278 +*
1.279 +* Example values for the data item and their absolute values:
1.280 +* Data item: -64 = > -64/127 * 2g = -1.01g
1.281 +* Data item: 32 = > 32/127 * 2g = 0.51g
1.282 +* Data item: 127 = > 127/127 * 2g = 2g
1.283 +* @endcode
1.284 +*
1.285 +* @see KSensrvPropIdChannelDataFormat
1.286 +*/
1.287 +enum TSensrvChannelDataFormat
1.288 + {
1.289 + /** Data Fomat is not defined */
1.290 + ESensrvChannelDataFormatNotDefined = 0,
1.291 + /** Value of the data item represents actual value of the measured quantity */
1.292 + ESensrvChannelDataFormatAbsolute,
1.293 + /**
1.294 + * Value of the data item represents a relative value which is scaled between the maximum
1.295 + * and minimum values of the measured quantity
1.296 + */
1.297 + ESensrvChannelDataFormatScaled,
1.298 + /** Start of licensee Data Format range definitions */
1.299 + ESensrvChannelDataFormatLicenseeBase = 8192,
1.300 + /** End of licensee Data Format range definitions */
1.301 + ESensrvChannelDataFormatLicenseeEnd = 12287
1.302 + };
1.303 +
1.304 +/**
1.305 +* The error code received by a sensor server listener
1.306 +*
1.307 +* @see MSensrvChannelConditionListener
1.308 +* @see MSensrvChannelListener
1.309 +* @see MSensrvDataListener
1.310 +* @see MSensrvPropertyListener
1.311 +*/
1.312 +enum TSensrvErrorSeverity
1.313 + {
1.314 + /** Error Severity is not defined */
1.315 + ESensrvErrorSeverityNotDefined = 0,
1.316 + /** The channel has a temporary failure but listening has been successfully continued */
1.317 + ESensrvErrorSeverityMinor,
1.318 + /** The channel has a fatal error and the channel was closed */
1.319 + ESensrvErrorSeverityFatal
1.320 + };
1.321 +
1.322 +/**
1.323 +* The channel change is detected by the Channel Listener
1.324 +*
1.325 +* @see MSensrvChannelListener
1.326 +*/
1.327 +enum TSensrvChannelChangeType
1.328 + {
1.329 + /** Channel Change not defined */
1.330 + ESensrvChannelChangeTypeNotDefined = 0,
1.331 + /** Channel was removed */
1.332 + ESensrvChannelChangeTypeRemoved,
1.333 + /** Channel was added */
1.334 + ESensrvChannelChangeTypeAdded
1.335 + };
1.336 +
1.337 +/**
1.338 +* The TSensrvPower represents sensor power state
1.339 +*
1.340 +* Possible values:
1.341 +* - ESensrvPowerPowerDown, sensor is currently powered down
1.342 +* - ESensrvPowerPowerUp, sensor currently powered up
1.343 +*/
1.344 +enum TSensrvPower
1.345 + {
1.346 + /** Sensor is powered down */
1.347 + ESensrvPowerPowerDown = 0,
1.348 + /** Sensor is powered up */
1.349 + ESensrvPowerPowerUp
1.350 + };
1.351 +
1.352 +/**
1.353 +* The TSensrvAvailability represents sensor channel availability
1.354 +*
1.355 +* Possible values:
1.356 +* - ESensrvAvailabilityFalse, the channel is not available, which is caused by
1.357 +* either sensor being powered down, or a dependency with another channel
1.358 +* prevents the channel for being available
1.359 +* - ESensrvAvailabilityTrue, the channel is available
1.360 +*/
1.361 +enum TSensrvAvailability
1.362 + {
1.363 + /** Channel not available */
1.364 + ESensrvAvailabilityFalse = 0,
1.365 + /** Channel available */
1.366 + ESensrvAvailabilityTrue
1.367 + };
1.368 +
1.369 +
1.370 +#endif //SENSRVTYPES_H
1.371 +
1.372 +// End of File