diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-44FDDA27-1A5D-42B5-8DE0-D9E88EB75C93.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-44FDDA27-1A5D-42B5-8DE0-D9E88EB75C93.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,74 @@ + + + + + +Querying +for Sensor ChannelsYou can retrieve a list of sensor channels that are available for +a particular sensor type. Once you get the list of sensor channels that are +active, you can perform any required operations such as configuring sensor +channel properties, controlling sensor channels and so on. + +Create an instance +of TSensrvChannelInfo and set the required channel type as +the search criteria. For example, to query for all double tapping channels +provided by accelerometer sensor, set the channel type as KSensrvChannelTypeIdAccelerometerDoubleTappingData. +TSensrvChannelInfo channelInfo; +channelInfo.iChannelType = KSensrvChannelTypeIdAccelerometerDoubleTappingData; + +Create an instance +of CSensrvChannelFinder class and use the CSensrvChannelFinder::FindChannelsL() function +to query for available sensor channels. +CSensrvChannelFinder* finder = CSensrvChannelFinder::NewL(); +finder->FindChannelsL(channelList, searchParameters); + +Create an instance +of RSensrvChannelInfoList to store the list of sensor channels. +RSensrvChannelInfoList channelInfoList; + + +

The channelInfoList contains +all the double tapping channels that are found. If several matching channels +are found, you can select the required channel by examining the content of +channel information objects inside channelInfoList.

+
+

This following code shows how to find double tapping channels +for accelerometer sensor:

..... +...... +/Construct a channel finder. + CSensrvChannelFinder* channelFinder; + channelFinder = CSensrvChannelFinder::NewL(); + CleanupStack::PushL( channelFinder ); + + // to store list of found channels. + RSensrvChannelInfoList channelInfoList; + + //Create and fill channel search criteria. + //In this example double tapping channel is searched. + TSensrvChannelInfo channelInfo; + channelInfo.iChannelType = KSensrvChannelTypeIdAccelerometerDoubleTappingData; + + //Find the double tapping channel + channelFinder->FindChannelsL( channelInfoList, channelInfo ); + + CleanupStack::PopAndDestroy( channelFinder ); // finder not needed any more + + if( channelInfoList.Count() != 1 ) + { + //The device does not support double tapping channel or + //there are several double tapping channels. + } + else + { + //double tapping channel found + } +..... +.... +
+
\ No newline at end of file