1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2023 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 4.1 26c5e268c6Sopenharmony_ci */ 27c5e268c6Sopenharmony_ci 28c5e268c6Sopenharmony_ci/** 29c5e268c6Sopenharmony_ci * @file VibratorTypes.idl 30c5e268c6Sopenharmony_ci * 31c5e268c6Sopenharmony_ci * @brief Declares common APIs in the vibrator module. The APIs canObtains information about all the vibrator 32c5e268c6Sopenharmony_ci * that support setting intensity and Start the vibrator according to the incoming vibration effect. 33c5e268c6Sopenharmony_ci * 34c5e268c6Sopenharmony_ci * @since 4.1 35c5e268c6Sopenharmony_ci * @version 1.2 36c5e268c6Sopenharmony_ci */ 37c5e268c6Sopenharmony_ci 38c5e268c6Sopenharmony_cipackage ohos.hdi.vibrator.v1_2; 39c5e268c6Sopenharmony_ci 40c5e268c6Sopenharmony_ciimport ohos.hdi.vibrator.v1_2.VibratorTypes; 41c5e268c6Sopenharmony_ciimport ohos.hdi.vibrator.v1_1.IVibratorInterface; 42c5e268c6Sopenharmony_ci 43c5e268c6Sopenharmony_ciinterface IVibratorInterface extends ohos.hdi.vibrator.v1_1.IVibratorInterface{ 44c5e268c6Sopenharmony_ci /** 45c5e268c6Sopenharmony_ci * @brief HD vibration data packet delivery. 46c5e268c6Sopenharmony_ci * 47c5e268c6Sopenharmony_ci * @param Indecates the Hd vibration data packet. 48c5e268c6Sopenharmony_ci * 49c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 50c5e268c6Sopenharmony_ci * @return Returns negative value if the get failed. 51c5e268c6Sopenharmony_ci * 52c5e268c6Sopenharmony_ci * @since 4.1 53c5e268c6Sopenharmony_ci * @version 1.2 54c5e268c6Sopenharmony_ci */ 55c5e268c6Sopenharmony_ci PlayHapticPattern([in] struct HapticPaket pkg); 56c5e268c6Sopenharmony_ci /** 57c5e268c6Sopenharmony_ci * @brief Obtains the vibration capability of the motor. 58c5e268c6Sopenharmony_ci * 59c5e268c6Sopenharmony_ci * @param Indecates the vibration capability of the motor. 60c5e268c6Sopenharmony_ci * 61c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 62c5e268c6Sopenharmony_ci * @return Returns negative value if the get failed. 63c5e268c6Sopenharmony_ci * 64c5e268c6Sopenharmony_ci * @since 4.1 65c5e268c6Sopenharmony_ci * @version 1.2 66c5e268c6Sopenharmony_ci */ 67c5e268c6Sopenharmony_ci GetHapticCapacity([out] struct HapticCapacity HapticCapacity); 68c5e268c6Sopenharmony_ci /** 69c5e268c6Sopenharmony_ci * @brief Obtains the start_up time of the motor. 70c5e268c6Sopenharmony_ci * 71c5e268c6Sopenharmony_ci * @param Indicates the time from command is issued to the time the motor starts. 72c5e268c6Sopenharmony_ci * 73c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 74c5e268c6Sopenharmony_ci * @return Returns negative value if the get failed. 75c5e268c6Sopenharmony_ci * 76c5e268c6Sopenharmony_ci * @since 4.1 77c5e268c6Sopenharmony_ci * @version 1.2 78c5e268c6Sopenharmony_ci */ 79c5e268c6Sopenharmony_ci GetHapticStartUpTime([in] int mode, [out] int startUpTime); 80c5e268c6Sopenharmony_ci /** 81c5e268c6Sopenharmony_ci * @brief Stops the vibration. 82c5e268c6Sopenharmony_ci * 83c5e268c6Sopenharmony_ci * Before the vibrator starts, it must stop vibrating in any mode. This function can be used during 84c5e268c6Sopenharmony_ci * and after the vibrating process. 85c5e268c6Sopenharmony_ci * 86c5e268c6Sopenharmony_ci * @param mode Indicates the vibration mode, which can be one-shot or periodic. For details, 87c5e268c6Sopenharmony_ci * see {@link HdfVibratorMode}. 88c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 89c5e268c6Sopenharmony_ci * 90c5e268c6Sopenharmony_ci * @since 4.1 91c5e268c6Sopenharmony_ci * @version 1.2 92c5e268c6Sopenharmony_ci */ 93c5e268c6Sopenharmony_ci StopV1_2([in] int mode); 94c5e268c6Sopenharmony_ci}