diff --git a/api/@ohos.distributedHardware.mechanicManager.d.ts b/api/@ohos.distributedHardware.mechanicManager.d.ts index 3f1a337d49c7b23c283b2db59429c4071a4c2cb3..e5a5eed669fb7aae87d14be29413136e107548ce 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.