From 85710c2956ec17b404a0a051d17887b0e1d67d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=B9=8F=E8=BE=89?= Date: Sat, 7 Jun 2025 14:39:48 +0800 Subject: [PATCH] change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 梁鹏辉 --- vibrator/v2_0/IVibratorInterface.idl | 41 ++++++++++++++++++++++++++++ vibrator/v2_0/VibratorTypes.idl | 15 ++++++++++ 2 files changed, 56 insertions(+) diff --git a/vibrator/v2_0/IVibratorInterface.idl b/vibrator/v2_0/IVibratorInterface.idl index 0e97f748..76f4318f 100644 --- a/vibrator/v2_0/IVibratorInterface.idl +++ b/vibrator/v2_0/IVibratorInterface.idl @@ -287,4 +287,45 @@ interface IVibratorInterface { * @version 2.0 */ UnRegVibratorPlugCallback([in] IVibratorPlugCallback callbackObj); + + /** + * @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 2.0 + */ + PlayPatternBySessionId([in] DeviceVibratorInfo deviceVibratorInfo, [in] unsigned int sessionId, [in] struct HapticPaket hapticPaket); + + /** + * @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 2.0 + */ + PlayPackageBySession([in] DeviceVibratorInfo deviceVibratorInfo, [in] unsigned int sessionId, [in] struct VibratorPackage vibratorPackage); + + /** + * @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 2.2 + * @version 2.0 + */ + StopVibrateBySessionId([in] DeviceVibratorInfo deviceVibratorInfo, [in] unsigned int sessionId); } \ No newline at end of file diff --git a/vibrator/v2_0/VibratorTypes.idl b/vibrator/v2_0/VibratorTypes.idl index 6a4aa3b4..b58e920e 100644 --- a/vibrator/v2_0/VibratorTypes.idl +++ b/vibrator/v2_0/VibratorTypes.idl @@ -284,4 +284,19 @@ struct HdfVibratorPlugInfo { int vibratorCnt; /**< The vibration plug state. */ int status; +}; +/** + * @brief Defines the vibration data delivery packet. + * + * The information include the different trypes of vibrationsr; + * + * @since 4.1 + */ +struct VibratorPackage { + /** Indicates the vibration data delivery time. */ + int time; + /** Indicates the vibration number of data to be delivered. */ + int eventNum; + /** Indicates the vibration data delivery event array. */ + struct HapticEvent[] events; }; \ No newline at end of file -- Gitee