1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @addtogroup Vibrator 18 * @{ 19 * 20 * @brief Provides a driver for upper-layer vibrator services. 21 * 22 * After obtaining a driver object or agent, a vibrator service get vibrator ability or 23 * set the vibrator effect using the functions provided by the driver object or agent. 24 * 25 * @since 5.0 26 * @version 1.3 27 */ 28 29/** 30 * @file IVibratorInterface.idl 31 * 32 * @brief Declares common APIs in the vibrator module. The APIs canObtains information about all the vibrator 33 * that support setting intensity and Start the vibrator according to the incoming vibration effect. 34 * 35 * @since 5.0 36 * @version 1.3 37 */ 38 39package ohos.hdi.vibrator.v1_3; 40 41import ohos.hdi.vibrator.v1_3.VibratorTypes; 42import ohos.hdi.vibrator.v1_2.IVibratorInterface; 43 44interface IVibratorInterface extends ohos.hdi.vibrator.v1_2.IVibratorInterface{ 45 /** 46 * @brief Controls the vibrator to perform a periodic vibration with the preset effect. 47 * 48 * One-shot vibration is mutually exclusive with periodic vibration. Before using periodic vibration, 49 * exit one-shot vibration. 50 * 51 * @param effectType Indicates the pointer to the preset effect type. It is recommended that the 52 * maximum length be 64 bytes. 53 * @param intensity Indicates amplitude intensity, ranging from 1 to 100. 54 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 55 * 56 * @since 5.0 57 * @version 1.3 58 */ 59 StartByIntensity([in] String effectType, [in] unsigned short intensity); 60 61 /** 62 * @brief Obtains the vibration wave information. 63 * 64 * @param vibratorId Indicates the vibration index. 65 * @param info Indicates the information. 66 * 67 * @return Returns <b>0</b> if the operation is successful. 68 * @return Returns negative value if the get failed. 69 * 70 * @since 5.0 71 * @version 1.3 72 */ 73 GetAllWaveInfo([in] int vibratorId, [out] struct HdfWaveInformation[] info); 74}