sensorservices/orientationssy/inc/SsyConfiguration.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2007,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 "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:  Configurations of Orientation SSY
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SSYCONFIGURATION_H__
       
    20 #define __SSYCONFIGURATION_H__
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <sensrvgeneralproperties.h>
       
    25 #include <sensrvaccelerometersensor.h>
       
    26 #include <sensrvorientationsensor.h>
       
    27 
       
    28 // CONSTANTS
       
    29 _LIT8(KNoManufacturerDefined, "Nokia"); // maxLength is 16
       
    30 _LIT8(KLocationNormal, "NoLoc");                // maxLength is 16
       
    31 _LIT8(KLocationCover, "Cover");                  // maxLength is 16
       
    32 
       
    33 const TInt  KRotationResolutionInDegrees = 15;
       
    34 const TInt  KMinAngle = 0;
       
    35 const TInt  KMaxAngle = 359;
       
    36 const TReal KRotationAccuracy = (TReal)KRotationResolutionInDegrees / (TReal)(KMaxAngle + 1);
       
    37 
       
    38 const TInt  KNoIntegerValue = 0;
       
    39 const TReal KNoRealValue = 0;
       
    40 
       
    41 /**
       
    42  * SSsyChannelInfo.
       
    43  * Channelinfo structure.
       
    44  */
       
    45 class TSSsyChannelInfo
       
    46     {
       
    47     public:
       
    48     TSensrvChannelId iChannelId;            // Channel id of the channel
       
    49     TSensrvContextType iContextType;        // Context type of the channel    
       
    50     TSensrvQuantity iQuantity;              // Quantity of the channel
       
    51     TSensrvChannelTypeId iChannelType;      // Channel type Id of the channel
       
    52     TPtrC8 iLocation;                       // Location of the sensor related to channel
       
    53     TPtrC8 iVendorId;                       // Vendor Id of the sensor related to channel
       
    54     TInt iDataItemSize;                     // Data item size delivered in the channel
       
    55     TSensrvChannelDataTypeId iDataTypeId;   // Data type Id
       
    56     };
       
    57 
       
    58 /**
       
    59  * SSyChannelProperties.
       
    60  * Channelproperties structure.  
       
    61  */
       
    62 class TSSyChannelProperties
       
    63     {
       
    64     public:
       
    65     TSensrvPropertyId iPropertyId;
       
    66     TInt iItemIndex;    
       
    67 
       
    68     TInt iIntValue;
       
    69     TReal iRealValue;            
       
    70 
       
    71     TPtrC8 iBufValue;    
       
    72 
       
    73     TInt iIntMaxValue;
       
    74     TReal iRealMaxValue;            
       
    75 
       
    76     TInt iIntMinValue;        
       
    77     TReal iRealMinValue;
       
    78    
       
    79     TBool iReadOnly;
       
    80     TSensrvPropertyType iPropertyType;    
       
    81     };
       
    82 
       
    83 /**
       
    84  * KSSsyChannelInfo.
       
    85  * Channelinfo table.  
       
    86  */
       
    87 const TSSsyChannelInfo KSSsyChannelInfo[] =
       
    88     {
       
    89         {       
       
    90             0,                                   // iChannelId
       
    91             ESensrvContextTypeUser,                  // iContextType
       
    92             ESensrvQuantityOrientation,          // iQuantity orientation
       
    93             KSensrvChannelTypeIdOrientationData, // iChannelType
       
    94             TPtrC8(KLocationNormal),             // iLocation
       
    95             TPtrC8(KNoManufacturerDefined),      // iVendorId
       
    96             sizeof(TSensrvOrientationData),      // iDataItemSize
       
    97             TSensrvOrientationData::KDataTypeId  // iDataTypeId
       
    98         },
       
    99 
       
   100         {       
       
   101             0,                                   // iChannelId
       
   102             ESensrvContextTypeUser,                  // iContextType
       
   103             ESensrvQuantityRotation,             // iQuantity rotation
       
   104             KSensrvChannelTypeIdRotationData,    // iChannelType
       
   105             TPtrC8(KLocationNormal),             // iLocation
       
   106             TPtrC8(KNoManufacturerDefined),      // iVendorId
       
   107             sizeof(TSensrvRotationData),         // iDataItemSize
       
   108             TSensrvRotationData::KDataTypeId     // iDataTypeId
       
   109         },
       
   110 
       
   111     };
       
   112 
       
   113 /**
       
   114  * KSSySensorProperties.
       
   115  * Channelproperties table.  
       
   116  */
       
   117 const TSSyChannelProperties KSSySensorProperties[] =
       
   118     {        
       
   119 
       
   120         {
       
   121             KSensrvPropIdAvailability,          // iPropertyId
       
   122             -1,                                 // iItemIndex
       
   123             ETrue,                              // iValue
       
   124             KNoRealValue,
       
   125             TPtrC8(KNullDesC8),                 // iBufValue
       
   126             ETrue,                              // iMaxValue
       
   127             KNoRealValue,
       
   128             EFalse,                             // iMinValue
       
   129             KNoRealValue,
       
   130             ETrue,                              // iReadOnly
       
   131             ESensrvIntProperty                  // iPropertyType
       
   132         },
       
   133 
       
   134         {
       
   135             KSensrvPropIdDataRate,              // iPropertyId
       
   136             -1,                                 // iItemIndex
       
   137             0,                                  // iValue
       
   138             KNoRealValue,
       
   139             TPtrC8(KNullDesC8),                 // iBufValue
       
   140             0,                                  // iMaxValue
       
   141             KNoRealValue,
       
   142             0,                                  // iMinValue
       
   143             KNoRealValue,
       
   144             EFalse,                             // iReadOnly. Default value is not readonly, it is set
       
   145                                                 // to read only when updated.
       
   146             ESensrvIntProperty                  // iPropertyType
       
   147         },
       
   148 
       
   149         {
       
   150             KSensrvPropIdChannelDataCompensation,              // iPropertyId
       
   151             -1,                                 // iItemIndex
       
   152             0,                                  // iValue
       
   153             KNoRealValue,
       
   154             TPtrC8(KNullDesC8),                 // iBufValue
       
   155             2,                                  // iMaxValue
       
   156             KNoRealValue,
       
   157             0,                                  // iMinValue
       
   158             KNoRealValue,
       
   159             ETrue,                             // iReadOnly. Default value is not readonly, it is set
       
   160                                                 // to read only when updated.
       
   161             ESensrvIntProperty                  // iPropertyType
       
   162         }
       
   163     };
       
   164 
       
   165 /**
       
   166  * KSSyChannelOrientationProperties.
       
   167  * Orientation channel properties table.
       
   168  */
       
   169 const TSSyChannelProperties KSSyChannelOrientationProperties[] =
       
   170     {
       
   171 
       
   172         {
       
   173             KSensrvPropIdMeasureRange,          // iPropertyId
       
   174             -1,                                 // iItemIndex
       
   175             TSensrvOrientationData::EOrientationUndefined,
       
   176             KNoRealValue,                       // iValue
       
   177             TPtrC8(KNullDesC8),                 // iBufValue
       
   178             TSensrvOrientationData::EOrientationDisplayDownwards,
       
   179             KNoRealValue,                   // iMaxValue
       
   180             TSensrvOrientationData::EOrientationUndefined,
       
   181             KNoRealValue,                   // iMinValue
       
   182             ETrue,                              // iReadOnly
       
   183             ESensrvIntProperty                  // iPropertyType
       
   184         },
       
   185     };
       
   186 
       
   187 /**
       
   188  * KSSyChannelRotationProperties.
       
   189  * Rotation channel properties table.
       
   190  */
       
   191 const TSSyChannelProperties KSSyChannelRotationProperties[] =
       
   192     {
       
   193 
       
   194         {
       
   195             KSensrvPropIdMeasureRange,          // iPropertyId
       
   196             -1,                                 // iItemIndex
       
   197             KNoIntegerValue,
       
   198             (TReal)KMaxAngle,                   // iValue
       
   199             TPtrC8(KNullDesC8),                 // iBufValue
       
   200             KNoIntegerValue,
       
   201             (TReal)KMaxAngle,                   // iMaxValue
       
   202             KNoIntegerValue,
       
   203             (TReal)KMinAngle,                   // iMinValue
       
   204             ETrue,                              // iReadOnly
       
   205             ESensrvRealProperty                 // iPropertyType
       
   206         },
       
   207 
       
   208         {
       
   209             KSensrvPropIdChannelAccuracy,       // iPropertyId
       
   210             -1,                                 // iItemIndex
       
   211             KNoIntegerValue,
       
   212             KRotationAccuracy,                  // iValue
       
   213             TPtrC8(KNullDesC8),                 // iBufValue
       
   214             KNoIntegerValue,
       
   215             KRotationAccuracy,                  // iMaxValue
       
   216             KNoIntegerValue,
       
   217             KRotationAccuracy,                  // iMinValue
       
   218             ETrue,                              // iReadOnly
       
   219             ESensrvRealProperty                 // iPropertyType
       
   220         },
       
   221         
       
   222     };
       
   223 
       
   224 // MACROS
       
   225 
       
   226 #define ARRAY_LENGTH(array) (sizeof( array ) / sizeof( array[ 0 ] ))
       
   227 
       
   228 
       
   229 
       
   230 #endif // __SSYCONFIGURATION_H__
       
   231 
       
   232 // End of File