epoc32/include/sensrvtypes.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * 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
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Type definitions file for Sensor Server
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef SENSRVTYPES_H
    21 #define SENSRVTYPES_H
    22 
    23 #include <e32base.h>
    24 #include <sensrvproperty.h>
    25 
    26 // Forward declare channel info
    27 class TSensrvChannelInfo;
    28 
    29 /**
    30 * Max length of the vendor Id
    31 *
    32 * @see TSensrvChannelInfo
    33 */
    34 const TInt KSensrvVendorIdLength = 16;
    35 
    36 /**
    37 * Max length of the location string
    38 *
    39 * @see TSensrvChannelInfo
    40 */
    41 const TInt KSensrvLocationLength = 16;
    42 
    43 /**
    44 * Item index for properties that are not data item specific
    45 *
    46 * @see TSensrvProperty
    47 */
    48 const TInt KSensrvItemIndexNone = -1;
    49 
    50 // DATA TYPES
    51 
    52 /**
    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.
    56 *
    57 * @see TSensrvChannelInfo
    58 * @see CSsyControl
    59 * @see MSsyCallback
    60 * @see MSsyChannelDataProvider
    61 * @see MSsyPropertyProvider
    62 */
    63 typedef TUint32 TSensrvChannelId;
    64 
    65 /**
    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.
    70 *
    71 * @see TSensrvChannelInfo
    72 */
    73 typedef TUint32 TSensrvChannelTypeId;
    74 
    75 /**
    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
    78 * files.
    79 *
    80 * @see TSensrvChannelInfo
    81 */
    82 typedef TUint32 TSensrvChannelDataTypeId;
    83 
    84 
    85 /**
    86 * Undefined Channel id for use when finding channels
    87 *
    88 * @see CSensrvChannelFinder
    89 */
    90 const TSensrvChannelTypeId KSensrvChannelTypeIdUndefined = 0x00000000;
    91 
    92 /**
    93 * RArray based channel Id list
    94 *
    95 * @see MSsyCallback
    96 * @see MSsyPropertyProvider
    97 */
    98 typedef RArray<TSensrvChannelId> RSensrvChannelList;
    99 
   100 /**
   101 * RArray based property list
   102 *
   103 * @see CSensrvChannel
   104 * @see MSsyPropertyProvider
   105 */
   106 typedef RArray<TSensrvProperty> RSensrvPropertyList;
   107 
   108 /**
   109 * RArray based channel info list
   110 *
   111 * @see CSensrvChannelFinder
   112 * @see MSsyCallback
   113 */
   114 typedef RArray<TSensrvChannelInfo> RSensrvChannelInfoList;
   115 
   116 /**
   117 * Indication of whether a call to CSensrvChannel::SetPropertyL() is likely to succeed
   118 *
   119 * @see CSensrvChannel
   120 * @see MSensrvPropertyListener
   121 */
   122 enum TSetPropertySuccessIndicator
   123     {
   124     ESetPropertyIndicationUnknown = 0,
   125     /**
   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
   128     */
   129     ESetPropertyIndicationAvailable,
   130     /**
   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
   134     * basis.
   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
   141     */
   142     ESetPropertyIndicationPossible,
   143     /**
   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.
   147     */
   148     ESetPropertyIndicationUnavailable
   149     };
   150 
   151 /**
   152 * The quantity of channel values. Defines the quantity the channel is measuring.
   153 * Licensee defined values must be between ESensrvQuantityLicenseeBase and
   154 * ESensrvQuantityLicenseeEnd
   155 *
   156 * @see TSensrvChannelInfo
   157 */
   158 enum TSensrvQuantity
   159     {
   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
   182     };
   183 
   184 /**
   185 * The context type of a sensor.
   186 * Licensee defined values must be between ESensrvContextTypeLicenseeBase and
   187 * ESensrvContextTypeLicenseeEnd
   188 *
   189 * @see TSensrvChannelInfo
   190 */
   191 enum TSensrvContextType
   192     {
   193     /** Channel doesn't provide sensor context type information */
   194     ESensrvContextTypeNotUsed = -1,
   195     /** Context type is not defined */
   196     ESensrvContextTypeNotDefined = 0,
   197     /**
   198     * Sensor is measuring a physical quantity of the phones environment e.g. pressure, temperature,
   199     * sound intensity, humidity
   200     */
   201     ESensrvContextTypeAmbient = 1,
   202     /**
   203     * Sensor is measuring a physical quantity that the phone itself is undergoing e.g. acceleration,
   204     * rotation, orientation
   205     */
   206     ESensrvContextTypeDevice = 2,
   207     /**
   208     * Sensor is measuring a physical quantity that is user stimulated e.g. body temperature, body mass,
   209     * heart rate
   210     */
   211     ESensrvContextTypeUser = 3,
   212     /** Start of licensee context range definitions */
   213     ESensrvContextTypeLicenseeBase = 8192,
   214     /** End of licensee context range definitions */
   215     ESensrvContextTypeLicenseeEnd = 12287
   216     };
   217 
   218 /**
   219 * The connection type of a sensor.
   220 * Licensee defined values must be between ESensrvConnectionTypeLicenseeBase and
   221 * ESensrvConnectionTypeLicenseeEnd
   222 *
   223 * @see KSensrvSensorConnectionType
   224 */
   225 enum TSensrvConnectionType
   226     {
   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
   239     };
   240 
   241 /**
   242 * The unit of the data measured by the sensor channel
   243 * Licensee defined values must be between ESensrvChannelUnitLicenseeBase and
   244 * ESensrvChannelUnitLicenseeEnd
   245 *
   246 * @see KSensrvPropIdChannelUnit
   247 */
   248 enum TSensrvChannelUnit
   249     {
   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
   262     };
   263 
   264 /**
   265 * The format of the data measured by the sensor channel
   266 * Licensee defined values must be between ESensrvChannelDataFormatLicenseeBase and
   267 * ESensrvChannelDataFormatLicenseeEnd
   268 *
   269 * @code
   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
   274 *
   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
   279 * @endcode
   280 *
   281 * @see KSensrvPropIdChannelDataFormat
   282 */
   283 enum TSensrvChannelDataFormat
   284     {
   285     /** Data Fomat is not defined */
   286     ESensrvChannelDataFormatNotDefined = 0,
   287     /** Value of the data item represents actual value of the measured quantity */
   288     ESensrvChannelDataFormatAbsolute,
   289     /**
   290     * Value of the data item represents a relative value which is scaled between the maximum
   291     * and minimum values of the measured quantity
   292     */
   293     ESensrvChannelDataFormatScaled,
   294     /** Start of licensee Data Format range definitions */
   295     ESensrvChannelDataFormatLicenseeBase = 8192,
   296     /** End of licensee Data Format range definitions */
   297     ESensrvChannelDataFormatLicenseeEnd = 12287
   298     };
   299 
   300 /**
   301 * The error code received by a sensor server listener
   302 *
   303 * @see MSensrvChannelConditionListener
   304 * @see MSensrvChannelListener
   305 * @see MSensrvDataListener
   306 * @see MSensrvPropertyListener
   307 */
   308 enum TSensrvErrorSeverity
   309     {
   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
   316     };
   317 
   318 /**
   319 * The channel change is detected by the Channel Listener
   320 *
   321 * @see MSensrvChannelListener
   322 */
   323 enum TSensrvChannelChangeType
   324     {
   325     /** Channel Change not defined */
   326     ESensrvChannelChangeTypeNotDefined = 0,
   327     /** Channel was removed */
   328     ESensrvChannelChangeTypeRemoved,
   329     /** Channel was added */
   330     ESensrvChannelChangeTypeAdded
   331     };
   332 
   333 /**
   334 * The TSensrvPower represents sensor power state
   335 *
   336 * Possible values:
   337 * - ESensrvPowerPowerDown, sensor is currently powered down
   338 * - ESensrvPowerPowerUp, sensor currently powered up
   339 */
   340 enum TSensrvPower
   341 	{
   342 	/** Sensor is powered down */
   343 	ESensrvPowerPowerDown = 0,
   344 	/** Sensor is powered up */
   345 	ESensrvPowerPowerUp
   346 	};
   347 
   348 /**
   349 * The TSensrvAvailability represents sensor channel availability
   350 *
   351 * Possible values:
   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
   356 */
   357 enum TSensrvAvailability
   358 	{
   359     /** Channel not available */
   360 	ESensrvAvailabilityFalse = 0,
   361 	/** Channel available */
   362 	ESensrvAvailabilityTrue
   363 	};
   364 
   365 
   366 #endif //SENSRVTYPES_H
   367 
   368 // End of File