sensorservices/tiltcompensationssy/inc/configuration.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2007 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Common definitions.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CONFIGURATION_H
       
    20 #define CONFIGURATION_H
       
    21 
       
    22 #include <sensrvmagneticnorthsensor.h>
       
    23 #include <sensrvmagnetometersensor.h>
       
    24 #include <sensrvtypes.h>
       
    25 #include <sensrvgeneralproperties.h>
       
    26 
       
    27 #include "common.h"
       
    28 
       
    29 // DATA TYPES
       
    30 
       
    31 /** Channel info structure */
       
    32 struct TChannelInfo
       
    33     {
       
    34     // Channel id of the channel
       
    35     TSensrvChannelId iChannelId;
       
    36     
       
    37     // Context type of the channel
       
    38     TSensrvContextType iContextType;
       
    39     
       
    40     // Quantity of the channel
       
    41     TSensrvQuantity iQuantity;
       
    42     
       
    43     // Channel type Id of the channel
       
    44     TSensrvChannelTypeId iChannelType;
       
    45     
       
    46     // Location of the sensor related to channel
       
    47     const TText8* const iLocation;
       
    48     
       
    49     // Vendor Id of the sensor related to channel
       
    50     const TText8* const iVendorId;
       
    51     
       
    52     // Data item size delivered in the channel
       
    53     TInt iDataItemSize;
       
    54     
       
    55     // Data type Id
       
    56     TSensrvChannelDataTypeId iDataTypeId;
       
    57     };
       
    58 
       
    59 /** Channel properties structure */
       
    60 struct TChannelProperties
       
    61     {
       
    62     // Property ID
       
    63     TSensrvPropertyId iPropertyId;
       
    64     
       
    65     // Item index
       
    66     TInt iItemIndex;
       
    67     
       
    68     // Property int value
       
    69     TInt iIntValue;
       
    70     
       
    71     // Property double value
       
    72     TReal iRealValue;
       
    73     
       
    74     // Property buffer value
       
    75     const TText8* const iBufValue;
       
    76     
       
    77     // Property max int value
       
    78     TInt iIntMaxValue;
       
    79     
       
    80     // Property max double value
       
    81     TReal iRealMaxValue;
       
    82     
       
    83     // Property min int value
       
    84     TInt iIntMinValue;
       
    85     
       
    86     // Property min double value
       
    87     TReal iRealMinValue;
       
    88     
       
    89     // Is propery read only
       
    90     TBool iReadOnly;
       
    91     
       
    92     // Property type
       
    93     TSensrvPropertyType iPropertyType;
       
    94     };
       
    95 
       
    96 // CONSTANTS
       
    97 
       
    98 /** Dummy location */
       
    99 #define NO_LOCATION _S8( "NoLoc" )
       
   100 
       
   101 /** Dummy vendor ID */
       
   102 #define VENDOR_NOKIA _S8( "Nokia" )
       
   103 
       
   104 /** Empty string */
       
   105 #define NO_BUF_VALUE _S8( "" )
       
   106 
       
   107 /** Real value not supported */
       
   108 #define NO_REAL_VALUE (TReal)0
       
   109     
       
   110 /** Supported channels */
       
   111 enum
       
   112     {
       
   113     EChannelTilt,
       
   114     EChannelLast
       
   115     };
       
   116     
       
   117 /** Channel list */
       
   118 const TChannelInfo KTiltSsyChannels[EChannelLast] =
       
   119     {
       
   120         // Tilt angle channel
       
   121         {
       
   122         0,                                   // iChannelId
       
   123         ESensrvContextTypeAmbient,               // iContextType
       
   124         ESensrvQuantityAngle,               // iQuantity
       
   125         KSensrvChannelTypeIdMagneticNorthData,        // iChannelType
       
   126         NO_LOCATION,                         // iLocation
       
   127         VENDOR_NOKIA,                           // iVendorId
       
   128         sizeof( TSensrvMagneticNorthData ),           // iDataItemSize
       
   129         TSensrvMagneticNorthData::KDataTypeId         // iDataTypeId
       
   130         }
       
   131     };
       
   132     
       
   133 /** Tilt channel properties */
       
   134 enum
       
   135     {
       
   136     EChannelPropertyTiltAvailability,
       
   137     EChannelPropertyTiltDataRate,
       
   138     EChannelPropertyTiltMeasureRange,
       
   139     EChannelPropertyTiltCalibrationLevel,
       
   140     EChannelPropertyTiltDataCompensation,
       
   141     EChannelPropertyTiltLast
       
   142     };
       
   143     
       
   144 /** Tilt angle channel properties list */
       
   145 const TChannelProperties KTiltSsyChannelProperties[EChannelPropertyTiltLast] =
       
   146     {
       
   147         // KSensrvPropIdAvailability
       
   148         {
       
   149         KSensrvPropIdAvailability,      // iPropertyId
       
   150         0,                              // iItemIndex
       
   151         ETrue,                          // iIntValue
       
   152         NO_REAL_VALUE,
       
   153         NO_BUF_VALUE,                   // iBufValue
       
   154         ETrue,                          // iIntMaxValue
       
   155         NO_REAL_VALUE,
       
   156         EFalse,                         // iIntMinValue
       
   157         NO_REAL_VALUE,
       
   158         ETrue,                          // iReadOnly
       
   159         ESensrvIntProperty              // iPropertyType
       
   160         },
       
   161         
       
   162         // KSensrvPropIdDataRate
       
   163         {
       
   164         KSensrvPropIdDataRate,          // iPropertyId
       
   165         0,                              // iItemIndex
       
   166         10,                             // iIntValue
       
   167         NO_REAL_VALUE,
       
   168         NO_BUF_VALUE,                   // iBufValue
       
   169         10,                             // iIntMaxValue
       
   170         NO_REAL_VALUE,
       
   171         1,                              // iIntMinValue
       
   172         NO_REAL_VALUE,
       
   173         EFalse,                         // iReadOnly
       
   174         ESensrvIntProperty              // iPropertyType
       
   175         },
       
   176         
       
   177         // KSensrvPropIdMeasureRange
       
   178         {
       
   179         KSensrvPropIdMeasureRange,      // iPropertyId
       
   180         0,                              // iItemIndex
       
   181         0,                              // iIntValue
       
   182         NO_REAL_VALUE,
       
   183         NO_BUF_VALUE,                   // iBufValue
       
   184         359,                            // iIntMaxValue
       
   185         NO_REAL_VALUE,
       
   186         0,                              // iIntMinValue
       
   187         NO_REAL_VALUE,
       
   188         ETrue,                          // iReadOnly
       
   189         ESensrvIntProperty              // iPropertyType
       
   190         },
       
   191         
       
   192         // KSensrvPropCalibrationLevel
       
   193         {
       
   194         KSensrvPropCalibrationLevel,    // iPropertyId
       
   195         0,                              // iItemIndex
       
   196         0,                              // iIntValue
       
   197         NO_REAL_VALUE,
       
   198         NO_BUF_VALUE,                   // iBufValue
       
   199         3,                              // iIntMaxValue
       
   200         NO_REAL_VALUE,
       
   201         0,                              // iIntMinValue
       
   202         NO_REAL_VALUE,
       
   203         ETrue,                          // iReadOnly
       
   204         ESensrvIntProperty              // iPropertyType
       
   205         },
       
   206         
       
   207         // KSensrvPropIdChannelDataCompensation
       
   208         {
       
   209         KSensrvPropIdChannelDataCompensation,    // iPropertyId
       
   210         0,                              // iItemIndex
       
   211         2,                              // iIntValue
       
   212         NO_REAL_VALUE,
       
   213         NO_BUF_VALUE,                   // iBufValue
       
   214         2,                              // iIntMaxValue
       
   215         NO_REAL_VALUE,
       
   216         0,                              // iIntMinValue
       
   217         NO_REAL_VALUE,
       
   218         ETrue,                          // iReadOnly
       
   219         ESensrvIntProperty              // iPropertyType
       
   220         }
       
   221     };
       
   222 
       
   223 #endif // CONFIGURATION_H
       
   224 
       
   225 // End of File