| ID | CS000886 | Creation date | April 7, 2008 |
| Platform | S60 3rd Edition, FP1 | Tested on devices | Nokia N95 8GB |
| Category | Symbian C++ | Subcategory | Hardware, Sensors |
| Keywords (APIs, classes, methods, functions): CRRSensorApi, TRRSensorInfo, CRRSensorApi::FindSensorsL() |
This snippet demonstrates how to obtain the number of available sensors on your device (for example, two on the Nokia N95 8GB: accelerometer sensor and rotation sensor).
Note: In order to use the code, you need to install the sensor plugin for your SDK.
This snippet can be self-signed.
The following libraries are required:
LIBRARY RRSensorApi.lib
#include <RRSensorApi.h>
RArray<TRRSensorInfo> sensorList;
CleanupClosePushL(sensorList);
// Retrieve list of available sensors
CRRSensorApi::FindSensorsL(sensorList);
// Get number of sensors available
TInt sensorCount = sensorList.Count();
CleanupStack::PopAndDestroy(); // sensorList
The number of available sensors is obtained.
No related wiki articles found