openharmony 鸿蒙 capi-vibrator-type-h

2026-08-25 浏览 (1)

vibrator_type.h

Overview

Declares the APIs for starting or stopping vibration.

Reference file: <sensors/vibrator_type.h>

Library: libohvibrator.z.so

System capability: SystemCapability.Sensors.MiscDevice

Since: 11

Related module: Vibrator

Summary

Structs

Nametypedef KeywordDescription
Vibrator_AttributeVibrator_AttributeDefines a struct for the vibrator attribute.
Vibrator_FileDescriptionVibrator_FileDescriptionDefines a struct for the vibration file description.

Enumeration

Nametypedef KeywordDescription
Vibrator_ErrorCodeVibrator_ErrorCodeEnumerates the vibrator error codes.
Vibrator_UsageVibrator_UsageEnumerates the vibration scenarios.

Enum Description

Vibrator_ErrorCode

enum Vibrator_ErrorCode

Description

Enumerates the vibrator error codes.

Since: 11

Enum ItemDescription
PERMISSION_DENIED = 201Permission denied.
PARAMETER_ERROR = 401Parameter check failed. For example, a mandatory parameter is not passed in, or the parameter type passed in is incorrect.
UNSUPPORTED = 801The device does not support this API. Generally, this enumerated value is used for a device that supports the corresponding system capability but only parts of APIs.
DEVICE_OPERATION_FAILED = 14600101Device operation failed.

Vibrator_Usage

enum Vibrator_Usage

Description

Enumerates the vibration scenarios.

Since: 11

Enum ItemDescription
VIBRATOR_USAGE_UNKNOWN = 0Unknown scenario
VIBRATOR_USAGE_ALARM = 1Alarming
VIBRATOR_USAGE_RING = 2Ringing
VIBRATOR_USAGE_NOTIFICATION = 3Notification
VIBRATOR_USAGE_COMMUNICATION = 4Telecommunications
VIBRATOR_USAGE_TOUCH = 5Touch
VIBRATOR_USAGE_MEDIA = 6Multimedia
VIBRATOR_USAGE_PHYSICAL_FEEDBACK = 7Physical feedback
VIBRATOR_USAGE_SIMULATED_REALITY = 8Simulated reality

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 js-apis-vibrator

openharmony 鸿蒙 capi-sensor-sensor-subscriptionid

openharmony 鸿蒙 capi-sensor-sensor-subscriptionattribute

openharmony 鸿蒙 capi-vibrator-h

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 capi-vibrator-vibrator-filedescription

openharmony 鸿蒙 js-apis-sensor-sys

openharmony 鸿蒙 capi-oh-sensor-h

openharmony 鸿蒙 errorcode-sensor

openharmony 鸿蒙 capi-oh-sensor-type-h

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/DLAXhLVl