/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @addtogroup Vibrator * @{ * * @brief Provides a driver for upper-layer vibrator services. * * After obtaining a driver object or agent, a vibrator service get vibrator ability or * set the vibrator effect using the functions provided by the driver object or agent. * * @since 4.1 */ /** * @file VibratorTypes.idl * * @brief Declares common APIs in the vibrator module. The APIs canObtains information about all the vibrator * that support setting intensity and Start the vibrator according to the incoming vibration effect. * * @since 4.1 * @version 1.2 */ package ohos.hdi.vibrator.v1_2; import ohos.hdi.vibrator.v1_2.VibratorTypes; import ohos.hdi.vibrator.v1_1.IVibratorInterface; interface IVibratorInterface extends ohos.hdi.vibrator.v1_1.IVibratorInterface{ /** * @brief HD vibration data packet delivery. * * @param Indecates the Hd vibration data packet. * * @return Returns 0 if the operation is successful. * @return Returns negative value if the get failed. * * @since 4.1 * @version 1.2 */ PlayHapticPattern([in] struct HapticPaket pkg); /** * @brief Obtains the vibration capability of the motor. * * @param Indecates the vibration capability of the motor. * * @return Returns 0 if the operation is successful. * @return Returns negative value if the get failed. * * @since 4.1 * @version 1.2 */ GetHapticCapacity([out] struct HapticCapacity HapticCapacity); /** * @brief Obtains the start_up time of the motor. * * @param Indicates the time from command is issued to the time the motor starts. * * @return Returns 0 if the operation is successful. * @return Returns negative value if the get failed. * * @since 4.1 * @version 1.2 */ GetHapticStartUpTime([in] int mode, [out] int startUpTime); /** * @brief Stops the vibration. * * Before the vibrator starts, it must stop vibrating in any mode. This function can be used during * and after the vibrating process. * * @param mode Indicates the vibration mode, which can be one-shot or periodic. For details, * see {@link HdfVibratorMode}. * @return Returns 0 if the operation is successful; returns a negative value otherwise. * * @since 4.1 * @version 1.2 */ StopV1_2([in] int mode); }