Use the chwrmvibra class to start/stop/query the device vibration status

Source: Internet
Author: User

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 ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.