CSensrvChannelFinder Class Reference

class CSensrvChannelFinder : public CBase

The CSensrvChannelFinder class provides an API that allows clients to discover the sensor channels supported by Sensor Services and receive notifications when channels are installed and uninstalled.

The channel specific header files e.g. for orientation, acceleration, proximity, will document whether a secure id, vendor id or a set of capabilities, if any, is required by the client to be able to view a channel or receive notifications for it. See the channel specific header files for these requirements.

On instantiation of this class a session connection to the Sensor Server is made. The Sensor server is a transient server and is started, if not already running, when a session connection is made. The sensor server is shutdown when a device-configured timeout period expires after the last session connection has been dropped. The Sensor Server will not shutdown if there is a session connection to it.

Each item in RSensrvChannelInfoList returned by FindChannelsL() contains a channel Id which is only valid for the lifetime of the sensor server. If a client requires that this id remains unchanged then the client must ensure that an instance of either CSensrvChannelFinder or CSensrvChannel remains instantiated. This keeps a session connection with the server open which prevents the sensor server from shutting down.

CSensrvChannel sensrvclient.lib
Since
S60 5.0

Inherits from

Constructor & Destructor Documentation

CSensrvChannelFinder()

CSensrvChannelFinder ( )

Default constructor.

Member Functions Documentation

FindChannelsL(RSensrvChannelInfoList &, const TSensrvChannelInfo &)

void FindChannelsL ( RSensrvChannelInfoList & aChannelList,
const TSensrvChannelInfo & aSearchParameters
) [pure virtual]

Retrieves a list of channels that meet the supplied search parameters. Only channels for which the client has the required secure id, vendor id and capabilities will be returned. See class description for further information.

Since
S60 5.0
leave
One of the system-wide error codes

Parameters

RSensrvChannelInfoList & aChannelList List of all channels matching the supplied search parameters. Each TSensrvChannelInfo instance in the list can be used to open a channel. Empty list is returned if no matching channels are found.
const TSensrvChannelInfo & aSearchParameters Parameters for which matching channels are to be found. To omit a field from the search use zero (if integer) or empty string (if descriptor). If all fields are zero or empty string all channels provided by the system will be returned. ChannelId, DataItemSize and Reserved data will be ignored if set.

NewL()

IMPORT_C CSensrvChannelFinder * NewL ( ) [static]

Two-phased constructor.

Since
S60 5.0
leave
KErrNoMemory
leave
One of the system-wide error codes

NewLC()

IMPORT_C CSensrvChannelFinder * NewLC ( ) [static]

Two-phased constructor.

Since
S60 5.0
leave
KErrNoMemory
leave
One of the system-wide error codes

SetChannelListenerL(MSensrvChannelListener *, const TSensrvChannelInfo &)

void SetChannelListenerL ( MSensrvChannelListener * aChannelListener,
const TSensrvChannelInfo & aSearchParameters
) [pure virtual]

Listens for channels that meet the supplied search parameters. Only channels for which the client has the required secure id, vendor id and capabilities will be returned. See class description. Listening can be stopped by providing a NULL parameter for the aChannelListener argument.

Since
S60 5.0
leave
KErrAlreadyExists if channel listener has already been set
leave
One of the system-wide error codes

Parameters

MSensrvChannelListener * aChannelListener Pointer to channel listener callback instance. The channel listener must be valid until the CSensrvChannelFinder object is destroyed or listening has been stopped. Listening can be stopped using a NULL parameter.
const TSensrvChannelInfo & aSearchParameters Parameters for which matching channel notifications are to be provided. To omit a field from the search use zero (if integer) or empty string (if descriptor). If all fields are zero or empty string all channels provided by the system will be returned. ChannelId, DataItemSize and Reserved data will be ignored if set.