Device, software version: s60 3rd edition s60 3rd edition,
FP1
Creation date:
Detailed description:
The chwrmvibra class was released in the s60 Third edition. It provides the ability to control the device vibration module.
The Link Library we need is: wrmvibraclient. Lib
Link header file: hwrmvibra. h
The following code demonstrates how to obtain the vibration status:
Code:
Ivibrate = chwrmvibra: newl ();
Chwrmvibra: tvibrastatus istatus =
Ivibrate-> vibrastatus ();
The returned values include:
Code:
Evibrastatusunknown
Evibrastatusnotallowed
Evibrastatusstopped
Evibrastatuson
The following code demonstrates how to obtain the vibration part settings in the scenario mode.
Code:
Chwrmvibra: tvibramodestate istate =
Ivibrate-> vibrasettings (); return value:
Code:
Evibramodeunknown
Evibramodeon
Evibramodeoff the following code demonstrates how to start the vibration. The vibration setting must be evibramodeon.
Code:
Ivibrate-> startvibral (); the first parameter indicates the duration (microseconds). If it is 0, the vibration will continue until stopvibral () is called.
The second parameter indicates the intensity value, which ranges from-100 to 100.
The following code demonstrates how to stop the vibration
Code:
Ivibrate-> stopvibral ();