epoc32/include/sensrvgeneralproperties.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  General properties definition file.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef SENSRVGENERALPROPERTIES_H
williamr@2
    20
#define SENSRVGENERALPROPERTIES_H
williamr@2
    21
williamr@2
    22
#include <e32base.h>
williamr@2
    23
#include <sensrvtypes.h>
williamr@2
    24
williamr@2
    25
// PROPERTY TEMPLATE
williamr@2
    26
williamr@2
    27
/*
williamr@2
    28
* The following is a template that must be used when defining new properties
williamr@2
    29
*
williamr@2
    30
* Property Name: Name of the property
williamr@2
    31
* Property Type: Defines type of the property (TInt/TReal/TBuf)
williamr@2
    32
* Scope: Defines a property scope. Property can be defined for a channel, for a specific
williamr@2
    33
* item in a channel or for a sensor related to a channel.
williamr@2
    34
* Mandatory: Defines is property mandatory
williamr@2
    35
* Capability: Capabilities needed to set this property
williamr@2
    36
* Description: Description of the property
williamr@2
    37
*/
williamr@2
    38
williamr@2
    39
// CONSTANTS
williamr@2
    40
williamr@2
    41
/**
williamr@2
    42
* Property Name: Data Rate
williamr@2
    43
* Type:         TInt
williamr@2
    44
* Scope:        Channel property
williamr@2
    45
* Mandatory:    Yes
williamr@2
    46
* Capability:   None
williamr@2
    47
* Description:  Current data rate (Hz) of the sensor channel.
williamr@2
    48
*
williamr@2
    49
* A Sensor channel which supports data rates within a given range can use one Data Rate
williamr@2
    50
* property. The range is defined using the property's maximum and minimum value. E.g. A
williamr@2
    51
* sensor channel supports a data range from 10Hz to 100Hz and all values within this range
williamr@2
    52
* are feasible. To implement this use one Data Rate property with a minimum value 10 and a
williamr@2
    53
* maximum value of 100.
williamr@2
    54
*
williamr@2
    55
* A Sensor channel which supports discrete data rates can use the Data Rate property as
williamr@2
    56
* an array. E.g. A sensor channel supports the following data rates 10Hz, 40Hz and 50Hz.
williamr@2
    57
* To implement this four different Data Rate properties are needed. The following table
williamr@2
    58
* shows the content of the four properties, only mandatory attributes are shown.
williamr@2
    59
*
williamr@2
    60
* @code
williamr@2
    61
* property ID     Array index     Value           Min Value       Max Value       Read only
williamr@2
    62
* -----------     -----------     -----           ---------       ---------       ---------
williamr@2
    63
* 0x00000002      -2              1               0               2               EFalse
williamr@2
    64
* 0x00000002      0               10              n/a             n/a             ETrue
williamr@2
    65
* 0x00000002      1               40              n/a             n/a             ETrue
williamr@2
    66
* 0x00000002      2               50              n/a             n/a             ETrue
williamr@2
    67
* @endcode
williamr@2
    68
*
williamr@2
    69
* The first property (first row in table above) is the header for the property array. It
williamr@2
    70
* defines that this property is an array property. The attributes of this property are:
williamr@2
    71
*
williamr@2
    72
* Array index:
williamr@2
    73
* -2 means that the property is an array property
williamr@2
    74
* Value:
williamr@2
    75
* 1 means that current value of the property is defined by the property with an array index of
williamr@2
    76
* 1. The value is 40Hz in this example.
williamr@2
    77
* Min value
williamr@2
    78
* 0 is the start index of the property array
williamr@2
    79
* Max value:
williamr@2
    80
* 2 is the last index of the property array
williamr@2
    81
* Read only:
williamr@2
    82
* EFalse means that the properties current value can be changed,
williamr@2
    83
*
williamr@2
    84
* In this example the possible values of the property are 0, 1, and 2 which corresponds to data
williamr@2
    85
* rates of 10Hz, 40Hz and 50Hz.
williamr@2
    86
*/
williamr@2
    87
const TSensrvPropertyId KSensrvPropIdDataRate = 0x00000002;
williamr@2
    88
williamr@2
    89
/**
williamr@2
    90
* Name:         Power id property
williamr@2
    91
* Type:         TInt
williamr@2
    92
* Scope:        Channel item property
williamr@2
    93
* Mandatory:    No
williamr@2
    94
* Capability:   None
williamr@2
    95
* Description:  Power Property of the sensor
williamr@2
    96
*               Sensor power may either be down (ESensrvPowerPowerDown) or up (ESensrvPowerPowerUp).
williamr@2
    97
*               When sensor power is down, it's channels will also be unavailable.
williamr@2
    98
*               When sensor power is up, any given channel provided by the sensor may either be
williamr@2
    99
*               available or unavailable. The availability property represents channel's availability.
williamr@2
   100
*
williamr@2
   101
* @see          TSensrvPower.
williamr@2
   102
* @see          KSensrvPropIdAvailability
williamr@2
   103
*/
williamr@2
   104
const TSensrvPropertyId KSensrvPropIdPower = 0x00000003;
williamr@2
   105
williamr@2
   106
/**
williamr@2
   107
* Name: Availability
williamr@2
   108
* Type:         TInt.
williamr@2
   109
* Scope:        Channel property
williamr@2
   110
* Mandatory:    Yes
williamr@2
   111
* Capability:   None
williamr@2
   112
* Description:  Indicates if channel is available or not. There are channels
williamr@2
   113
*               supported by a sensor that cannot be opened at the same time.
williamr@2
   114
*               These so called dependant channnels are managed by client priorities.
williamr@2
   115
*               Availability property informs if a channel is available at the moment.
williamr@2
   116
*               Also, unavailable channel can be opened or be listened by client but
williamr@2
   117
*               the channel become functional after availability changes.
williamr@2
   118
*               Availability property values are defined in TSensrvAvailability
williamr@2
   119
*               as ESensrvAvailabilityFalse (not available) and ESensrvAvailabilityTrue
williamr@2
   120
*               (available).
williamr@2
   121
*
williamr@2
   122
* @see          TSensrvAvailability
williamr@2
   123
*/
williamr@2
   124
const TSensrvPropertyId KSensrvPropIdAvailability = 0x00000004;
williamr@2
   125
williamr@2
   126
/**
williamr@2
   127
* Name: Measure Range
williamr@2
   128
* Type: TReal or TInt
williamr@2
   129
* Scope: Channel item property
williamr@2
   130
* Mandatory: No
williamr@2
   131
* Capability: None
williamr@2
   132
* Description: The measure range of the sensor channel.
williamr@2
   133
*
williamr@2
   134
* The channel measure range is defined by the property's maximum and minimum values. The property
williamr@2
   135
* value represents the resolution of the measure range. The measure range property can also be
williamr@2
   136
* an array property.
williamr@2
   137
*
williamr@2
   138
* Example:
williamr@2
   139
*
williamr@2
   140
* An accelerometer xyz axis channel has a range of +/- 2g. Therefore the property would be a single
williamr@2
   141
* property, its type would be ESensrvIntProperty and its value would be 2.
williamr@2
   142
*
williamr@2
   143
* An orientation channel has a range of scalar integers representing the current orientation of
williamr@2
   144
* the mobile:  Undefined, Up, Down, Left, Right, Upward, Downward. Therefore the property would be an
williamr@2
   145
* array property (count of 8 made up of 1 header + 7 scalar values), its type would be
williamr@2
   146
* ESensrvIntProperty and the values of each member of the array would be one of the scalar values
williamr@2
   147
* above. For an example of an array property see KSensrvPropIdDataRate.
williamr@2
   148
*
williamr@2
   149
* A rotation channel has a range of 0-360 degrees. Therefore the property would be an array property
williamr@2
   150
* (count of 3 made up of 1 header + 1 min value + 1 max value), its type would be ESensrvIntProperty
williamr@2
   151
* and the values of each member of the array would be 0 and 360.
williamr@2
   152
*
williamr@2
   153
* The sensor specific channel header file for each channel found in epoc32\include\sensors\channels
williamr@2
   154
* will define the exact content of this property.
williamr@2
   155
*
williamr@2
   156
* @see ESensrvIntProperty
williamr@2
   157
* @see TSensrvArrayIndex
williamr@2
   158
* @see KSensrvPropIdDataRate
williamr@2
   159
*/
williamr@2
   160
const TSensrvPropertyId KSensrvPropIdMeasureRange = 0x00000005;
williamr@2
   161
williamr@2
   162
/**
williamr@2
   163
* Name: Format of the channel data
williamr@2
   164
* Type: TInt, see possible values from TSensrvChannelDataFormat
williamr@2
   165
* Scope: Channel item property
williamr@2
   166
* Mandatory: Yes
williamr@2
   167
* Capability: None
williamr@2
   168
* Description: A format which is used to present a data value.
williamr@2
   169
*
williamr@2
   170
* @see TSensrvChannelDataFormat
williamr@2
   171
*/
williamr@2
   172
const TSensrvPropertyId KSensrvPropIdChannelDataFormat = 0x000000006;
williamr@2
   173
williamr@2
   174
/**
williamr@2
   175
* Name:        Data item scaled range
williamr@2
   176
* Type:        TInt.
williamr@2
   177
* Scope:       Channel item property
williamr@2
   178
* Mandatory:   No
williamr@2
   179
* Capability:  None
williamr@2
   180
* Description: If the channel data is scaled it represents the scale of the returned data.
williamr@2
   181
*
williamr@2
   182
* The property value represents the minimum and maximum values of the scaled range. This property
williamr@2
   183
* should is used when the KSensrvPropIdChannelDataFormat property value is ESensrvFormatScaled.
williamr@2
   184
*
williamr@2
   185
* Example:
williamr@2
   186
*
williamr@2
   187
* An accelerometer xyz axis channel has a scaled range of -128 to 127. Therefore the property would
williamr@2
   188
* be an array property (count of 3 made up of 1 header + 1 min value + 1 max value), its type would
williamr@2
   189
* be ESensrvIntProperty and the values of each member of the array would be -128 and 127.
williamr@2
   190
*
williamr@2
   191
* If the accelerometer xyz axis channel also has a measure range of +/- 2g given by
williamr@2
   192
* KSensrvPropIdMeasureRange property. Then if a data value of 64 is read on one of the axis the g reading
williamr@2
   193
* would be approximately +1g.
williamr@2
   194
*
williamr@2
   195
* Rotation and orientation channels would have KSensrvPropIdChannelDataFormat set to
williamr@2
   196
* ESensrvChannelDataFormatAbsolute. Theerfore this property would not exist for these channels.
williamr@2
   197
*
williamr@2
   198
* The sensor specific channel header file for each channel found in epoc32\include\sensors\channels
williamr@2
   199
* will define the exact content of this property.
williamr@2
   200
*
williamr@2
   201
* @see KSensrvPropIdChannelDataFormat
williamr@2
   202
* @see KSensrvPropIdMeasureRange
williamr@2
   203
*/
williamr@2
   204
const TSensrvPropertyId KSensrvPropIdScaledRange = 0x000000007;
williamr@2
   205
williamr@2
   206
/**
williamr@2
   207
* Name: Accuracy of the channel data
williamr@2
   208
* Type: TReal
williamr@2
   209
* Scope: Channel item property
williamr@2
   210
* Mandatory: No
williamr@2
   211
* Capability: None
williamr@2
   212
* Description: The property value is the accuracy of the channel
williamr@2
   213
*
williamr@2
   214
* Example:
williamr@2
   215
*
williamr@2
   216
* An accelerometer xyz axis channel has an accuracy of +/-2mg. Therefore the property would be a
williamr@2
   217
* single property, its type would be ESensrvIntProperty and its value would be 2.
williamr@2
   218
*
williamr@2
   219
* An orientation channel has a range of scalar integers representing the current orientation of
williamr@2
   220
* the mobile and therefore has no accuracy associated with it. Therefore this property will not
williamr@2
   221
* exist for this channel.
williamr@2
   222
*
williamr@2
   223
* A rotation channel has an accuracy of the nearest 15 degrees. Therefore the property would be
williamr@2
   224
* a single property, its type would be ESensrvIntProperty and its value would be 15.
williamr@2
   225
*
williamr@2
   226
* The sensor specific channel header file for each channel found in epoc32\include\sensors\channels
williamr@2
   227
* will define the exact content of this property.
williamr@2
   228
*
williamr@2
   229
* @see ESensrvIntProperty
williamr@2
   230
*/
williamr@2
   231
const TSensrvPropertyId KSensrvPropIdChannelAccuracy = 0x000000008;
williamr@2
   232
williamr@2
   233
/**
williamr@2
   234
* Name: Channel Data Scale
williamr@2
   235
* Type: TInt
williamr@2
   236
* Scope: Channel item property
williamr@2
   237
* Mandatory: Mandatory when KSensrvPropIdChannelDataFormat is set to ESensrvFormatGeneral
williamr@2
   238
* Capability: None
williamr@2
   239
* Description: The property value is the scale used for the measurement provided by this channel.
williamr@2
   240
*
williamr@2
   241
* The scale can be used as a substitute for prefixing the unit. The scale is expressed as an
williamr@2
   242
* exponent of ten. If no scaling is needed, the scale MUST be zero.
williamr@2
   243
*
williamr@2
   244
* Either the unit or data values can be altered by the scaling factor. If, for example, the
williamr@2
   245
* unit is meter and the scale is -3, either the unit can be interpreted as "mm" or the data
williamr@2
   246
* value can be mulitplied by 10^(scale). i.e For a unit of Meter, a scale of -3 and a value of
williamr@2
   247
* 10 the value canbe interpreted as either 10mm, or 0.01 Meter
williamr@2
   248
*
williamr@2
   249
* If the data type of the channel is int this results in a fixed-point representation in which
williamr@2
   250
* the number of decimal places always remains the same. Using a fixed-point representation can
williamr@2
   251
* have a favorable effect on performance. With floating point data type, the scaling factor is
williamr@2
   252
* often used for convenience. With either very small, or very large values the presentation can
williamr@2
   253
* be more readable when the values are presented in moderate numbers.
williamr@2
   254
*
williamr@2
   255
* Channel data values and the KSensrvMeasureRange property must be represented using the same
williamr@2
   256
* scale.
williamr@2
   257
*
williamr@2
   258
* @see KSensrvPropIdChannelDataFormat
williamr@2
   259
*/
williamr@2
   260
const TSensrvPropertyId KSensrvPropIdChannelScale = 0x000000009;
williamr@2
   261
williamr@2
   262
/**
williamr@2
   263
* Name: Channel item unit
williamr@2
   264
* Type: TInt, see possible values from TSensrvChannelUnit
williamr@2
   265
* Scope: Channel item property
williamr@2
   266
* Mandatory: No
williamr@2
   267
* Capability: None
williamr@2
   268
* Description:  The property value is the unit, in which data values are presented.
williamr@2
   269
*
williamr@2
   270
* The recommended units are listed in TSensrvChannelUnit.
williamr@2
   271
*
williamr@2
   272
* @see TSensrvChannelUnit
williamr@2
   273
*/
williamr@2
   274
const TSensrvPropertyId KSensrvPropIdChannelUnit = 0x0000000010;
williamr@2
   275
williamr@2
   276
/**
williamr@2
   277
* Name:         Sensor model
williamr@2
   278
* Type:         Buffer
williamr@2
   279
* Scope:        Sensor property
williamr@2
   280
* Mandatory:    No
williamr@2
   281
* Capability:   None
williamr@2
   282
* Description: The property value is a sensor model description
williamr@2
   283
*/
williamr@2
   284
const TSensrvPropertyId KSensrvSensorModel = 0x0000000011;
williamr@2
   285
williamr@2
   286
/**
williamr@2
   287
* Name:         Sensor connection type
williamr@2
   288
* Type:         TInt.
williamr@2
   289
* Scope:        Sensor property
williamr@2
   290
* Mandatory:    No
williamr@2
   291
* Capability:   None
williamr@2
   292
* Description: Defines sensor connection type
williamr@2
   293
*
williamr@2
   294
* @see TSensrvConnectionType
williamr@2
   295
*/
williamr@2
   296
const TSensrvPropertyId KSensrvSensorConnectionType = 0x0000000012;
williamr@2
   297
williamr@2
   298
/**
williamr@2
   299
* Name: Sensor description
williamr@2
   300
* Type: Buffer
williamr@2
   301
* Scope: Sensor property
williamr@2
   302
* Mandatory: No
williamr@2
   303
* Capability: None
williamr@2
   304
* Description: The property value is a short description of the sensor
williamr@2
   305
*
williamr@2
   306
* If required this property can be used to hold a long description (>20 characters) of the sensor
williamr@2
   307
* by making it an array property. Each member of the array can hold part of the longer description.
williamr@2
   308
* Any framework client retrieving the property can then concatenate parts to make the full
williamr@2
   309
* description. The sensor specific headers found in epoc32\include\sensors\channels will define
williamr@2
   310
* whether this is a single property or an array property.
williamr@2
   311
*/
williamr@2
   312
const TSensrvPropertyId KSensrvSensorDescription = 0x0000000013;
williamr@2
   313
williamr@2
   314
/**
williamr@2
   315
* - Name:         Compensation type of channel data
williamr@2
   316
* - Type:         TInt, see possible values from TSensorCompensationType 
williamr@2
   317
*                 enumeration declared in sensordatacompensationtypes.h.
williamr@2
   318
* - Scope:        Channel property
williamr@2
   319
* - Mandatory:    No   
williamr@2
   320
* - Capability:   None
williamr@2
   321
* - Description:  Indicates channel data compensation type.
williamr@2
   322
*/
williamr@2
   323
const TSensrvPropertyId KSensrvPropIdChannelDataCompensation = 0x0000000014;
williamr@2
   324
williamr@2
   325
#endif //SENSRVGENERALPROPERTIES_H
williamr@2
   326
williamr@2
   327
// End of File