From 02ae41ced4221834d24297129578ece16c8d17c6 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Mon, 16 Jun 2025 14:22:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9Evibrator=20HDI=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanghongenaf --- vibrator/v2_0/IVibratorInterface.idl | 43 +++++++++++++++++++++++++++- vibrator/v2_0/VibratorTypes.idl | 17 +++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/vibrator/v2_0/IVibratorInterface.idl b/vibrator/v2_0/IVibratorInterface.idl index 0e97f748..23bd0c73 100644 --- a/vibrator/v2_0/IVibratorInterface.idl +++ b/vibrator/v2_0/IVibratorInterface.idl @@ -273,7 +273,7 @@ interface IVibratorInterface { */ RegVibratorPlugCallback([in] IVibratorPlugCallback callbackObj); - /** + /** * @brief UnRegisters the callback for reporting vibrator plug state. * * The deviceId means which pluged in this device. @@ -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 6.0 + * @version 1.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 6.0 + * @version 1.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 6.0 + * @version 1.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..24c89c3d 100644 --- a/vibrator/v2_0/VibratorTypes.idl +++ b/vibrator/v2_0/VibratorTypes.idl @@ -226,6 +226,23 @@ struct HapticPaket { struct HapticEvent[] events; }; +/** + * @brief Defines the vibration data delivery packet. + * + * The information include the different trypes of vibrationsr; + * + * @since 6.0 + * @version 1.0 + */ +struct VibratorPackage { + /** Indicates the pattern number of data to be delivered. */ + int patternNum; + /** Indicates the vibration duration of data to be delivered. */ + int packageduration; + /** Indicates the vibration data delivery pattern array. */ + struct HapticPaket[] patterns; +}; + /** * @brief Defines the vibration capability data package. * -- Gitee From dfb52327030fa0f57a77241c5d9927b4fbc9f641 Mon Sep 17 00:00:00 2001 From: wanghongenaf Date: Mon, 16 Jun 2025 11:11:03 +0000 Subject: [PATCH 2/2] update vibrator/v2_0/IVibratorInterface.idl. Signed-off-by: wanghongenaf --- vibrator/v2_0/IVibratorInterface.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vibrator/v2_0/IVibratorInterface.idl b/vibrator/v2_0/IVibratorInterface.idl index 23bd0c73..2b140160 100644 --- a/vibrator/v2_0/IVibratorInterface.idl +++ b/vibrator/v2_0/IVibratorInterface.idl @@ -273,7 +273,7 @@ interface IVibratorInterface { */ RegVibratorPlugCallback([in] IVibratorPlugCallback callbackObj); - /** + /** * @brief UnRegisters the callback for reporting vibrator plug state. * * The deviceId means which pluged in this device. -- Gitee