×
Namespaces

Variants
Actions
Revision as of 06:46, 16 August 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:某些用户定义的震动强度值不被支持

From Nokia Developer Wiki
Jump to: navigation, search

Archived.png存档: 这篇文章是存档,因为考虑到今天它与第三方开发者建立商业解决方案不相关。

Article Metadata

兼容于
平台: S60 3rd Edition
S60 3rd Edition (initial release)

文章
翻译:
hoolee
最后由 hamishwillee 在 16 Aug 2012 编辑
  • 详细描述

定义在hwrmvibra.h中的HWRM震动API。提供了控制手机震动的能力。下列方法:

void CHWRMVibra::StartVibraL( TInt aDuration, TInt aIntensity );


允许设置一个用户自定义的震动强度。其中aIntensity定义了震动马达运转强度值。如果设置负值,这时震动马达的运转方向为相反。根据SDK文档描述。强度可以在下列值-100..100之间。超过的话将引起KErrArgument值错误。


此外。震动硬件也设置了一个震动速度最低限制。大多数机器通常为30。试图设置强度低于+/-30将会导致KErrGeneral错误。


  • 解决方案

用户定义的强度值应在(+/-)30...100之间。当使用上述方法时客户端还需要处理好下列错误代码:

  • KErrNotSupported - Device does not support user-defined vibra intensity values.
  • KErrArgument - One of the parameters is out of range.
  • KErrAccessDenied - Vibration setting in the user profile is not set.
  • KErrBadHandle - Vibra session has been invalidated.
  • KErrLocked - Vibra is locked down because too much continuous use or explicitly blocked (e.g. by a vibration-sensitive accessory).
  • KErrTimedOut - Timeout occurred in controlling vibra.
  • KErrInUse - Vibra is reserved by some other client.
  • KErrNoMemory - Memory allocation failure.
  • KErrGeneral - Vibra hardware does not support one of the parameters, or other hardware error.
This page was last modified on 16 August 2012, at 06:46.
233 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×