diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-8DCBAA05-9741-48C8-A831-966D37FBC05A.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-8DCBAA05-9741-48C8-A831-966D37FBC05A.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,52 @@ + + + + + +Array +PropertiesA property that defines multiple discrete values inside one property +ID is called an array property. +

Array properties +can be identified with array index, which can be queried using the TSensrvProperty::GetArrayIndex() function.

+
+

The following example shows how to retrieve the current data rate +of the channel, for which the data rate is declared as an array property.

Read +the KSensrvPropIdDataRate property using the CSensrvChannel::GetPropertyL() function.

If +the retrieved property is an array property the result of the CSensrvChannel::GetPropertyL() call +is a property with array index ESensrvArrayPropertyInfo, + otherwise the array information index is ESensrvSingleProperty.

In +case of an array property, the value of the current data rate is in the KSensrvPropIdDataRate property, +for which the array index is the same as the array property's value.

TSensrvProperty property; + TInt err( KErrNone ); + TInt datarate( 0 ); + + iSensorChannel->GetPropertyL( KSensrvPropIdDataRate, + KSensrvItemIndexNone, + property ); + + if( ESensrvArrayPropertyInfo == property.GetArrayIndex() ) + { + //Current data rate in use is in the KSensrvPropIdDataRate property + //for which the array index is declared in the array property's value. + TInt arrayIndex( 0 ); + property.GetValue( arrayIndex ); + + iSensorChannel->GetPropertyL( KSensrvPropIdDataRate, + KSensrvItemIndexNone, + arrayIndex, + property ); + + property.GetValue( datarate ); + } + else + { + //KSensrvPropIdDataRate is a single property and current data rate can be read diretly from it. + property.GetValue( datarate ); + }
+
\ No newline at end of file