Reporting
Feature Data for a Single Feature Dynamically Using RFeatureControl
How to report feature data using RFeatureControl dynamically.
To report feature
data for a single feature using RFeatureControl dynamically,
take the following steps.
Create an instance of RFeatureControl,
// replace <featureUID> with a real Uid )
#include <featurecontrol.h>
#include <featureinfo.h> // for feature definitions
CMyClass::MyMethodL()
{
// Replace KFeatureUidx with real feature Uid.
// Open() must be called before calling any other methods.
// Disconnect is done by calling the Close() method.
RFeatureControl featureControl;
call its Open() function,
TInt err = featureControl.Open();
determine the Uid of the feature you want a report on,
create an instance of TFeatureEntry with the Uid
of the feature as argument to the constructor,
// Query single feature status and data
TFeatureEntry entry( KFeatureUid4 );
call the FeatureSupported() function of the RFeatureControl object
with the Uid of the feature entry as argument, and
err = control.FeatureSupported( entry );
if( err == KFeatureSupported )
{
TUint32 data = entry.FeatureData();
// do something with enabled feature's data
}
else if( err == KFeatureUnsupported )
{
// do or do not something with disabled feature's data
}
call the Close() function of the RFeatureControl object.
// Remember to call CloseL after using RFeatureControl.
// It disconnects the Feature Manager server.
featureControl.Close();
}
}
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.