epoc32/include/sensrvtypes.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) 2006-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:  Type definitions file for Sensor Server
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef SENSRVTYPES_H
williamr@2
    21
#define SENSRVTYPES_H
williamr@2
    22
williamr@2
    23
#include <e32base.h>
williamr@2
    24
#include <sensrvproperty.h>
williamr@2
    25
williamr@2
    26
// Forward declare channel info
williamr@2
    27
class TSensrvChannelInfo;
williamr@2
    28
williamr@2
    29
/**
williamr@2
    30
* Max length of the vendor Id
williamr@2
    31
*
williamr@2
    32
* @see TSensrvChannelInfo
williamr@2
    33
*/
williamr@2
    34
const TInt KSensrvVendorIdLength = 16;
williamr@2
    35
williamr@2
    36
/**
williamr@2
    37
* Max length of the location string
williamr@2
    38
*
williamr@2
    39
* @see TSensrvChannelInfo
williamr@2
    40
*/
williamr@2
    41
const TInt KSensrvLocationLength = 16;
williamr@2
    42
williamr@2
    43
/**
williamr@2
    44
* Item index for properties that are not data item specific
williamr@2
    45
*
williamr@2
    46
* @see TSensrvProperty
williamr@2
    47
*/
williamr@2
    48
const TInt KSensrvItemIndexNone = -1;
williamr@2
    49
williamr@2
    50
// DATA TYPES
williamr@2
    51
williamr@2
    52
/**
williamr@2
    53
* Type definition for a channel id used by TSensrvChannelInfo. Its value is assigned by the Sensor
williamr@2
    54
* Server and uniquely identifies a channel for the client session. When the client session has ended
williamr@2
    55
* the channel id is no longer valid.
williamr@2
    56
*
williamr@2
    57
* @see TSensrvChannelInfo
williamr@2
    58
* @see CSsyControl
williamr@2
    59
* @see MSsyCallback
williamr@2
    60
* @see MSsyChannelDataProvider
williamr@2
    61
* @see MSsyPropertyProvider
williamr@2
    62
*/
williamr@2
    63
typedef TUint32 TSensrvChannelId;
williamr@2
    64
williamr@2
    65
/**
williamr@2
    66
* Type definition for a channel type used by TSensrvChannelInfo. This id identifies the type of channel
williamr@2
    67
* * that the object represents and therefore the content of the channel. This value is a uid and is unique
williamr@2
    68
* among all channels. See sensor channel specific header files. A client can use this value as one of the
williamr@2
    69
* search criteria when finding channels.
williamr@2
    70
*
williamr@2
    71
* @see TSensrvChannelInfo
williamr@2
    72
*/
williamr@2
    73
typedef TUint32 TSensrvChannelTypeId;
williamr@2
    74
williamr@2
    75
/**
williamr@2
    76
* Typedef for datatype Id used by TSensrvChannelInfo. This identifies the data type for the data that the
williamr@2
    77
* channel provides. This value is a uid and is unique among all channels. See sensor channel specific header
williamr@2
    78
* files.
williamr@2
    79
*
williamr@2
    80
* @see TSensrvChannelInfo
williamr@2
    81
*/
williamr@2
    82
typedef TUint32 TSensrvChannelDataTypeId;
williamr@2
    83
williamr@2
    84
williamr@2
    85
/**
williamr@2
    86
* Undefined Channel id for use when finding channels
williamr@2
    87
*
williamr@2
    88
* @see CSensrvChannelFinder
williamr@2
    89
*/
williamr@2
    90
const TSensrvChannelTypeId KSensrvChannelTypeIdUndefined = 0x00000000;
williamr@2
    91
williamr@2
    92
/**
williamr@2
    93
* RArray based channel Id list
williamr@2
    94
*
williamr@2
    95
* @see MSsyCallback
williamr@2
    96
* @see MSsyPropertyProvider
williamr@2
    97
*/
williamr@2
    98
typedef RArray<TSensrvChannelId> RSensrvChannelList;
williamr@2
    99
williamr@2
   100
/**
williamr@2
   101
* RArray based property list
williamr@2
   102
*
williamr@2
   103
* @see CSensrvChannel
williamr@2
   104
* @see MSsyPropertyProvider
williamr@2
   105
*/
williamr@2
   106
typedef RArray<TSensrvProperty> RSensrvPropertyList;
williamr@2
   107
williamr@2
   108
/**
williamr@2
   109
* RArray based channel info list
williamr@2
   110
*
williamr@2
   111
* @see CSensrvChannelFinder
williamr@2
   112
* @see MSsyCallback
williamr@2
   113
*/
williamr@2
   114
typedef RArray<TSensrvChannelInfo> RSensrvChannelInfoList;
williamr@2
   115
williamr@2
   116
/**
williamr@2
   117
* Indication of whether a call to CSensrvChannel::SetPropertyL() is likely to succeed
williamr@2
   118
*
williamr@2
   119
* @see CSensrvChannel
williamr@2
   120
* @see MSensrvPropertyListener
williamr@2
   121
*/
williamr@2
   122
enum TSetPropertySuccessIndicator
williamr@2
   123
    {
williamr@2
   124
    ESetPropertyIndicationUnknown = 0,
williamr@2
   125
    /**
williamr@2
   126
    * Setting of a property is certain to succeed because client has the highest priority
williamr@2
   127
    * of all clients that have open channels on that sensor device
williamr@2
   128
    */
williamr@2
   129
    ESetPropertyIndicationAvailable,
williamr@2
   130
    /**
williamr@2
   131
    * Setting of a property may not succeed because:
williamr@2
   132
    * 1. Client has the highest priority on its own channel however there are multiple
williamr@2
   133
    * clients with the same priority and control is granted on a first come first served
williamr@2
   134
    * basis.
williamr@2
   135
    * 2. Client has highest priority on its own channel however there are higher priority
williamr@2
   136
    * clients on other channels of the device that may be affected by the setting, in which
williamr@2
   137
    * case it will not be allowed.
williamr@2
   138
    * 3. Client has highest priority on its channel however there are same priority clients
williamr@2
   139
    * on other channels of the device that may be affected by the setting, in which case it
williamr@2
   140
    * will not be allowed
williamr@2
   141
    */
williamr@2
   142
    ESetPropertyIndicationPossible,
williamr@2
   143
    /**
williamr@2
   144
    * Setting of a property will not succeed because:
williamr@2
   145
    * 1. There are clients on the same channel with higher priority
williamr@2
   146
    * 2. A client of the same priority is already setting properties on channel.
williamr@2
   147
    */
williamr@2
   148
    ESetPropertyIndicationUnavailable
williamr@2
   149
    };
williamr@2
   150
williamr@2
   151
/**
williamr@2
   152
* The quantity of channel values. Defines the quantity the channel is measuring.
williamr@2
   153
* Licensee defined values must be between ESensrvQuantityLicenseeBase and
williamr@2
   154
* ESensrvQuantityLicenseeEnd
williamr@2
   155
*
williamr@2
   156
* @see TSensrvChannelInfo
williamr@2
   157
*/
williamr@2
   158
enum TSensrvQuantity
williamr@2
   159
    {
williamr@2
   160
    /** Channel doesn't provide quantity information*/
williamr@2
   161
    ESensrvQuantityNotUsed = -1,
williamr@2
   162
    /** Quantity is not defined */
williamr@2
   163
    ESensrvQuantityNotdefined = 0,
williamr@2
   164
    /** Channel measures acceleration */
williamr@2
   165
    ESensrvQuantityAcceleration = 10,
williamr@2
   166
    /** Channel measures tapping events */
williamr@2
   167
    ESensrvQuantityTapping = 11,
williamr@2
   168
    /** Channel measures phone orientation */
williamr@2
   169
    ESensrvQuantityOrientation = 12,
williamr@2
   170
    /** Channel measures phone rotation */
williamr@2
   171
    ESensrvQuantityRotation = 13,
williamr@2
   172
    /** Channel measures phone direction */
williamr@2
   173
    ESensrvQuantityMagnetic = 14,
williamr@2
   174
    /** Channel measures degrees */
williamr@2
   175
    ESensrvQuantityAngle = 15,
williamr@2
   176
    /** Channel measures phone proximity events*/
williamr@2
   177
    ESensrvQuantityProximity = 16,
williamr@2
   178
    /** Start of licensee quantity range definitions */
williamr@2
   179
    ESensrvQuantityLicenseeBase = 8192,
williamr@2
   180
    /** End of licensee quantity range definitions */
williamr@2
   181
    ESensrvQuantityLicenseeEnd = 12287
williamr@2
   182
    };
williamr@2
   183
williamr@2
   184
/**
williamr@2
   185
* The context type of a sensor.
williamr@2
   186
* Licensee defined values must be between ESensrvContextTypeLicenseeBase and
williamr@2
   187
* ESensrvContextTypeLicenseeEnd
williamr@2
   188
*
williamr@2
   189
* @see TSensrvChannelInfo
williamr@2
   190
*/
williamr@2
   191
enum TSensrvContextType
williamr@2
   192
    {
williamr@2
   193
    /** Channel doesn't provide sensor context type information */
williamr@2
   194
    ESensrvContextTypeNotUsed = -1,
williamr@2
   195
    /** Context type is not defined */
williamr@2
   196
    ESensrvContextTypeNotDefined = 0,
williamr@2
   197
    /**
williamr@2
   198
    * Sensor is measuring a physical quantity of the phones environment e.g. pressure, temperature,
williamr@2
   199
    * sound intensity, humidity
williamr@2
   200
    */
williamr@2
   201
    ESensrvContextTypeAmbient = 1,
williamr@2
   202
    /**
williamr@2
   203
    * Sensor is measuring a physical quantity that the phone itself is undergoing e.g. acceleration,
williamr@2
   204
    * rotation, orientation
williamr@2
   205
    */
williamr@2
   206
    ESensrvContextTypeDevice = 2,
williamr@2
   207
    /**
williamr@2
   208
    * Sensor is measuring a physical quantity that is user stimulated e.g. body temperature, body mass,
williamr@2
   209
    * heart rate
williamr@2
   210
    */
williamr@2
   211
    ESensrvContextTypeUser = 3,
williamr@2
   212
    /** Start of licensee context range definitions */
williamr@2
   213
    ESensrvContextTypeLicenseeBase = 8192,
williamr@2
   214
    /** End of licensee context range definitions */
williamr@2
   215
    ESensrvContextTypeLicenseeEnd = 12287
williamr@2
   216
    };
williamr@2
   217
williamr@2
   218
/**
williamr@2
   219
* The connection type of a sensor.
williamr@2
   220
* Licensee defined values must be between ESensrvConnectionTypeLicenseeBase and
williamr@2
   221
* ESensrvConnectionTypeLicenseeEnd
williamr@2
   222
*
williamr@2
   223
* @see KSensrvSensorConnectionType
williamr@2
   224
*/
williamr@2
   225
enum TSensrvConnectionType
williamr@2
   226
    {
williamr@2
   227
    /** Connection type is not defined */
williamr@2
   228
    ESensrvConnectionTypeNotDefined = 0,
williamr@2
   229
    /** Sensor is embedded in the phone */
williamr@2
   230
    ESensrvConnectionTypeEmbedded,
williamr@2
   231
    /** Sensor is attached to phone by wire */
williamr@2
   232
    ESensrvConnectionTypeWired,
williamr@2
   233
    /** Sensor is attached to phone wirelessly */
williamr@2
   234
    ESensrvConnectionTypeWireless,
williamr@2
   235
    /** Start of licensee Connection type range definitions */
williamr@2
   236
    ESensrvConnectionTypeLicenseeBase = 8192,
williamr@2
   237
    /** End of licensee Connection type range definitions */
williamr@2
   238
    ESensrvConnectionTypeLicenseeEnd = 12287
williamr@2
   239
    };
williamr@2
   240
williamr@2
   241
/**
williamr@2
   242
* The unit of the data measured by the sensor channel
williamr@2
   243
* Licensee defined values must be between ESensrvChannelUnitLicenseeBase and
williamr@2
   244
* ESensrvChannelUnitLicenseeEnd
williamr@2
   245
*
williamr@2
   246
* @see KSensrvPropIdChannelUnit
williamr@2
   247
*/
williamr@2
   248
enum TSensrvChannelUnit
williamr@2
   249
    {
williamr@2
   250
    /** Channel Unit is not defined */
williamr@2
   251
    ESensrvChannelUnitNotDefined = 0,
williamr@2
   252
    /** Acceleration, meter per square second (m/s^2) */
williamr@2
   253
    ESensevChannelUnitAcceleration = 10,
williamr@2
   254
    /** Acceleration, gravitational constant (G) */
williamr@2
   255
    ESensrvChannelUnitGravityConstant = 11,
williamr@2
   256
    /** ESensrvChannelUnitMagneticFluxDensity, magnetic field density, Tesla (T) */
williamr@2
   257
    ESensrvChannelUnitMagneticFluxDensity = 12,
williamr@2
   258
    /** Start of licensee Channel Unit range definitions */
williamr@2
   259
    ESensrvChannelUnitLicenseeBase = 8192,
williamr@2
   260
    /** End of licensee Channel Unit range definitions */
williamr@2
   261
    ESensrvChannelUnitLicenseeEnd = 12287
williamr@2
   262
    };
williamr@2
   263
williamr@2
   264
/**
williamr@2
   265
* The format of the data measured by the sensor channel
williamr@2
   266
* Licensee defined values must be between ESensrvChannelDataFormatLicenseeBase and
williamr@2
   267
* ESensrvChannelDataFormatLicenseeEnd
williamr@2
   268
*
williamr@2
   269
* @code
williamr@2
   270
* Scaled format example:
williamr@2
   271
* Measure range for the accelerometer, KSensrvPropIdMeasureRange: -2g to 2g.
williamr@2
   272
* KSensrvPropIdScaledRange defines following values:
williamr@2
   273
* Range: Min: -127  Max: 127
williamr@2
   274
*
williamr@2
   275
* Example values for the data item and their absolute values:
williamr@2
   276
* Data item: -64 = > -64/127 * 2g = -1.01g
williamr@2
   277
* Data item:  32 = > 32/127 * 2g = 0.51g
williamr@2
   278
* Data item: 127 = > 127/127 * 2g = 2g
williamr@2
   279
* @endcode
williamr@2
   280
*
williamr@2
   281
* @see KSensrvPropIdChannelDataFormat
williamr@2
   282
*/
williamr@2
   283
enum TSensrvChannelDataFormat
williamr@2
   284
    {
williamr@2
   285
    /** Data Fomat is not defined */
williamr@2
   286
    ESensrvChannelDataFormatNotDefined = 0,
williamr@2
   287
    /** Value of the data item represents actual value of the measured quantity */
williamr@2
   288
    ESensrvChannelDataFormatAbsolute,
williamr@2
   289
    /**
williamr@2
   290
    * Value of the data item represents a relative value which is scaled between the maximum
williamr@2
   291
    * and minimum values of the measured quantity
williamr@2
   292
    */
williamr@2
   293
    ESensrvChannelDataFormatScaled,
williamr@2
   294
    /** Start of licensee Data Format range definitions */
williamr@2
   295
    ESensrvChannelDataFormatLicenseeBase = 8192,
williamr@2
   296
    /** End of licensee Data Format range definitions */
williamr@2
   297
    ESensrvChannelDataFormatLicenseeEnd = 12287
williamr@2
   298
    };
williamr@2
   299
williamr@2
   300
/**
williamr@2
   301
* The error code received by a sensor server listener
williamr@2
   302
*
williamr@2
   303
* @see MSensrvChannelConditionListener
williamr@2
   304
* @see MSensrvChannelListener
williamr@2
   305
* @see MSensrvDataListener
williamr@2
   306
* @see MSensrvPropertyListener
williamr@2
   307
*/
williamr@2
   308
enum TSensrvErrorSeverity
williamr@2
   309
    {
williamr@2
   310
    /** Error Severity is not defined */
williamr@2
   311
    ESensrvErrorSeverityNotDefined = 0,
williamr@2
   312
    /** The channel has a temporary failure but listening has been successfully continued */
williamr@2
   313
    ESensrvErrorSeverityMinor,
williamr@2
   314
    /** The channel has a fatal error and the channel was closed  */
williamr@2
   315
    ESensrvErrorSeverityFatal
williamr@2
   316
    };
williamr@2
   317
williamr@2
   318
/**
williamr@2
   319
* The channel change is detected by the Channel Listener
williamr@2
   320
*
williamr@2
   321
* @see MSensrvChannelListener
williamr@2
   322
*/
williamr@2
   323
enum TSensrvChannelChangeType
williamr@2
   324
    {
williamr@2
   325
    /** Channel Change not defined */
williamr@2
   326
    ESensrvChannelChangeTypeNotDefined = 0,
williamr@2
   327
    /** Channel was removed */
williamr@2
   328
    ESensrvChannelChangeTypeRemoved,
williamr@2
   329
    /** Channel was added */
williamr@2
   330
    ESensrvChannelChangeTypeAdded
williamr@2
   331
    };
williamr@2
   332
williamr@2
   333
/**
williamr@2
   334
* The TSensrvPower represents sensor power state
williamr@2
   335
*
williamr@2
   336
* Possible values:
williamr@2
   337
* - ESensrvPowerPowerDown, sensor is currently powered down
williamr@2
   338
* - ESensrvPowerPowerUp, sensor currently powered up
williamr@2
   339
*/
williamr@2
   340
enum TSensrvPower
williamr@2
   341
	{
williamr@2
   342
	/** Sensor is powered down */
williamr@2
   343
	ESensrvPowerPowerDown = 0,
williamr@2
   344
	/** Sensor is powered up */
williamr@2
   345
	ESensrvPowerPowerUp
williamr@2
   346
	};
williamr@2
   347
williamr@2
   348
/**
williamr@2
   349
* The TSensrvAvailability represents sensor channel availability
williamr@2
   350
*
williamr@2
   351
* Possible values:
williamr@2
   352
* - ESensrvAvailabilityFalse, the channel is not available, which is caused by
williamr@2
   353
*   either sensor being powered down, or a dependency with another channel
williamr@2
   354
*   prevents the channel for being available
williamr@2
   355
* - ESensrvAvailabilityTrue, the channel is available
williamr@2
   356
*/
williamr@2
   357
enum TSensrvAvailability
williamr@2
   358
	{
williamr@2
   359
    /** Channel not available */
williamr@2
   360
	ESensrvAvailabilityFalse = 0,
williamr@2
   361
	/** Channel available */
williamr@2
   362
	ESensrvAvailabilityTrue
williamr@2
   363
	};
williamr@2
   364
williamr@2
   365
williamr@2
   366
#endif //SENSRVTYPES_H
williamr@2
   367
williamr@2
   368
// End of File