Sensor Channel Declaration

This document provides details about the sensor channel declarations.

Channel property declarations

Channel properties are declared in sensrvgeneralproperties.h and sensor specific files. For example, general properties for all channel types are declared in the sensrvgeneralproperties.h file and accelerometer specific properties are declared in the sensrvaccelerometersensor.h file.

Each channel property is defined by its unique property ID constant and a short description. The property type specifies the type of the value the property contains. It can be TInt, TReal or TBuf. Property scope can be defined for a:

  • channel
  • specific attribute inside channel data
  • sensor related to a channel.

For example, accuracy property is declared as shown in the following code snippet:

    /**
    * - Name:         Accuracy of the channel data
    * - Type:         TReal
    * - Scope:        Channel item property
    * - Mandatory:    No
    * - Capability:   None
    * - Description:  Returns the accuracy of this channel of the sensor as a
    *                 percentage of reading (=data value).
    */
    const TSensrvPropertyId KSensrvPropIdChannelAccuracy = 0x000000008;

A mandatory section specifies if the property is required for all channels. Capability section specifies the required capabilities to change value of the property.

The example content of the accuracy property is shown in the following code snippet.

    iPropertyId   = KSensrvPropIdChannelAccuracy
    iItemIndex    = KSensrvItemIndexNone
    iArrayIndex   = ESensrvSingleProperty
    iRealValue    = 10.0
    iReadOnly     = ETrue
    iRealValueMax = n/a
    iRealValueMin = n/a
    iPropertyType = ESensrvRealProperty
    iSecurityInfo = n/a

The array index is explained in Array Properties.