This page was last modified 08:38, 7 April 2008.
CS000887 - Displaying information about available sensors
From Forum Nokia Wiki
| ID | CS000887 | Creation date | April 7, 2008 |
| Platform | S60 3rd Edition, FP1 | Tested on devices | Nokia N95 8GB |
| Category | Symbian C++ | Subcategory | Hardware, Sensor |
| Keywords (APIs, classes, methods, functions): CRRSensorApi, TRRSensorInfo, CRRSensorApi::FindSensorsL(), TRRSensorInfo::iSensorId, TRRSensorInfo::iSensorCategory, TRRSensorInfo::iSensorName |
Overview
This snippet displays information about available sensors on your device. The following information is displayed:
- Sensor name
- Sensor ID
- Sensor category
Note: In order to use the code, you need to install the sensor plug-in for your SDK.
This snippet can be self-signed.
MMP file
The following libraries are required:
LIBRARY RRSensorApi.lib
Source file
#include <aknnotewrappers.h> // CAknInformationNote #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(); // Display information about each of the sensors for (TInt i = 0; i < sensorCount; i++) { TInt sensorId = sensorList[i].iSensorId; TInt sensorCategory = sensorList[i].iSensorCategory; TBuf<KMaxSensorName> sensorName = sensorList[i].iSensorName; TBuf<255> buffer; _LIT(KTxt, "%S: %x, %x"); buffer.Format(KTxt, &sensorName, sensorId, sensorCategory); CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue); note->ExecuteLD(buffer); } CleanupStack::PopAndDestroy(); // sensorList
Postconditions
Information about available sensors is displayed.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 9210 graphics geometric transformation | Nokia_Archive | General Symbian C++ | 3 | 2005-04-06 11:10 |
| How to display a JPEG image,and what is the "container". | krishnaramram | Symbian Media (Graphics & Sounds) | 2 | 2008-03-17 05:41 |
| Linker error when using a Progress information bar... | Difflam | Symbian User Interface | 1 | 2003-02-26 14:36 |
| How to access netmonitor information? | kasra1357 | General Discussion | 5 | 2006-01-19 16:06 |
| Access from PC to user-created files on phone | loregian | General Symbian C++ | 0 | 2003-10-29 13:43 |

