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