epoc32/include/sensrvgeneralproperties.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/sensrvgeneralproperties.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/sensrvgeneralproperties.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,327 @@
     1.4 -sensrvgeneralproperties.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:  General properties definition file.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef SENSRVGENERALPROPERTIES_H
    1.24 +#define SENSRVGENERALPROPERTIES_H
    1.25 +
    1.26 +#include <e32base.h>
    1.27 +#include <sensrvtypes.h>
    1.28 +
    1.29 +// PROPERTY TEMPLATE
    1.30 +
    1.31 +/*
    1.32 +* The following is a template that must be used when defining new properties
    1.33 +*
    1.34 +* Property Name: Name of the property
    1.35 +* Property Type: Defines type of the property (TInt/TReal/TBuf)
    1.36 +* Scope: Defines a property scope. Property can be defined for a channel, for a specific
    1.37 +* item in a channel or for a sensor related to a channel.
    1.38 +* Mandatory: Defines is property mandatory
    1.39 +* Capability: Capabilities needed to set this property
    1.40 +* Description: Description of the property
    1.41 +*/
    1.42 +
    1.43 +// CONSTANTS
    1.44 +
    1.45 +/**
    1.46 +* Property Name: Data Rate
    1.47 +* Type:         TInt
    1.48 +* Scope:        Channel property
    1.49 +* Mandatory:    Yes
    1.50 +* Capability:   None
    1.51 +* Description:  Current data rate (Hz) of the sensor channel.
    1.52 +*
    1.53 +* A Sensor channel which supports data rates within a given range can use one Data Rate
    1.54 +* property. The range is defined using the property's maximum and minimum value. E.g. A
    1.55 +* sensor channel supports a data range from 10Hz to 100Hz and all values within this range
    1.56 +* are feasible. To implement this use one Data Rate property with a minimum value 10 and a
    1.57 +* maximum value of 100.
    1.58 +*
    1.59 +* A Sensor channel which supports discrete data rates can use the Data Rate property as
    1.60 +* an array. E.g. A sensor channel supports the following data rates 10Hz, 40Hz and 50Hz.
    1.61 +* To implement this four different Data Rate properties are needed. The following table
    1.62 +* shows the content of the four properties, only mandatory attributes are shown.
    1.63 +*
    1.64 +* @code
    1.65 +* property ID     Array index     Value           Min Value       Max Value       Read only
    1.66 +* -----------     -----------     -----           ---------       ---------       ---------
    1.67 +* 0x00000002      -2              1               0               2               EFalse
    1.68 +* 0x00000002      0               10              n/a             n/a             ETrue
    1.69 +* 0x00000002      1               40              n/a             n/a             ETrue
    1.70 +* 0x00000002      2               50              n/a             n/a             ETrue
    1.71 +* @endcode
    1.72 +*
    1.73 +* The first property (first row in table above) is the header for the property array. It
    1.74 +* defines that this property is an array property. The attributes of this property are:
    1.75 +*
    1.76 +* Array index:
    1.77 +* -2 means that the property is an array property
    1.78 +* Value:
    1.79 +* 1 means that current value of the property is defined by the property with an array index of
    1.80 +* 1. The value is 40Hz in this example.
    1.81 +* Min value
    1.82 +* 0 is the start index of the property array
    1.83 +* Max value:
    1.84 +* 2 is the last index of the property array
    1.85 +* Read only:
    1.86 +* EFalse means that the properties current value can be changed,
    1.87 +*
    1.88 +* In this example the possible values of the property are 0, 1, and 2 which corresponds to data
    1.89 +* rates of 10Hz, 40Hz and 50Hz.
    1.90 +*/
    1.91 +const TSensrvPropertyId KSensrvPropIdDataRate = 0x00000002;
    1.92 +
    1.93 +/**
    1.94 +* Name:         Power id property
    1.95 +* Type:         TInt
    1.96 +* Scope:        Channel item property
    1.97 +* Mandatory:    No
    1.98 +* Capability:   None
    1.99 +* Description:  Power Property of the sensor
   1.100 +*               Sensor power may either be down (ESensrvPowerPowerDown) or up (ESensrvPowerPowerUp).
   1.101 +*               When sensor power is down, it's channels will also be unavailable.
   1.102 +*               When sensor power is up, any given channel provided by the sensor may either be
   1.103 +*               available or unavailable. The availability property represents channel's availability.
   1.104 +*
   1.105 +* @see          TSensrvPower.
   1.106 +* @see          KSensrvPropIdAvailability
   1.107 +*/
   1.108 +const TSensrvPropertyId KSensrvPropIdPower = 0x00000003;
   1.109 +
   1.110 +/**
   1.111 +* Name: Availability
   1.112 +* Type:         TInt.
   1.113 +* Scope:        Channel property
   1.114 +* Mandatory:    Yes
   1.115 +* Capability:   None
   1.116 +* Description:  Indicates if channel is available or not. There are channels
   1.117 +*               supported by a sensor that cannot be opened at the same time.
   1.118 +*               These so called dependant channnels are managed by client priorities.
   1.119 +*               Availability property informs if a channel is available at the moment.
   1.120 +*               Also, unavailable channel can be opened or be listened by client but
   1.121 +*               the channel become functional after availability changes.
   1.122 +*               Availability property values are defined in TSensrvAvailability
   1.123 +*               as ESensrvAvailabilityFalse (not available) and ESensrvAvailabilityTrue
   1.124 +*               (available).
   1.125 +*
   1.126 +* @see          TSensrvAvailability
   1.127 +*/
   1.128 +const TSensrvPropertyId KSensrvPropIdAvailability = 0x00000004;
   1.129 +
   1.130 +/**
   1.131 +* Name: Measure Range
   1.132 +* Type: TReal or TInt
   1.133 +* Scope: Channel item property
   1.134 +* Mandatory: No
   1.135 +* Capability: None
   1.136 +* Description: The measure range of the sensor channel.
   1.137 +*
   1.138 +* The channel measure range is defined by the property's maximum and minimum values. The property
   1.139 +* value represents the resolution of the measure range. The measure range property can also be
   1.140 +* an array property.
   1.141 +*
   1.142 +* Example:
   1.143 +*
   1.144 +* An accelerometer xyz axis channel has a range of +/- 2g. Therefore the property would be a single
   1.145 +* property, its type would be ESensrvIntProperty and its value would be 2.
   1.146 +*
   1.147 +* An orientation channel has a range of scalar integers representing the current orientation of
   1.148 +* the mobile:  Undefined, Up, Down, Left, Right, Upward, Downward. Therefore the property would be an
   1.149 +* array property (count of 8 made up of 1 header + 7 scalar values), its type would be
   1.150 +* ESensrvIntProperty and the values of each member of the array would be one of the scalar values
   1.151 +* above. For an example of an array property see KSensrvPropIdDataRate.
   1.152 +*
   1.153 +* A rotation channel has a range of 0-360 degrees. Therefore the property would be an array property
   1.154 +* (count of 3 made up of 1 header + 1 min value + 1 max value), its type would be ESensrvIntProperty
   1.155 +* and the values of each member of the array would be 0 and 360.
   1.156 +*
   1.157 +* The sensor specific channel header file for each channel found in epoc32\include\sensors\channels
   1.158 +* will define the exact content of this property.
   1.159 +*
   1.160 +* @see ESensrvIntProperty
   1.161 +* @see TSensrvArrayIndex
   1.162 +* @see KSensrvPropIdDataRate
   1.163 +*/
   1.164 +const TSensrvPropertyId KSensrvPropIdMeasureRange = 0x00000005;
   1.165 +
   1.166 +/**
   1.167 +* Name: Format of the channel data
   1.168 +* Type: TInt, see possible values from TSensrvChannelDataFormat
   1.169 +* Scope: Channel item property
   1.170 +* Mandatory: Yes
   1.171 +* Capability: None
   1.172 +* Description: A format which is used to present a data value.
   1.173 +*
   1.174 +* @see TSensrvChannelDataFormat
   1.175 +*/
   1.176 +const TSensrvPropertyId KSensrvPropIdChannelDataFormat = 0x000000006;
   1.177 +
   1.178 +/**
   1.179 +* Name:        Data item scaled range
   1.180 +* Type:        TInt.
   1.181 +* Scope:       Channel item property
   1.182 +* Mandatory:   No
   1.183 +* Capability:  None
   1.184 +* Description: If the channel data is scaled it represents the scale of the returned data.
   1.185 +*
   1.186 +* The property value represents the minimum and maximum values of the scaled range. This property
   1.187 +* should is used when the KSensrvPropIdChannelDataFormat property value is ESensrvFormatScaled.
   1.188 +*
   1.189 +* Example:
   1.190 +*
   1.191 +* An accelerometer xyz axis channel has a scaled range of -128 to 127. Therefore the property would
   1.192 +* be an array property (count of 3 made up of 1 header + 1 min value + 1 max value), its type would
   1.193 +* be ESensrvIntProperty and the values of each member of the array would be -128 and 127.
   1.194 +*
   1.195 +* If the accelerometer xyz axis channel also has a measure range of +/- 2g given by
   1.196 +* KSensrvPropIdMeasureRange property. Then if a data value of 64 is read on one of the axis the g reading
   1.197 +* would be approximately +1g.
   1.198 +*
   1.199 +* Rotation and orientation channels would have KSensrvPropIdChannelDataFormat set to
   1.200 +* ESensrvChannelDataFormatAbsolute. Theerfore this property would not exist for these channels.
   1.201 +*
   1.202 +* The sensor specific channel header file for each channel found in epoc32\include\sensors\channels
   1.203 +* will define the exact content of this property.
   1.204 +*
   1.205 +* @see KSensrvPropIdChannelDataFormat
   1.206 +* @see KSensrvPropIdMeasureRange
   1.207 +*/
   1.208 +const TSensrvPropertyId KSensrvPropIdScaledRange = 0x000000007;
   1.209 +
   1.210 +/**
   1.211 +* Name: Accuracy of the channel data
   1.212 +* Type: TReal
   1.213 +* Scope: Channel item property
   1.214 +* Mandatory: No
   1.215 +* Capability: None
   1.216 +* Description: The property value is the accuracy of the channel
   1.217 +*
   1.218 +* Example:
   1.219 +*
   1.220 +* An accelerometer xyz axis channel has an accuracy of +/-2mg. Therefore the property would be a
   1.221 +* single property, its type would be ESensrvIntProperty and its value would be 2.
   1.222 +*
   1.223 +* An orientation channel has a range of scalar integers representing the current orientation of
   1.224 +* the mobile and therefore has no accuracy associated with it. Therefore this property will not
   1.225 +* exist for this channel.
   1.226 +*
   1.227 +* A rotation channel has an accuracy of the nearest 15 degrees. Therefore the property would be
   1.228 +* a single property, its type would be ESensrvIntProperty and its value would be 15.
   1.229 +*
   1.230 +* The sensor specific channel header file for each channel found in epoc32\include\sensors\channels
   1.231 +* will define the exact content of this property.
   1.232 +*
   1.233 +* @see ESensrvIntProperty
   1.234 +*/
   1.235 +const TSensrvPropertyId KSensrvPropIdChannelAccuracy = 0x000000008;
   1.236 +
   1.237 +/**
   1.238 +* Name: Channel Data Scale
   1.239 +* Type: TInt
   1.240 +* Scope: Channel item property
   1.241 +* Mandatory: Mandatory when KSensrvPropIdChannelDataFormat is set to ESensrvFormatGeneral
   1.242 +* Capability: None
   1.243 +* Description: The property value is the scale used for the measurement provided by this channel.
   1.244 +*
   1.245 +* The scale can be used as a substitute for prefixing the unit. The scale is expressed as an
   1.246 +* exponent of ten. If no scaling is needed, the scale MUST be zero.
   1.247 +*
   1.248 +* Either the unit or data values can be altered by the scaling factor. If, for example, the
   1.249 +* unit is meter and the scale is -3, either the unit can be interpreted as "mm" or the data
   1.250 +* value can be mulitplied by 10^(scale). i.e For a unit of Meter, a scale of -3 and a value of
   1.251 +* 10 the value canbe interpreted as either 10mm, or 0.01 Meter
   1.252 +*
   1.253 +* If the data type of the channel is int this results in a fixed-point representation in which
   1.254 +* the number of decimal places always remains the same. Using a fixed-point representation can
   1.255 +* have a favorable effect on performance. With floating point data type, the scaling factor is
   1.256 +* often used for convenience. With either very small, or very large values the presentation can
   1.257 +* be more readable when the values are presented in moderate numbers.
   1.258 +*
   1.259 +* Channel data values and the KSensrvMeasureRange property must be represented using the same
   1.260 +* scale.
   1.261 +*
   1.262 +* @see KSensrvPropIdChannelDataFormat
   1.263 +*/
   1.264 +const TSensrvPropertyId KSensrvPropIdChannelScale = 0x000000009;
   1.265 +
   1.266 +/**
   1.267 +* Name: Channel item unit
   1.268 +* Type: TInt, see possible values from TSensrvChannelUnit
   1.269 +* Scope: Channel item property
   1.270 +* Mandatory: No
   1.271 +* Capability: None
   1.272 +* Description:  The property value is the unit, in which data values are presented.
   1.273 +*
   1.274 +* The recommended units are listed in TSensrvChannelUnit.
   1.275 +*
   1.276 +* @see TSensrvChannelUnit
   1.277 +*/
   1.278 +const TSensrvPropertyId KSensrvPropIdChannelUnit = 0x0000000010;
   1.279 +
   1.280 +/**
   1.281 +* Name:         Sensor model
   1.282 +* Type:         Buffer
   1.283 +* Scope:        Sensor property
   1.284 +* Mandatory:    No
   1.285 +* Capability:   None
   1.286 +* Description: The property value is a sensor model description
   1.287 +*/
   1.288 +const TSensrvPropertyId KSensrvSensorModel = 0x0000000011;
   1.289 +
   1.290 +/**
   1.291 +* Name:         Sensor connection type
   1.292 +* Type:         TInt.
   1.293 +* Scope:        Sensor property
   1.294 +* Mandatory:    No
   1.295 +* Capability:   None
   1.296 +* Description: Defines sensor connection type
   1.297 +*
   1.298 +* @see TSensrvConnectionType
   1.299 +*/
   1.300 +const TSensrvPropertyId KSensrvSensorConnectionType = 0x0000000012;
   1.301 +
   1.302 +/**
   1.303 +* Name: Sensor description
   1.304 +* Type: Buffer
   1.305 +* Scope: Sensor property
   1.306 +* Mandatory: No
   1.307 +* Capability: None
   1.308 +* Description: The property value is a short description of the sensor
   1.309 +*
   1.310 +* If required this property can be used to hold a long description (>20 characters) of the sensor
   1.311 +* by making it an array property. Each member of the array can hold part of the longer description.
   1.312 +* Any framework client retrieving the property can then concatenate parts to make the full
   1.313 +* description. The sensor specific headers found in epoc32\include\sensors\channels will define
   1.314 +* whether this is a single property or an array property.
   1.315 +*/
   1.316 +const TSensrvPropertyId KSensrvSensorDescription = 0x0000000013;
   1.317 +
   1.318 +/**
   1.319 +* - Name:         Compensation type of channel data
   1.320 +* - Type:         TInt, see possible values from TSensorCompensationType 
   1.321 +*                 enumeration declared in sensordatacompensationtypes.h.
   1.322 +* - Scope:        Channel property
   1.323 +* - Mandatory:    No   
   1.324 +* - Capability:   None
   1.325 +* - Description:  Indicates channel data compensation type.
   1.326 +*/
   1.327 +const TSensrvPropertyId KSensrvPropIdChannelDataCompensation = 0x0000000014;
   1.328 +
   1.329 +#endif //SENSRVGENERALPROPERTIES_H
   1.330 +
   1.331 +// End of File