×
Namespaces

Variants
Actions

Archived:Starting/stopping/querying the vibration of the device using the CHWRMVibra class

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.



Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 2 (30 Nov 2006)
Last edited: hamishwillee (14 Jun 2012)

Overview

Starting/stopping/querying the vibration of the device using the CHWRMVibra class

Description

The CHWRMVibra class is published in S60 3rd Edition and onwards.
It provides the ability to control the device vibration.
The required library is WRMVibraClient.lib
The required header file is hwrmvibra.h
The following code example illustrates how to retrieve the vibration status:
iVibrate = CHWRMVibra::NewL();
CHWRMVibra::TVibraStatus iStatus = iVibrate->VibraStatus();
The returned values are:
EVibraStatusUnknown
EVibraStatusNotAllowed
EVibraStatusStopped
EVibraStatusOn
The following code example illustrates how to retrieve the vibration mode defined in the profile settings:
CHWRMVibra::TVibraModeState iState = iVibrate->VibraSettings();
The returned values are:
EVibraModeUnknown
EVibraModeON
EVibraModeOFF
The following code example illustrates how to start the vibration. The vibration setting must be EVibraModeON.
iVibrate->StartVibraL(0,50);
The first parameter is the duration (milliseconds). A value of 0 indicates that it will continue to vibrate until StopVibraL()  is called.
The second parameter is the intensity. It can range from -100 to 100.
The following code example illustrates how to stop the vibration.
iVibrate->StopVibraL();

This page was last modified on 14 June 2012, at 09:19.
23 page views in the last 30 days.