From ab6d2f6256af037e6b664f9d2e4713e67cdbc2a1 Mon Sep 17 00:00:00 2001 From: MisterE Date: Wed, 25 Jun 2025 14:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B7=E8=BA=AB=E6=9C=BA=E6=A2=B0=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MisterE --- ...@ohos.distributedHardware.mechanicManager.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/api/@ohos.distributedHardware.mechanicManager.d.ts b/api/@ohos.distributedHardware.mechanicManager.d.ts index 3f1a337d49..e5a5eed669 100644 --- a/api/@ohos.distributedHardware.mechanicManager.d.ts +++ b/api/@ohos.distributedHardware.mechanicManager.d.ts @@ -202,6 +202,21 @@ declare namespace mechanicManager { */ function getMaxRotationSpeed(mechId: int): RotationSpeed; + /** + * Rotates a mechanical device at the specified speed. + * @param { int } mechId ID of the mechanical device. + * @param { RotationSpeed } speed Rotation speed. + * @param { int } duration Rotation duration. Unit: millisecond. + * @returns { Promise } Promise that return the execution result. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 33300001 - Service exception. + * @throws { BusinessError } 33300002 - Device not connected. + * @syscap SystemCapability.Mechanic.Core + * @systemapi + * @since 20 + */ + function rotateBySpeed(mechId: int, speed: RotationSpeed, duration: int): Promise; + /** * Stops a mechanical device from moving. * @param { int } mechId ID of the mechanical device. -- Gitee